cam_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 #pragma once
33 
34 namespace etsi_its_cam_msgs::access {
36 
43 inline double getLongitudinalAcceleration(const LongitudinalAcceleration& longitudinal_acceleration) {
44  return ((double)longitudinal_acceleration.longitudinal_acceleration_value.value) * 1e-1;
45 }
46 
53 inline double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration& longitudinal_acceleration) {
54  return ((double)longitudinal_acceleration.longitudinal_acceleration_confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
55 }
56 
63 inline double getLateralAcceleration(const LateralAcceleration& lateral_acceleration) {
64  return ((double)lateral_acceleration.lateral_acceleration_value.value) * 1e-1;
65 }
66 
73 inline double getLateralAccelerationConfidence(const LateralAcceleration& lateral_acceleration) {
74  return ((double)lateral_acceleration.lateral_acceleration_confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
75 }
76 
78 
88 inline const std::array<double, 4> getRefPosConfidence(const CAM& cam) {
89  double object_heading = getHeading(cam) * M_PI / 180.0;
90  return getPosConfidenceEllipse(cam.cam.cam_parameters.basic_container.reference_position.position_confidence_ellipse, object_heading);
91 }
92 
102 inline const std::array<double, 4> getWGSRefPosConfidence(const CAM& cam) {
103  return getWGSPosConfidenceEllipse(cam.cam.cam_parameters.basic_container.reference_position.position_confidence_ellipse);
104 }
105 
106 } // namespace etsi_its_cam_msgs::access
etsi_its_cam_msgs::access::getLateralAccelerationConfidence
double getLateralAccelerationConfidence(const LateralAcceleration &lateral_acceleration)
Get the Lateral Acceleration Confidence.
Definition: cam_getters.h:73
etsi_its_cam_msgs::access::getLongitudinalAccelerationConfidence
double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration &longitudinal_acceleration)
Get the Longitudinal Acceleration Confidence.
Definition: cam_getters.h:53
etsi_its_cam_msgs::access::getRefPosConfidence
const std::array< double, 4 > getRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
Definition: cam_getters.h:88
etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR
constexpr const double ONE_D_GAUSSIAN_FACTOR
Definition: constants.h:71
getWGSPosConfidenceEllipse
std::array< double, 4 > getWGSPosConfidenceEllipse(const PosConfidenceEllipse &position_confidence_ellipse)
Get the covariance matrix of the position confidence ellipse.
Definition: cdd_getters_common.h:236
cam_getters_common.h
Common getter functions for the ETSI ITS CAM (EN and TS)
cdd_v1-3-1_getters.h
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
getHeading
double getHeading(const CAM &cam)
Get the Heading value of CAM.
Definition: cam_getters_common.h:107
getPosConfidenceEllipse
std::tuple< double, double, double > getPosConfidenceEllipse(const PosConfidenceEllipse &position_confidence_ellipse)
Extract major axis length, minor axis length and orientation from the given position confidence ellip...
Definition: cdd_getters_common.h:162
etsi_its_cam_msgs::access::getLongitudinalAcceleration
double getLongitudinalAcceleration(const LongitudinalAcceleration &longitudinal_acceleration)
Get the longitudinal acceleration.
Definition: cam_getters.h:43
etsi_its_cam_msgs::access::getWGSRefPosConfidence
const std::array< double, 4 > getWGSRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
Definition: cam_getters.h:102
etsi_its_cam_msgs::access
Definition: impl/cam/cam_access.h:57
etsi_its_cam_msgs::access::getLateralAcceleration
double getLateralAcceleration(const LateralAcceleration &lateral_acceleration)
Get the lateral acceleration.
Definition: cam_getters.h:63


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