Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
More...
Go to the source code of this file.
|
| void | setItsPduHeader (ItsPduHeader &header, const uint8_t message_id, const uint32_t station_id, const uint8_t protocol_version=0) |
| | Set the Its Pdu Header object.
|
| void | setLongitudinalAccelerationValue (AccelerationValue &accel, const double value) |
| | Set the LongitudinalAccelerationValue object.
|
| void | setLongitudinalAcceleration (AccelerationComponent &accel, const double value, const double confidence) |
| | Set the LongitudinalAcceleration object.
|
| void | setLateralAccelerationValue (AccelerationValue &accel, const double value) |
| | Set the LateralAccelerationValue object.
|
| void | setLateralAcceleration (AccelerationComponent &accel, const double value, const double confidence) |
| | Set the LateralAcceleration object.
|
| template<typename PositionConfidenceEllipse, typename Wgs84AngleValue = decltype(PositionConfidenceEllipse::semi_major_axis_orientation)> |
| void | setPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const double semi_major_axis, const double semi_minor_axis, const double orientation) |
| | Set the Position Confidence Ellipse object.
|
| template<typename PositionConfidenceEllipse> |
| void | setPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix, const double object_heading) |
| | Set the Position Confidence Ellipse object.
|
| template<typename PositionConfidenceEllipse> |
| void | setWGSPositionConfidenceEllipse (PositionConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix) |
| | Set the Position Confidence Ellipse object.
|
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
Definition in file cdd_v2-1-1_setters.h.
◆ setItsPduHeader()
| void setItsPduHeader |
( |
ItsPduHeader & | header, |
|
|
const uint8_t | message_id, |
|
|
const uint32_t | station_id, |
|
|
const uint8_t | protocol_version = 0 ) |
|
inline |
Set the Its Pdu Header object.
- Parameters
-
| header | ItsPduHeader to be set |
| message_id | ID of the message |
| station_id | |
| protocol_version | |
Definition at line 48 of file cdd_v2-1-1_setters.h.
49 {
52 header.message_id.value = message_id;
53 throwIfOutOfRange(protocol_version, OrdinalNumber1B::MIN, OrdinalNumber1B::MAX,
"ProtocolVersion");
54 header.protocol_version.value = protocol_version;
55}
void setStationId(StationId &station_id, const uint32_t id_value)
Set the Station Id object.
void throwIfOutOfRange(const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
Throws an exception if a given value is out of a defined range.
◆ setLateralAcceleration()
| void setLateralAcceleration |
( |
AccelerationComponent & | accel, |
|
|
const double | value, |
|
|
const double | confidence ) |
|
inline |
Set the LateralAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
- Parameters
-
| accel | object to set |
| value | LaterallAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 112 of file cdd_v2-1-1_setters.h.
112 {
115}
void setAccelerationConfidence(AccelerationConfidence &accel_confidence, const double value)
Set the Acceleration Confidence object.
void setLateralAccelerationValue(AccelerationValue &accel, const double value)
Set the LateralAccelerationValue object.
◆ setLateralAccelerationValue()
| void setLateralAccelerationValue |
( |
AccelerationValue & | accel, |
|
|
const double | value ) |
|
inline |
Set the LateralAccelerationValue object.
- Parameters
-
| accel | object to set |
| value | LateralAccelerationValue in m/s^2 as decimal number (left is positive) |
Definition at line 93 of file cdd_v2-1-1_setters.h.
93 {
94 int64_t accel_val = (int64_t)std::round(value * 1e1);
95 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
96 accel.value = accel_val;
97 } else if (accel_val < AccelerationValue::MIN) {
98 accel.value = AccelerationValue::MIN;
99 } else if (accel_val > AccelerationValue::MAX) {
100 accel.value = AccelerationValue::MAX - 1;
101 }
102}
◆ setLongitudinalAcceleration()
| void setLongitudinalAcceleration |
( |
AccelerationComponent & | accel, |
|
|
const double | value, |
|
|
const double | confidence ) |
|
inline |
Set the LongitudinalAcceleration object.
AccelerationConfidence is set to UNAVAILABLE
- Parameters
-
| accel | object to set |
| value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 82 of file cdd_v2-1-1_setters.h.
82 {
85}
void setLongitudinalAccelerationValue(AccelerationValue &accel, const double value)
Set the LongitudinalAccelerationValue object.
◆ setLongitudinalAccelerationValue()
| void setLongitudinalAccelerationValue |
( |
AccelerationValue & | accel, |
|
|
const double | value ) |
|
inline |
Set the LongitudinalAccelerationValue object.
- Parameters
-
| accel | object to set |
| value | LongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative) |
Definition at line 63 of file cdd_v2-1-1_setters.h.
63 {
64 int64_t accel_val = (int64_t)std::round(value * 1e1);
65 if (accel_val >= AccelerationValue::MIN && accel_val <= AccelerationValue::MAX) {
66 accel.value = accel_val;
67 } else if (accel_val < AccelerationValue::MIN) {
68 accel.value = AccelerationValue::MIN;
69 } else if (accel_val > AccelerationValue::MAX) {
70 accel.value = AccelerationValue::MAX - 1;
71 }
72}
◆ setPositionConfidenceEllipse() [1/2]
template<typename PositionConfidenceEllipse, typename Wgs84AngleValue = decltype(PositionConfidenceEllipse::semi_major_axis_orientation)>
| void setPositionConfidenceEllipse |
( |
PositionConfidenceEllipse & | position_confidence_ellipse, |
|
|
const double | semi_major_axis, |
|
|
const double | semi_minor_axis, |
|
|
const double | orientation ) |
|
inline |
Set the Position Confidence Ellipse object.
- Parameters
-
| position_confidence_ellipse | The position confidence ellipse to set |
| semi_major_axis | The length of the semi-major axis in meters |
| semi_minor_axis | The length of the semi-minor axis in meters |
| orientation | The orientation of the semi-major axis in degrees, relative to WGS84 |
Definition at line 126 of file cdd_v2-1-1_setters.h.
127 {
128 setSemiAxis(position_confidence_ellipse.semi_major_axis_length, semi_major_axis);
129 setSemiAxis(position_confidence_ellipse.semi_minor_axis_length, semi_minor_axis);
130 setHeadingValue(position_confidence_ellipse.semi_major_axis_orientation, orientation);
131}
void setSemiAxis(SemiAxisLength &semi_axis_length, const double length)
Set the Semi Axis length.
void setHeadingValue(HeadingValue &heading, const double value)
Set the HeadingValue object.
◆ setPositionConfidenceEllipse() [2/2]
template<typename PositionConfidenceEllipse>
| void setPositionConfidenceEllipse |
( |
PositionConfidenceEllipse & | position_confidence_ellipse, |
|
|
const std::array< double, 4 > & | covariance_matrix, |
|
|
const double | object_heading ) |
|
inline |
Set the Position Confidence Ellipse object.
- Parameters
-
| position_confidence_ellipse | |
| covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the object (x = longitudinal, y = lateral) |
| object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 143 of file cdd_v2-1-1_setters.h.
143 {
146}
std::tuple< double, double, double > confidenceEllipseFromCovMatrix(const std::array< double, 4 > &covariance_matrix, const double object_heading)
Gets the values needed to set a confidence ellipse from a covariance matrix.
void setPositionConfidenceEllipse(PositionConfidenceEllipse &position_confidence_ellipse, const double semi_major_axis, const double semi_minor_axis, const double orientation)
Set the Position Confidence Ellipse object.
◆ setWGSPositionConfidenceEllipse()
template<typename PositionConfidenceEllipse>
| void setWGSPositionConfidenceEllipse |
( |
PositionConfidenceEllipse & | position_confidence_ellipse, |
|
|
const std::array< double, 4 > & | covariance_matrix ) |
|
inline |
Set the Position Confidence Ellipse object.
- Parameters
-
| position_confidence_ellipse | |
| covariance_matrix | The four values of the covariance matrix in the order: cov_xx, cov_xy, cov_yx, cov_yy The matrix has to be SPD, otherwise a std::invalid_argument exception is thrown. Its coordinate system is aligned with the WGS axes (x = North, y = East) |
| object_heading | The heading of the object in rad, with respect to WGS84 |
Definition at line 158 of file cdd_v2-1-1_setters.h.
158 {
161}
std::tuple< double, double, double > confidenceEllipseFromWGSCovMatrix(const std::array< double, 4 > &covariance_matrix)
Gets the values needed to set a confidence ellipse from a covariance matrix.