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
58{
60 drFPW = 1,
61 drRPW = 2,
62 drRVW = 3,
63 drFVW = 4,
64 drFPB = 5,
65 drRPB = 6,
66 drRVB = 7,
67 drFVB = 8,
68};
69
74
75// The structs below are also tabulated in docs/users_guide/util_library.md, with their
76// units and frames spelled out for readers who do not read C++. Update both together.
77// --8<-- [start:dr_config]
80{
82 bool smoothing = true;
83
85 LengthMeters maxDistance = 100000.0;
86
88 sen::Duration maxDeltaTime {std::chrono::seconds(1)};
89
92 sen::Duration smoothingInterval {std::chrono::milliseconds(20)};
93
95 sen::Duration positionConvergenceTime {std::chrono::milliseconds(500)};
96
98 DampingCoefficient positionDamping = 1.0;
99
101 sen::Duration orientationConvergenceTime {std::chrono::milliseconds(50)};
102
104 DampingCoefficient orientationDamping = 20.0;
105
109
114};
115// --8<-- [end:dr_config]
116
119{
120 LengthMeters x;
121 LengthMeters y;
122 LengthMeters z;
123};
124
127{
128 LatitudeDegrees latitude;
129 LongitudeDegrees longitude;
130 LengthMeters altitude;
131};
132
135{
136 AngleRadians psi;
137 AngleRadians theta;
138 AngleRadians phi;
139};
140
143{
144 VelocityMetersPerSecond x;
145 VelocityMetersPerSecond y;
146 VelocityMetersPerSecond z;
147};
148
151{
152 AccelerationMetersPerSecondSquared x;
153 AccelerationMetersPerSecondSquared y;
154 AccelerationMetersPerSecondSquared z;
155};
156
159{
160 AngularVelocityRadiansPerSecond x;
161 AngularVelocityRadiansPerSecond y;
162 AngularVelocityRadiansPerSecond z;
163};
164
167{
168 AngularAccelerationRadiansPerSecondSquared x;
169 AngularAccelerationRadiansPerSecondSquared y;
170 AngularAccelerationRadiansPerSecondSquared z;
171};
172
173// --8<-- [start:situation]
203// --8<-- [end:situation]
204
205// --8<-- [start:geodetic_situation]
234// --8<-- [end:geodetic_situation]
235
237[[nodiscard]] Situation drFpw(const Situation& value, sen::TimeStamp time) noexcept;
238
240[[nodiscard]] Situation drFpb(const Situation& value, sen::TimeStamp time) noexcept;
241
243[[nodiscard]] Situation drRpw(const Situation& value, sen::TimeStamp time) noexcept;
244
247[[nodiscard]] Situation drRpb(const Situation& value, sen::TimeStamp time) noexcept;
248
250[[nodiscard]] Situation drRvw(const Situation& value, sen::TimeStamp time) noexcept;
251
253[[nodiscard]] Situation drRvb(const Situation& value, sen::TimeStamp time) noexcept;
254
256[[nodiscard]] Situation drFvw(const Situation& value, sen::TimeStamp time) noexcept;
257
259[[nodiscard]] Situation drFvb(const Situation& value, sen::TimeStamp time) noexcept;
260
262
263} // namespace sen::util
264
265#endif // SEN_UTIL_DR_ALGORITHMS_H
A time duration.
Definition duration.h:25
A point in time.
Definition timestamp.h:26
bool useCommitTimeAsOrigin
Measure the extrapolation from the instant the producer committed the data rather than from the insta...
Definition algorithms.h:108
AccelerationMetersPerSecondSquared z
Definition algorithms.h:154
sen::Duration positionConvergenceTime
Convergence time for the smoothed position to match the updated position.
Definition algorithms.h:95
LengthMeters maxDistance
No smoothing is performed for displacements bigger than this distance.
Definition algorithms.h:85
LatitudeDegrees latitude
Definition algorithms.h:128
LengthMeters y
Definition algorithms.h:121
AngularVelocityRadiansPerSecond z
Definition algorithms.h:162
VelocityMetersPerSecond y
Definition algorithms.h:145
SpatialAlgorithm algorithm
Which algorithm DeadReckonerBase applies. A Situation does not carry one, so it has to be told; the c...
Definition algorithms.h:113
DampingCoefficient orientationDamping
Damping coefficient for the smoothed orientation solution.
Definition algorithms.h:104
AccelerationMetersPerSecondSquared y
Definition algorithms.h:153
AccelerationMetersPerSecondSquared x
Definition algorithms.h:152
bool isFrozen
When true, no extrapolation is performed because the entity is frozen.
Definition algorithms.h:210
Location worldLocation
Position in ECEF.
Definition algorithms.h:184
AngularVelocity angularVelocity
Angular velocity vector with respect to body reference system.
Definition algorithms.h:194
AngularAccelerationRadiansPerSecondSquared y
Definition algorithms.h:169
AngularVelocityRadiansPerSecond y
Definition algorithms.h:161
AngleRadians theta
Definition algorithms.h:137
LengthMeters x
Definition algorithms.h:120
AngularAccelerationRadiansPerSecondSquared z
Definition algorithms.h:170
VelocityMetersPerSecond x
Definition algorithms.h:144
Velocity velocityVector
Velocity vector with respect to ECEF or body reference system (depending on the reference system of t...
Definition algorithms.h:191
AngleRadians psi
Definition algorithms.h:136
AngleRadians phi
Definition algorithms.h:138
Velocity velocityVector
Velocity vector with respect to NED.
Definition algorithms.h:223
LengthMeters z
Definition algorithms.h:122
AngularVelocity angularVelocity
Angular velocity vector with respect to body-reference system.
Definition algorithms.h:226
VelocityMetersPerSecond z
Definition algorithms.h:146
Orientation orientation
Orientation of the body reference system (x forward, y right, z down) with respect to NED (North - Ea...
Definition algorithms.h:220
LongitudeDegrees longitude
Definition algorithms.h:129
Orientation orientation
Orientation of the body reference system (x forward, y right, z down) with respect to ECEF.
Definition algorithms.h:187
Acceleration accelerationVector
Acceleration vector with respect to ECEF or body reference system (depending on the reference system ...
Definition algorithms.h:198
AngularAcceleration angularAcceleration
Angular acceleration vector with respect to body-reference system.
Definition algorithms.h:232
Acceleration accelerationVector
Acceleration vector with respect to NED.
Definition algorithms.h:229
DampingCoefficient positionDamping
Damping coefficient for the smoothed position solution.
Definition algorithms.h:98
AngularAccelerationRadiansPerSecondSquared x
Definition algorithms.h:168
sen::Duration maxDeltaTime
No smoothing is performed for time deltas bigger than this duration.
Definition algorithms.h:88
sen::TimeStamp timeStamp
TimeStamp of the instant when the situation is computed.
Definition algorithms.h:181
AngularVelocityRadiansPerSecond x
Definition algorithms.h:160
sen::Duration orientationConvergenceTime
Convergence time for the smoothed orientation to match the updated orientation.
Definition algorithms.h:101
GeodeticWorldLocation worldLocation
World Location in Geodetic (Latitude, Longitude, Altitude).
Definition algorithms.h:216
bool smoothing
If true, the position and orientation of the input data is smoothed removing noise.
Definition algorithms.h:82
AngularAcceleration angularAcceleration
Angular acceleration vector with respect to body reference system.
Definition algorithms.h:201
sen::Duration smoothingInterval
Maximum time interval used to update the smoothed solution. It is used to prevent the smoothed soluti...
Definition algorithms.h:92
bool isFrozen
When true, no extrapolation is performed because the entity is frozen.
Definition algorithms.h:178
LengthMeters altitude
Definition algorithms.h:130
sen::TimeStamp timeStamp
TimeStamp of the instant when the situation is computed.
Definition algorithms.h:213
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:70
SpatialAlgorithm
Length in meters.
Definition algorithms.h:58
Situation drFpw(const Situation &value, sen::TimeStamp time) noexcept
Returns the extrapolated situation using the FPW algorithm.
@ drFPW
Definition algorithms.h:60
@ drRVB
Definition algorithms.h:66
@ drFPB
Definition algorithms.h:64
@ drRVW
Definition algorithms.h:62
@ drFVB
Definition algorithms.h:67
@ drRPW
Definition algorithms.h:61
@ drRPB
Definition algorithms.h:65
@ drStatic
Definition algorithms.h:59
@ drFVW
Definition algorithms.h:63
Acceleration struct.
Definition algorithms.h:151
AngularAcceleration struct.
Definition algorithms.h:167
AngularVelocity struct.
Definition algorithms.h:159
Dead Reckoning configuration.
Definition algorithms.h:80
GeodeticSituation structure with the following parameters:
Definition algorithms.h:208
World location in geodetic coordinates.
Definition algorithms.h:127
World Location struct.
Definition algorithms.h:119
Orientation struct.
Definition algorithms.h:135
Situation structure with the following parameters:
Definition algorithms.h:176
Velocity struct.
Definition algorithms.h:143
@ 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