Sen API
Sen Libraries
Loading...
Searching...
No Matches
dead_reckoner_impl.h
Go to the documentation of this file.
1// === dead_reckoner_impl.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_DETAIL_DEAD_RECKONER_IMPL_H
9#define SEN_UTIL_DR_DETAIL_DEAD_RECKONER_IMPL_H
10
11// sen
13
15{
16
19
21template <typename T>
22[[nodiscard]] T toRpr(const Location& value);
23
25template <typename T>
26[[nodiscard]] T toRpr(const Orientation& value);
27
29template <typename T>
30[[nodiscard]] T toRpr(const Velocity& value);
31
33template <typename T>
34[[nodiscard]] T toRpr(const Acceleration& value);
35
37template <typename T>
38[[nodiscard]] T toRpr(const AngularVelocity& value);
39
41template <typename T>
42[[nodiscard]] Location fromRprLocation(const T& value);
43
45template <typename T>
46[[nodiscard]] Orientation fromRprOrientation(const T& value);
47
49template <typename T>
50[[nodiscard]] Velocity fromRprVelocity(const T& value);
51
53template <typename T>
54[[nodiscard]] Acceleration fromRprAcceleration(const T& value);
55
57template <typename T>
58[[nodiscard]] AngularVelocity fromRprAngularVelocity(const T& value);
59
61[[nodiscard]] GeodeticWorldLocation toLla(const Location& worldLocation) noexcept;
62
64[[nodiscard]] Location toEcef(const GeodeticWorldLocation& latLonAlt) noexcept;
65
67[[nodiscard]] Orientation ecefToNed(const Orientation& value, const GeodeticWorldLocation& latLonAlt) noexcept;
68
70[[nodiscard]] Velocity ecefToNed(const Velocity& value, const GeodeticWorldLocation& geodeticPosition) noexcept;
71
73[[nodiscard]] Acceleration ecefToNed(const Acceleration& value, const GeodeticWorldLocation& geodeticPosition) noexcept;
74
76[[nodiscard]] Orientation nedToEcef(const Orientation& value, const GeodeticWorldLocation& latLonAlt) noexcept;
77
79[[nodiscard]] Velocity nedToEcef(const Velocity& value, const GeodeticWorldLocation& location) noexcept;
80
82[[nodiscard]] Acceleration nedToEcef(const Acceleration& value, const GeodeticWorldLocation& location) noexcept;
83
85[[nodiscard]] Velocity bodyToNed(const Velocity& value, const Orientation& orientationNed) noexcept;
86
88[[nodiscard]] AngularVelocity bodyToNed(const AngularVelocity& value, const Orientation& orientationNed) noexcept;
89
92 const Orientation& orientationNed) noexcept;
93
95[[nodiscard]] Acceleration bodyToNed(const Acceleration& value, const Orientation& orientationNed) noexcept;
96
98void smoothImpl(Situation& situation, const Situation& update, const DrConfig& config);
99
101[[nodiscard]] LengthMeters computeDistance(const Location& start, const Location& end);
102
104
105//-------------------------------------------------------------------------------------------------------------------
106// Inline implementation
107//-------------------------------------------------------------------------------------------------------------------
108
109template <typename T>
110inline T toRpr(const Location& value)
111{
112 return {value.x, value.y, value.z};
113}
114
115template <typename T>
116inline T toRpr(const Orientation& value)
117{
118 return {value.psi, value.theta, value.phi};
119}
120
121template <typename T>
122inline T toRpr(const Velocity& value)
123{
124 return {value.x, value.y, value.z};
125}
126
127template <typename T>
128inline T toRpr(const Acceleration& value)
129{
130 return {value.x, value.y, value.z};
131}
132
133template <typename T>
134inline T toRpr(const AngularVelocity& value)
135{
136 return {value.x, value.y, value.z};
137}
138
139template <typename T>
140inline Location fromRprLocation(const T& value)
141{
142 return {value.x, value.y, value.z};
143}
144
145template <typename T>
146inline Orientation fromRprOrientation(const T& value)
147{
148 return {value.psi, value.theta, value.phi};
149}
150
152template <typename T>
153inline Velocity fromRprVelocity(const T& value)
154{
155 return {value.xVelocity, value.yVelocity, value.zVelocity};
156}
157
159template <typename T>
160inline Acceleration fromRprAcceleration(const T& value)
161{
162 return {value.xAcceleration, value.yAcceleration, value.zAcceleration};
163}
164
166template <typename T>
168{
169 return {value.xAngularVelocity, value.yAngularVelocity, value.zAngularVelocity};
170}
171
172} // namespace sen::util::impl
173
174#endif // SEN_UTIL_DR_DETAIL_DEAD_RECKONER_IMPL_H
AccelerationMetersPerSecondSquared z
Definition algorithms.h:122
LengthMeters y
Definition algorithms.h:89
AngularVelocityRadiansPerSecond z
Definition algorithms.h:130
VelocityMetersPerSecond y
Definition algorithms.h:113
AccelerationMetersPerSecondSquared y
Definition algorithms.h:121
AccelerationMetersPerSecondSquared x
Definition algorithms.h:120
AngularVelocityRadiansPerSecond y
Definition algorithms.h:129
AngleRadians theta
Definition algorithms.h:105
LengthMeters x
Definition algorithms.h:88
VelocityMetersPerSecond x
Definition algorithms.h:112
AngleRadians psi
Definition algorithms.h:104
AngleRadians phi
Definition algorithms.h:106
LengthMeters z
Definition algorithms.h:90
VelocityMetersPerSecond z
Definition algorithms.h:114
AngularVelocityRadiansPerSecond x
Definition algorithms.h:128
Location toEcef(const GeodeticWorldLocation &latLonAlt) noexcept
Translates from Geodetic (LatLonAlt) to ECEF WorldLocation coordinates.
LengthMeters computeDistance(const Location &start, const Location &end)
Computes the distance between two World locations.
Orientation ecefToNed(const Orientation &value, const GeodeticWorldLocation &latLonAlt) noexcept
Translates the Orientation in euler angles from ECEF to NED using quaternions.
void smoothImpl(Situation &situation, const Situation &update, const DrConfig &config)
Updates the smoothed situation, both in position and orientation.
Acceleration fromRprAcceleration(const T &value)
Translates to Acceleration struct from a RPR Acceleration.
Definition dead_reckoner_impl.h:160
Velocity fromRprVelocity(const T &value)
Translates to a Velocity struct from a RPR Velocity.
Definition dead_reckoner_impl.h:153
GeodeticWorldLocation toLla(const Location &worldLocation) noexcept
Translates from ECEF Location to Geodetic (LatLonAlt) Location.
Orientation nedToEcef(const Orientation &value, const GeodeticWorldLocation &latLonAlt) noexcept
Translates the Orientation in euler angles from NED to ECEF using quaternions.
T toRpr(const Location &value)
Translates a Location struct to a RPR WorldLocation given as template argument.
Definition dead_reckoner_impl.h:110
AngularVelocity fromRprAngularVelocity(const T &value)
Translates to AngularVelocity struct from a RPR AngularVelocity.
Definition dead_reckoner_impl.h:167
Velocity bodyToNed(const Velocity &value, const Orientation &orientationNed) noexcept
Translates Velocity vectors expressed in body coordinates to NED coordinates.
Orientation fromRprOrientation(const T &value)
Translates to an Orientation struct from a RPR Orientation.
Definition dead_reckoner_impl.h:146
Location fromRprLocation(const T &value)
Translates to a Location struct from a RPR WorldLocation.
Definition dead_reckoner_impl.h:140
Acceleration struct.
Definition algorithms.h:119
AngularAcceleration struct.
Definition algorithms.h:135
AngularVelocity struct.
Definition algorithms.h:127
Length in meters.
Definition algorithms.h:58
World location in geodetic coordinates.
Definition algorithms.h:95
World Location struct.
Definition algorithms.h:87
Orientation struct.
Definition algorithms.h:103
Situation structure with the following parameters:
Definition algorithms.h:143
Velocity struct.
Definition algorithms.h:111
Definition dead_reckoner_impl.h:15