etsi_its_messages v3.1.0
 
Loading...
Searching...
No Matches
cam_getters.h
Go to the documentation of this file.
1/*
2=============================================================================
3MIT License
4
5Copyright (c) 2023-2025 Institute for Automotive Engineering (ika), RWTH Aachen University
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24=============================================================================
25*/
26
31
32#pragma once
33
34namespace etsi_its_cam_msgs::access {
36
43inline double getLongitudinalAcceleration(const LongitudinalAcceleration& longitudinal_acceleration) {
44 return ((double)longitudinal_acceleration.longitudinal_acceleration_value.value) * 1e-1;
45}
46
53inline double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration& longitudinal_acceleration) {
54 return ((double)longitudinal_acceleration.longitudinal_acceleration_confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
56
63inline double getLateralAcceleration(const LateralAcceleration& lateral_acceleration) {
64 return ((double)lateral_acceleration.lateral_acceleration_value.value) * 1e-1;
65}
66
67
73inline 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}
78
87 */
88inline 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}
102inline 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
double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration &longitudinal_acceleration)
Get the Longitudinal Acceleration Confidence.
const std::array< double, 4 > getRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
std::array< double, 4 > getWGSPosConfidenceEllipse(const PosConfidenceEllipse &position_confidence_ellipse)
Get the covariance matrix of the position confidence ellipse.
double getLateralAcceleration(const LateralAcceleration &lateral_acceleration)
Get the lateral acceleration.
const std::array< double, 4 > getWGSRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
double getLateralAccelerationConfidence(const LateralAcceleration &lateral_acceleration)
Get the Lateral Acceleration Confidence.
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...
double getLongitudinalAcceleration(const LongitudinalAcceleration &longitudinal_acceleration)
Get the longitudinal acceleration.
double getHeading(const CAM &cam)
Get the Heading value of CAM.
Common getter functions for the ETSI ITS CAM (EN and TS)
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.