etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
cam_getters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#pragma once
10
11namespace etsi_its_cam_msgs::access {
13
20inline double getLongitudinalAcceleration(const LongitudinalAcceleration& longitudinal_acceleration) {
21 return ((double)longitudinal_acceleration.longitudinal_acceleration_value.value) * 1e-1;
22}
23
30inline double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration& longitudinal_acceleration) {
31 return ((double)longitudinal_acceleration.longitudinal_acceleration_confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
33
40inline double getLateralAcceleration(const LateralAcceleration& lateral_acceleration) {
41 return ((double)lateral_acceleration.lateral_acceleration_value.value) * 1e-1;
42}
43
46
48 * @return double standard deviation of the lateral acceleration in m/s^2 as decimal number
49 */
50inline double getLateralAccelerationConfidence(const LateralAcceleration& lateral_acceleration) {
51 return ((double)lateral_acceleration.lateral_acceleration_confidence.value) * 1e-1 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
53
55
62 * @param cam The CAM message to get the reference position from
63 * @return const std::array<double, 4> the covariance matrix, as specified above
64 */
65inline const std::array<double, 4> getRefPosConfidence(const CAM& cam) {
66 double object_heading = getHeading(cam) * M_PI / 180.0;
67 return getPosConfidenceEllipse(cam.cam.cam_parameters.basic_container.reference_position.position_confidence_ellipse, object_heading);
68}
72
72 *
73 * The covariance matrix will have the entries cov_xx, cov_xy, cov_yx, cov_yy
74 * where x is WGS84 North and y is East
75 *
76 * @param cam The CAM message to get the reference position from
77 * @return const std::array<double, 4> the covariance matrix, as specified above
78 */
79inline const std::array<double, 4> getWGSRefPosConfidence(const CAM& cam) {
80 return getWGSPosConfidenceEllipse(cam.cam.cam_parameters.basic_container.reference_position.position_confidence_ellipse);
81}
82
83} // namespace etsi_its_cam_msgs::access
double getLongitudinalAccelerationConfidence(const LongitudinalAcceleration &longitudinal_acceleration)
Get the Longitudinal Acceleration Confidence.
Definition cam_getters.h:30
const std::array< double, 4 > getRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
Definition cam_getters.h:65
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.
Definition cam_getters.h:40
const std::array< double, 4 > getWGSRefPosConfidence(const CAM &cam)
Get the confidence ellipse of the reference position as Covariance matrix.
Definition cam_getters.h:79
double getLateralAccelerationConfidence(const LateralAcceleration &lateral_acceleration)
Get the Lateral Acceleration Confidence.
Definition cam_getters.h:50
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.
Definition cam_getters.h:20
double getHeading(const CAM &cam)
Get the Heading value of CAM.
Definition cam_getters.h:84
Common getter functions for the ETSI ITS CAM (EN and TS).
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.