Sen API
Sen Libraries
Loading...
Searching...
No Matches
algorithms.h
Go to the documentation of this file.
1// === algorithms.h ====================================================================================================
2// Sen Infrastructure
3// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4// See the LICENSE.txt file for more information.
5// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6// =====================================================================================================================
7
8#ifndef SEN_UTIL_DR_ALGORITHMS_H
9#define SEN_UTIL_DR_ALGORITHMS_H
10
11// sen
16
17// std
18#include <array>
19
20namespace sen::util
21{
22
25
27SEN_NON_RANGED_QUANTITY(LengthMeters, f64)
28
29
30SEN_NON_RANGED_QUANTITY(VelocityMetersPerSecond, f32)
31
32
33SEN_NON_RANGED_QUANTITY(AccelerationMetersPerSecondSquared, f32)
34
35
36SEN_NON_RANGED_QUANTITY(AngleRadians, f32)
37
38
39SEN_NON_RANGED_QUANTITY(AngularVelocityRadiansPerSecond, f32)
40
41
42SEN_NON_RANGED_QUANTITY(AngularAccelerationRadiansPerSecondSquared, f32)
43
44
45SEN_RANGED_QUANTITY(LatitudeDegrees, f64, -90.0, 90.0)
46
47
48SEN_RANGED_QUANTITY(LongitudeDegrees, f64, -180.0, 180.0)
49
51SEN_NON_RANGED_QUANTITY(TimeSeconds, f64)
52
54SEN_NON_RANGED_QUANTITY(DampingCoefficient, f64)
55
56// The structs below are also tabulated in docs/users_guide/util_library.md, with their
57// units and frames spelled out for readers who do not read C++. Update both together.
58// --8<-- [start:dr_config]
61{
63 bool smoothing = true;
64
66 LengthMeters maxDistance = 100000.0;
67
69 sen::Duration maxDeltaTime {std::chrono::seconds(1)};
70
73 sen::Duration smoothingInterval {std::chrono::milliseconds(20)};
74
76 sen::Duration positionConvergenceTime {std::chrono::milliseconds(500)};
77
79 DampingCoefficient positionDamping = 1.0;
80
82 sen::Duration orientationConvergenceTime {std::chrono::milliseconds(50)};
83
85 DampingCoefficient orientationDamping = 20.0;
86};
87// --8<-- [end:dr_config]
88
91{
92 LengthMeters x;
93 LengthMeters y;
94 LengthMeters z;
95};
96
99{
100 LatitudeDegrees latitude;
101 LongitudeDegrees longitude;
102 LengthMeters altitude;
103};
104
107{
108 AngleRadians psi;
109 AngleRadians theta;
110 AngleRadians phi;
111};
112
115{
116 VelocityMetersPerSecond x;
117 VelocityMetersPerSecond y;
118 VelocityMetersPerSecond z;
119};
120
123{
124 AccelerationMetersPerSecondSquared x;
125 AccelerationMetersPerSecondSquared y;
126 AccelerationMetersPerSecondSquared z;
127};
128
131{
132 AngularVelocityRadiansPerSecond x;
133 AngularVelocityRadiansPerSecond y;
134 AngularVelocityRadiansPerSecond z;
135};
136
139{
140 AngularAccelerationRadiansPerSecondSquared x;
141 AngularAccelerationRadiansPerSecondSquared y;
142 AngularAccelerationRadiansPerSecondSquared z;
143};
144
145// --8<-- [start:situation]
175// --8<-- [end:situation]
176
177// --8<-- [start:geodetic_situation]
206// --8<-- [end:geodetic_situation]
207
210{
212 drFPW = 1,
213 drRPW = 2,
214 drRVW = 3,
215 drFVW = 4,
216 drFPB = 5,
217 drRPB = 6,
218 drRVB = 7,
219 drFVB = 8,
220};
221
226
228[[nodiscard]] Situation drFpw(const Situation& value, sen::TimeStamp time) noexcept;
229
231[[nodiscard]] Situation drFpb(const Situation& value, sen::TimeStamp time) noexcept;
232
234[[nodiscard]] Situation drRpw(const Situation& value, sen::TimeStamp time) noexcept;
235
238[[nodiscard]] Situation drRpb(const Situation& value, sen::TimeStamp time) noexcept;
239
241[[nodiscard]] Situation drRvw(const Situation& value, sen::TimeStamp time) noexcept;
242
244[[nodiscard]] Situation drRvb(const Situation& value, sen::TimeStamp time) noexcept;
245
247[[nodiscard]] Situation drFvw(const Situation& value, sen::TimeStamp time) noexcept;
248
250[[nodiscard]] Situation drFvb(const Situation& value, sen::TimeStamp time) noexcept;
251
253
254} // namespace sen::util
255
256#endif // SEN_UTIL_DR_ALGORITHMS_H
A time duration.
Definition duration.h:25
A point in time.
Definition timestamp.h:26
AccelerationMetersPerSecondSquared z
Definition algorithms.h:126
sen::Duration positionConvergenceTime
Convergence time for the smoothed position to match the updated position.
Definition algorithms.h:76
LengthMeters maxDistance
No smoothing is performed for displacements bigger than this distance.
Definition algorithms.h:66
LatitudeDegrees latitude
Definition algorithms.h:100
LengthMeters y
Definition algorithms.h:93
AngularVelocityRadiansPerSecond z
Definition algorithms.h:134
VelocityMetersPerSecond y
Definition algorithms.h:117
DampingCoefficient orientationDamping
Damping coefficient for the smoothed orientation solution.
Definition algorithms.h:85
AccelerationMetersPerSecondSquared y
Definition algorithms.h:125
AccelerationMetersPerSecondSquared x
Definition algorithms.h:124
bool isFrozen
When true, no extrapolation is performed because the entity is frozen.
Definition algorithms.h:182
Location worldLocation
Position in ECEF.
Definition algorithms.h:156
AngularVelocity angularVelocity
Angular velocity vector with respect to body reference system.
Definition algorithms.h:166
AngularAccelerationRadiansPerSecondSquared y
Definition algorithms.h:141
AngularVelocityRadiansPerSecond y
Definition algorithms.h:133
AngleRadians theta
Definition algorithms.h:109
LengthMeters x
Definition algorithms.h:92
AngularAccelerationRadiansPerSecondSquared z
Definition algorithms.h:142
VelocityMetersPerSecond x
Definition algorithms.h:116
Velocity velocityVector
Velocity vector with respect to ECEF or body reference system (depending on the reference system of t...
Definition algorithms.h:163
AngleRadians psi
Definition algorithms.h:108
AngleRadians phi
Definition algorithms.h:110
Velocity velocityVector
Velocity vector with respect to NED.
Definition algorithms.h:195
LengthMeters z
Definition algorithms.h:94
AngularVelocity angularVelocity
Angular velocity vector with respect to body-reference system.
Definition algorithms.h:198
VelocityMetersPerSecond z
Definition algorithms.h:118
Orientation orientation
Orientation of the body reference system (x forward, y right, z down) with respect to NED (North - Ea...
Definition algorithms.h:192
LongitudeDegrees longitude
Definition algorithms.h:101
Orientation orientation
Orientation of the body reference system (x forward, y right, z down) with respect to ECEF.
Definition algorithms.h:159
Acceleration accelerationVector
Acceleration vector with respect to ECEF or body reference system (depending on the reference system ...
Definition algorithms.h:170
AngularAcceleration angularAcceleration
Angular acceleration vector with respect to body-reference system.
Definition algorithms.h:204
Acceleration accelerationVector
Acceleration vector with respect to NED.
Definition algorithms.h:201
DampingCoefficient positionDamping
Damping coefficient for the smoothed position solution.
Definition algorithms.h:79
AngularAccelerationRadiansPerSecondSquared x
Definition algorithms.h:140
sen::Duration maxDeltaTime
No smoothing is performed for time deltas bigger than this duration.
Definition algorithms.h:69
sen::TimeStamp timeStamp
TimeStamp of the instant when the situation is computed.
Definition algorithms.h:153
AngularVelocityRadiansPerSecond x
Definition algorithms.h:132
sen::Duration orientationConvergenceTime
Convergence time for the smoothed orientation to match the updated orientation.
Definition algorithms.h:82
GeodeticWorldLocation worldLocation
World Location in Geodetic (Latitude, Longitude, Altitude).
Definition algorithms.h:188
bool smoothing
If true, the position and orientation of the input data is smoothed removing noise.
Definition algorithms.h:63
AngularAcceleration angularAcceleration
Angular acceleration vector with respect to body reference system.
Definition algorithms.h:173
sen::Duration smoothingInterval
Maximum time interval used to update the smoothed solution. It is used to prevent the smoothed soluti...
Definition algorithms.h:73
bool isFrozen
When true, no extrapolation is performed because the entity is frozen.
Definition algorithms.h:150
LengthMeters altitude
Definition algorithms.h:102
sen::TimeStamp timeStamp
TimeStamp of the instant when the situation is computed.
Definition algorithms.h:185
Situation drRvb(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the RVB algorithm.
Situation drRvw(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the RVW algorithm.
Situation drFpb(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the FPB algorithm. The velocity is expressed in body coordin...
Situation drFvb(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the FVB algorithm.
Situation drRpb(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the RPB algorithm. The input situation should be expressed i...
Situation drRpw(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the RPW algorithm.
Situation drFvw(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the FVW algorithm.
constexpr std::array< SpatialAlgorithm, 4U > bodyAlgorithms
Definition algorithms.h:222
SpatialAlgorithm
Enumeration of the different Spatial algorithms.
Definition algorithms.h:210
Situation drFpw(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the FPW algorithm.
@ drFPW
Definition algorithms.h:212
@ drRVB
Definition algorithms.h:218
@ drFPB
Definition algorithms.h:216
@ drRVW
Definition algorithms.h:214
@ drFVB
Definition algorithms.h:219
@ drRPW
Definition algorithms.h:213
@ drRPB
Definition algorithms.h:217
@ drStatic
Definition algorithms.h:211
@ drFVW
Definition algorithms.h:215
Acceleration struct.
Definition algorithms.h:123
AngularAcceleration struct.
Definition algorithms.h:139
AngularVelocity struct.
Definition algorithms.h:131
Length in meters.
Definition algorithms.h:61
GeodeticSituation structure with the following parameters:
Definition algorithms.h:180
World location in geodetic coordinates.
Definition algorithms.h:99
World Location struct.
Definition algorithms.h:91
Orientation struct.
Definition algorithms.h:107
Situation structure with the following parameters:
Definition algorithms.h:148
Velocity struct.
Definition algorithms.h:115
@ time
Definition unit.h:34
#define SEN_NON_RANGED_QUANTITY(class_name, value_type)
Use this macro to define types for quantities that specify no range NOLINTNEXTLINE(cppcoreguidelines-...
Definition quantity.h:148
float32_t f32
Definition numbers.h:28
#define SEN_RANGED_QUANTITY(class_name, value_type, min_value, max_value)
Use this macro to define types for values that shall stay within some [min, max] range....
Definition quantity.h:135
float64_t f64
Definition numbers.h:29
Definition iterator_adapters.h:16