cdd_v2-1-1_getters.h
Go to the documentation of this file.
1 /*
2 =============================================================================
3 MIT License
4 
5 Copyright (c) 2023-2025 Institute for Automotive Engineering (ika), RWTH Aachen University
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 =============================================================================
25 */
26 
32 #ifndef ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_1_1_GETTERS_H
33 #define ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_1_1_GETTERS_H
34 
35 #include <GeographicLib/UTMUPS.hpp>
36 
38 
45 inline double getLongitudinalAcceleration(const AccelerationComponent& longitudinal_acceleration) {
46  return ((double)longitudinal_acceleration.value.value) * 1e-1;
47 }
48 
55 inline double getLongitudinalAccelerationConfidence(const AccelerationComponent& longitudinal_acceleration) {
56  return ((double)longitudinal_acceleration.confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
57 }
58 
65 inline double getLateralAcceleration(const AccelerationComponent& lateral_acceleration) {
66  return ((double)lateral_acceleration.value.value) * 1e-1;
67 }
68 
75 inline double getLateralAccelerationConfidence(const AccelerationComponent& lateral_acceleration) {
76  return ((double)lateral_acceleration.confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
77 }
78 
79 
86 template <typename PositionConfidenceEllipse>
87 inline std::tuple<double, double, double> getPositionConfidenceEllipse(PositionConfidenceEllipse& position_confidence_ellipse) {
88  return {
89  getSemiAxis(position_confidence_ellipse.semi_major_axis_length),
90  getSemiAxis(position_confidence_ellipse.semi_minor_axis_length),
91  position_confidence_ellipse.semi_major_axis_orientation.value * 1e-1
92  };
93 }
94 
102 template <typename PositionConfidenceEllipse>
103 inline std::array<double, 4> getPositionConfidenceEllipse(const PositionConfidenceEllipse& position_confidence_ellipse, const double object_heading){
104  auto [semi_major, semi_minor, major_orientation] = getPositionConfidenceEllipse(position_confidence_ellipse);
105  return CovMatrixFromConfidenceEllipse(semi_major, semi_minor, major_orientation, object_heading);
106 }
107 
115 template <typename PositionConfidenceEllipse>
116 inline std::array<double, 4> getWGSPositionConfidenceEllipse(const PositionConfidenceEllipse& position_confidence_ellipse){
117  auto [semi_major, semi_minor, major_orientation] = getPositionConfidenceEllipse(position_confidence_ellipse);
118  return WGSCovMatrixFromConfidenceEllipse(semi_major, semi_minor, major_orientation);
119 }
120 
121 
122 #endif // ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_1_1_GETTERS_H
cdd_getters_common.h
Common getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1 and v2....
getSemiAxis
double getSemiAxis(const SemiAxisLength &semi_axis_length)
Get the Semi Axis object.
Definition: cdd_getters_common.h:151
getLongitudinalAccelerationConfidence
double getLongitudinalAccelerationConfidence(const AccelerationComponent &longitudinal_acceleration)
Get the Longitudinal Acceleration Confidence.
Definition: cdd_v2-1-1_getters.h:55
etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR
constexpr const double ONE_D_GAUSSIAN_FACTOR
Definition: constants.h:71
CovMatrixFromConfidenceEllipse
std::array< double, 4 > CovMatrixFromConfidenceEllipse(double semi_major, double semi_minor, double major_orientation, const double object_heading)
Convert the confidence ellipse to a covariance matrix.
Definition: cdd_getters_common.h:181
getLongitudinalAcceleration
double getLongitudinalAcceleration(const AccelerationComponent &longitudinal_acceleration)
Get the longitudinal acceleration.
Definition: cdd_v2-1-1_getters.h:45
WGSCovMatrixFromConfidenceEllipse
std::array< double, 4 > WGSCovMatrixFromConfidenceEllipse(double semi_major, double semi_minor, double major_orientation)
Convert the confidence ellipse to a covariance matrix.
Definition: cdd_getters_common.h:210
getWGSPositionConfidenceEllipse
std::array< double, 4 > getWGSPositionConfidenceEllipse(const PositionConfidenceEllipse &position_confidence_ellipse)
Get the covariance matrix of the position confidence ellipse.
Definition: cdd_v2-1-1_getters.h:116
getLateralAccelerationConfidence
double getLateralAccelerationConfidence(const AccelerationComponent &lateral_acceleration)
Get the Lateral Acceleration Confidence.
Definition: cdd_v2-1-1_getters.h:75
getPositionConfidenceEllipse
std::tuple< double, double, double > getPositionConfidenceEllipse(PositionConfidenceEllipse &position_confidence_ellipse)
Extract major axis length, minor axis length and orientation from the given position confidence ellip...
Definition: cdd_v2-1-1_getters.h:87
getLateralAcceleration
double getLateralAcceleration(const AccelerationComponent &lateral_acceleration)
Get the lateral acceleration.
Definition: cdd_v2-1-1_getters.h:65


etsi_its_msgs_utils
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:32:12