etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_ts_setters.h File Reference

Setter functions for the ETSI ITS DENM (TS). More...

Go to the source code of this file.

Classes

struct  etsi_its_denm_ts_msgs::access::etsi_its_msgs::OneCentimeterHelper< SemiAxisLength, typename >
struct  etsi_its_denm_ts_msgs::access::etsi_its_msgs::OneCentimeterHelper< SemiAxisLength, std::void_t< decltype(SemiAxisLength::ONE_CENTIMETER)> >

Functions

template<typename T1, typename T2>
void etsi_its_denm_ts_msgs::access::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.
void etsi_its_denm_ts_msgs::access::throwIfNotPresent (const bool is_present, const std::string val_desc)
 Throws an exception if the given value is not present.
uint16_t etsi_its_denm_ts_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 (const uint64_t unix_seconds)
 Get the leap second insertions since 2004 for given unix seconds.
template<typename StationId>
void etsi_its_denm_ts_msgs::access::setStationId (StationId &station_id, const uint32_t id_value)
 Set the Station Id object.
template<typename StationType>
void etsi_its_denm_ts_msgs::access::setStationType (StationType &station_type, const uint8_t value)
 Set the Station Type.
void etsi_its_denm_ts_msgs::access::setTimestampITS (TimestampIts &timestamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
 Set the TimestampITS object.
void etsi_its_denm_ts_msgs::access::setLatitude (Latitude &latitude, const double deg)
 Set the Latitude object.
void etsi_its_denm_ts_msgs::access::setLongitude (Longitude &longitude, const double deg)
 Set the Longitude object.
void etsi_its_denm_ts_msgs::access::setAltitudeValue (AltitudeValue &altitude, const double value)
 Set the AltitudeValue object.
void etsi_its_denm_ts_msgs::access::setAltitude (Altitude &altitude, const double value)
 Set the Altitude object.
void etsi_its_denm_ts_msgs::access::setSpeedValue (SpeedValue &speed, const double value)
 Set the SpeedValue object.
void etsi_its_denm_ts_msgs::access::setSpeedConfidence (SpeedConfidence &speed_confidence, const double value)
 Set the Speed Confidence object.
void etsi_its_denm_ts_msgs::access::setSpeed (Speed &speed, const double value, const double confidence=std::numeric_limits< double >::infinity())
 Set the Speed object.
template<typename AccelerationMagnitudeValue>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitudeValue (AccelerationMagnitudeValue &accel_mag_value, const double value)
 Set the Acceleration Magnitude Value object.
template<typename AccelerationConfidence>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitudeConfidence (AccelerationConfidence &accel_mag_confidence, const double value)
 Set the AccelerationMagnitude Confidence object.
template<typename AccelerationMagnitude>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitude (AccelerationMagnitude &accel_mag, const double value, const double confidence=std::numeric_limits< double >::infinity())
 Set the AccelerationMagnitude object.
template<typename AccelerationConfidence>
void etsi_its_denm_ts_msgs::access::setAccelerationConfidence (AccelerationConfidence &accel_confidence, const double value)
 Set the Acceleration Confidence object.
template<typename T>
void etsi_its_denm_ts_msgs::access::setReferencePosition (T &ref_position, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
 Sets the reference position in the given ReferencePostion object.
template<typename T>
void etsi_its_denm_ts_msgs::access::setFromUTMPosition (T &reference_position, const gm::PointStamped &utm_position, const int zone, const bool northp)
 Set the ReferencePosition from a given UTM-Position.
template<typename HeadingValue>
void etsi_its_denm_ts_msgs::access::setHeadingValue (HeadingValue &heading, const double value)
 Set the HeadingValue object.
template<typename HeadingConfidence>
void etsi_its_denm_ts_msgs::access::setHeadingConfidence (HeadingConfidence &heading_confidence, const double value)
 Set the Heading Confidence object.
template<typename Heading, typename HeadingConfidence = decltype(Heading::heading_confidence)>
void etsi_its_denm_ts_msgs::access::setHeadingCDD (Heading &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
 Set the Heading object.
template<typename YawRate, typename YawRateValue = decltype(YawRate::yaw_rate_value), typename YawRateConfidence = decltype(YawRate::yaw_rate_confidence)>
void etsi_its_denm_ts_msgs::access::setYawRateCDD (YawRate &yaw_rate, const double value, double confidence=std::numeric_limits< double >::infinity())
 Set the Yaw Rate object.
template<typename SemiAxisLength>
void etsi_its_denm_ts_msgs::access::setSemiAxis (SemiAxisLength &semi_axis_length, const double length)
 Set the Semi Axis length.
template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const double semi_major_axis, const double semi_minor_axis, const double orientation)
 Set the Pos Confidence Ellipse object.
std::tuple< double, double, double > etsi_its_denm_ts_msgs::access::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.
std::tuple< double, double, double > etsi_its_denm_ts_msgs::access::confidenceEllipseFromWGSCovMatrix (const std::array< double, 4 > &covariance_matrix)
 Gets the values needed to set a confidence ellipse from a covariance matrix.
template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix, const double object_heading)
 Set the Pos Confidence Ellipse object.
template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setWGSPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix)
 Set the Pos Confidence Ellipse object.
void etsi_its_denm_ts_msgs::access::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.
template<typename Wgs84AngleValue>
void etsi_its_denm_ts_msgs::access::setWGSHeadingValue (Wgs84AngleValue &heading, const double value)
 Set the Wgs84AngleValue object.
template<typename Wgs84AngleConfidence>
void etsi_its_denm_ts_msgs::access::setWGSHeadingConfidence (Wgs84AngleConfidence &confidence, const double value)
 Set the Wgs84AngleConfidence object.
template<typename Wgs84Angle, typename Wgs84AngleConfidence = decltype(Wgs84Angle::confidence)>
void etsi_its_denm_ts_msgs::access::setWGSHeadingCDD (Wgs84Angle &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
 Set the Wgs84Angle object.
template<typename T>
void etsi_its_denm_ts_msgs::access::setBitString (T &bitstring, const std::vector< bool > &bits)
 Set a Bit String by a vector of bools.
void etsi_its_denm_ts_msgs::access::setReferenceTime (DENM &denm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
 Set the ReferenceTime-value.
void etsi_its_denm_ts_msgs::access::setStationType (DENM &denm, const int value)
 Set the StationType for a DENM.
void etsi_its_denm_ts_msgs::access::setReferencePosition (DENM &denm, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
 Set the ReferencePositionWithConfidence for a DENM.
void etsi_its_denm_ts_msgs::access::setIsSpeedPresent (DENM &denm, bool presence_of_speed)
 Set the IsSpeedPresent object for DENM.
void etsi_its_denm_ts_msgs::access::setSpeed (DENM &denm, const double speed_val, const double confidence=std::numeric_limits< double >::infinity())
 Set the vehicle speed.
void etsi_its_denm_ts_msgs::access::setFromUTMPosition (DENM &denm, const gm::PointStamped &utm_position, const int &zone, const bool &northp)
 Set the ReferencePosition of a DENM from a given UTM-Position.
void etsi_its_denm_ts_msgs::access::setDrivingLaneStatus (DrivingLaneStatus &driving_lane_status, const std::vector< bool > &bits)
 Set the Driving Lane Status by a vector of bools.
void etsi_its_denm_ts_msgs::access::setLightBarSirenInUse (LightBarSirenInUse &light_bar_siren_in_use, const std::vector< bool > &bits)
 Set the Lightbar Siren In Use by a vector of bools.
void etsi_its_denm_ts_msgs::access::setItsPduHeader (DENM &denm, const uint32_t station_id, const uint8_t protocol_version=0)
 Set the ItsPduHeader-object for a DENM.
void etsi_its_denm_ts_msgs::access::setIsWGSHeadingPresent (DENM &denm, bool presence_of_heading)
 Set the IsWGSHeadingPresent object for DENM.
void etsi_its_denm_ts_msgs::access::setWGSHeading (DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
 Set the WGS Heading for a DENM.

Detailed Description

Setter functions for the ETSI ITS DENM (TS).

Definition in file denm_ts_setters.h.

Macro Definition Documentation

◆ ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_2_1_SETTERS_H

#define ETSI_ITS_MSGS_UTILS_IMPL_CDD_CDD_V2_2_1_SETTERS_H

Definition at line 11 of file denm_ts_setters.h.

Function Documentation

◆ confidenceEllipseFromCovMatrix()

std::tuple< double, double, double > etsi_its_denm_ts_msgs::access::confidenceEllipseFromCovMatrix ( const std::array< double, 4 > & covariance_matrix,
const double object_heading )
inline

Gets the values needed to set a confidence ellipse from a covariance matrix.

Parameters
covariance_matrixThe 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_headingThe heading of the object in rad, with respect to WGS84
Returns
std::tuple<double, double, double> semi_major_axis [m], semi_minor_axis [m], orientation [deg], with respect to WGS84

Definition at line 411 of file denm_ts_setters.h.

◆ confidenceEllipseFromWGSCovMatrix()

std::tuple< double, double, double > etsi_its_denm_ts_msgs::access::confidenceEllipseFromWGSCovMatrix ( const std::array< double, 4 > & covariance_matrix)
inline

Gets the values needed to set a confidence ellipse from a covariance matrix.

Parameters
covariance_matrixThe 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_headingThe heading of the object in rad, with respect to WGS84
Returns
std::tuple<double, double, double> semi_major_axis [m], semi_minor_axis [m], orientation [deg], with respect to WGS84

Definition at line 452 of file denm_ts_setters.h.

475inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
476 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
477}
478
485inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
486 if (denm.denm.location_is_present) {
487 denm.denm.location.event_position_heading_is_present = presence_of_heading;
488 } else {
489 throw std::invalid_argument("LocationContainer is not present!");
490 }
491}
492
503inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
504 if (denm.denm.location_is_present) {
505 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
506 setIsWGSHeadingPresent(denm, true);
507 } else {
508 throw std::invalid_argument("LocationContainer is not present!");
509 }
510}
511
512} // namespace etsi_its_denm_ts_msgs::access
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.2.1.
Common setter functions for the ETSI ITS DENM (EN and TS).
void setWGSHeadingCDD(Wgs84Angle &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
Set the Wgs84Angle object.
void setWGSHeading(DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
Set the WGS Heading for a DENM.
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 setIsWGSHeadingPresent(DENM &denm, bool presence_of_heading)
Set the IsWGSHeadingPresent object for DENM.

◆ getLeapSecondInsertionsSince2004()

uint16_t etsi_its_denm_ts_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 ( const uint64_t unix_seconds)
inline

Get the leap second insertions since 2004 for given unix seconds.

Parameters
unix_secondsthe current unix seconds for that the leap second insertions since 2004 shall be provided
Returns
uint16_t the number of leap second insertions since 2004 for unix_seconds

Definition at line 38 of file denm_ts_access.h.

71 {
73}
Utility functions for the ETSI ITS DENM (EN and TS).

◆ setAccelerationConfidence()

template<typename AccelerationConfidence>
void etsi_its_denm_ts_msgs::access::setAccelerationConfidence ( AccelerationConfidence & accel_confidence,
const double value )
inline

Set the Acceleration Confidence object.

Parameters
accel_confidenceobject to set
valuestandard deviation in m/s^2 as decimal number

Definition at line 210 of file denm_ts_setters.h.

220 {
221
223
225
233inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
234 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
235}
236
243inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
244 if (denm.denm.location_is_present) {
245 denm.denm.location.event_position_heading_is_present = presence_of_heading;
246 } else {
247 throw std::invalid_argument("LocationContainer is not present!");
248 }
249}
250
261inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
262 if (denm.denm.location_is_present) {
263 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
264 setIsWGSHeadingPresent(denm, true);
265 } else {
266 throw std::invalid_argument("LocationContainer is not present!");
267 }
268}
269
270} // namespace etsi_its_denm_ts_msgs::access

◆ setAccelerationMagnitude()

template<typename AccelerationMagnitude>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitude ( AccelerationMagnitude & accel_mag,
const double value,
const double confidence = std::numeric_limits<double>::infinity() )
inline

Set the AccelerationMagnitude object.

AccelerationConfidence is set to UNAVAILABLE

Parameters
accel_magobject to set
valueAccelerationMagnitudeValue in m/s^2 as decimal number
confidencestandard deviation in m/s^2 as decimal number (default: infinity, mapping to AccelerationConfidence::UNAVAILABLE)

Definition at line 197 of file denm_ts_setters.h.

207 {
208
210
212
220inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
221 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
222}
223
230inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
231 if (denm.denm.location_is_present) {
232 denm.denm.location.event_position_heading_is_present = presence_of_heading;
233 } else {
234 throw std::invalid_argument("LocationContainer is not present!");
235 }
236}
237
248inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
249 if (denm.denm.location_is_present) {
250 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
251 setIsWGSHeadingPresent(denm, true);
252 } else {
253 throw std::invalid_argument("LocationContainer is not present!");
254 }
255}
256
257} // namespace etsi_its_denm_ts_msgs::access

◆ setAccelerationMagnitudeConfidence()

template<typename AccelerationConfidence>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitudeConfidence ( AccelerationConfidence & accel_mag_confidence,
const double value )
inline

Set the AccelerationMagnitude Confidence object.

Parameters
accel_mag_confidenceobject to set
valuestandard deviation in m/s^2 as decimal number

Definition at line 177 of file denm_ts_setters.h.

187 {
188
190
192
200inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
201 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
202}
203
210inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
211 if (denm.denm.location_is_present) {
212 denm.denm.location.event_position_heading_is_present = presence_of_heading;
213 } else {
214 throw std::invalid_argument("LocationContainer is not present!");
215 }
216}
217
228inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
229 if (denm.denm.location_is_present) {
230 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
231 setIsWGSHeadingPresent(denm, true);
232 } else {
233 throw std::invalid_argument("LocationContainer is not present!");
234 }
235}
236
237} // namespace etsi_its_denm_ts_msgs::access

◆ setAccelerationMagnitudeValue()

template<typename AccelerationMagnitudeValue>
void etsi_its_denm_ts_msgs::access::setAccelerationMagnitudeValue ( AccelerationMagnitudeValue & accel_mag_value,
const double value )
inline

Set the Acceleration Magnitude Value object.

Parameters
accel_mag_valueobject to set
valueAccelerationMagnitudeValue in m/s^2 as decimal number

Definition at line 164 of file denm_ts_setters.h.

174 {
175
177
179
187inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
188 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
189}
190
197inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
198 if (denm.denm.location_is_present) {
199 denm.denm.location.event_position_heading_is_present = presence_of_heading;
200 } else {
201 throw std::invalid_argument("LocationContainer is not present!");
202 }
203}
204
215inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
216 if (denm.denm.location_is_present) {
217 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
218 setIsWGSHeadingPresent(denm, true);
219 } else {
220 throw std::invalid_argument("LocationContainer is not present!");
221 }
222}
223
224} // namespace etsi_its_denm_ts_msgs::access

◆ setAltitude()

void etsi_its_denm_ts_msgs::access::setAltitude ( Altitude & altitude,
const double value )
inline

Set the Altitude object.

AltitudeConfidence is set to UNAVAILABLE

Parameters
altitudeobject to set
valueAltitude value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 110 of file denm_ts_setters.h.

120 {
121
123
125
133inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
134 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
135}
136
143inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
144 if (denm.denm.location_is_present) {
145 denm.denm.location.event_position_heading_is_present = presence_of_heading;
146 } else {
147 throw std::invalid_argument("LocationContainer is not present!");
148 }
149}
150
161inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
162 if (denm.denm.location_is_present) {
163 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
164 setIsWGSHeadingPresent(denm, true);
165 } else {
166 throw std::invalid_argument("LocationContainer is not present!");
167 }
168}
169
170} // namespace etsi_its_denm_ts_msgs::access

◆ setAltitudeValue()

void etsi_its_denm_ts_msgs::access::setAltitudeValue ( AltitudeValue & altitude,
const double value )
inline

Set the AltitudeValue object.

Parameters
altitudeobject to set
valueAltitudeValue value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 91 of file denm_ts_setters.h.

101 {
102
104
106
114inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
115 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
116}
117
124inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
125 if (denm.denm.location_is_present) {
126 denm.denm.location.event_position_heading_is_present = presence_of_heading;
127 } else {
128 throw std::invalid_argument("LocationContainer is not present!");
129 }
130}
131
142inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
143 if (denm.denm.location_is_present) {
144 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
145 setIsWGSHeadingPresent(denm, true);
146 } else {
147 throw std::invalid_argument("LocationContainer is not present!");
148 }
149}
150
151} // namespace etsi_its_denm_ts_msgs::access

◆ setBitString()

template<typename T>
void etsi_its_denm_ts_msgs::access::setBitString ( T & bitstring,
const std::vector< bool > & bits )
inline

Set a Bit String by a vector of bools.

Template Parameters
T
Parameters
bitstringBitString to set
bitsvector of bools

Definition at line 21 of file denm_ts_setters.h.

24 {
25 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
26}
27
34inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
35 if (denm.denm.location_is_present) {
36 denm.denm.location.event_position_heading_is_present = presence_of_heading;
37 } else {
38 throw std::invalid_argument("LocationContainer is not present!");
39 }
40}
41

◆ setDrivingLaneStatus()

void etsi_its_denm_ts_msgs::access::setDrivingLaneStatus ( DrivingLaneStatus & driving_lane_status,
const std::vector< bool > & bits )
inline

Set the Driving Lane Status by a vector of bools.

Parameters
driving_lane_status
bits

Definition at line 108 of file denm_ts_setters.h.

131inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
132 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
133}
134
141inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
142 if (denm.denm.location_is_present) {
143 denm.denm.location.event_position_heading_is_present = presence_of_heading;
144 } else {
145 throw std::invalid_argument("LocationContainer is not present!");
146 }
147}
148
159inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
160 if (denm.denm.location_is_present) {
161 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
162 setIsWGSHeadingPresent(denm, true);
163 } else {
164 throw std::invalid_argument("LocationContainer is not present!");
165 }
166}
167
168} // namespace etsi_its_denm_ts_msgs::access

◆ setFromUTMPosition() [1/2]

void etsi_its_denm_ts_msgs::access::setFromUTMPosition ( DENM & denm,
const gm::PointStamped & utm_position,
const int & zone,
const bool & northp )
inline

Set the ReferencePosition of a DENM from a given UTM-Position.

The position is transformed to latitude and longitude by using GeographicLib::UTMUPS The z-Coordinate is directly used as altitude value The frame_id of the given utm_position must be set to 'utm_<zone><N/S>'

Parameters
[out]denmDENM for which to set the ReferencePosition
[in]utm_positiongeometry_msgs::PointStamped describing the given utm position
[in]zonethe UTM zone (zero means UPS) of the given position
[in]northphemisphere (true means north, false means south)

Definition at line 98 of file denm_ts_setters.h.

108 {
109
111
113
121inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
122 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
123}
124
131inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
132 if (denm.denm.location_is_present) {
133 denm.denm.location.event_position_heading_is_present = presence_of_heading;
134 } else {
135 throw std::invalid_argument("LocationContainer is not present!");
136 }
137}
138
149inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
150 if (denm.denm.location_is_present) {
151 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
152 setIsWGSHeadingPresent(denm, true);
153 } else {
154 throw std::invalid_argument("LocationContainer is not present!");
155 }
156}
157
158} // namespace etsi_its_denm_ts_msgs::access

◆ setFromUTMPosition() [2/2]

template<typename T>
void etsi_its_denm_ts_msgs::access::setFromUTMPosition ( T & reference_position,
const gm::PointStamped & utm_position,
const int zone,
const bool northp )
inline

Set the ReferencePosition from a given UTM-Position.

The position is transformed to latitude and longitude by using GeographicLib::UTMUPS The z-Coordinate is directly used as altitude value The frame_id of the given utm_position must be set to 'utm_<zone><N/S>'

Parameters
[out]reference_positionReferencePostion or ReferencePositionWithConfidence to set
[in]utm_positiongeometry_msgs::PointStamped describing the given utm position
[in]zonethe UTM zone (zero means UPS) of the given position
[in]northphemisphere (true means north, false means south)

Definition at line 258 of file denm_ts_setters.h.

268 {
269
271
273
281inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
282 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
283}
284
291inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
292 if (denm.denm.location_is_present) {
293 denm.denm.location.event_position_heading_is_present = presence_of_heading;
294 } else {
295 throw std::invalid_argument("LocationContainer is not present!");
296 }
297}
298
309inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
310 if (denm.denm.location_is_present) {
311 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
312 setIsWGSHeadingPresent(denm, true);
313 } else {
314 throw std::invalid_argument("LocationContainer is not present!");
315 }
316}
317
318} // namespace etsi_its_denm_ts_msgs::access

◆ setHeadingCDD()

template<typename Heading, typename HeadingConfidence = decltype(Heading::heading_confidence)>
void etsi_its_denm_ts_msgs::access::setHeadingCDD ( Heading & heading,
const double value,
double confidence = std::numeric_limits<double>::infinity() )

Set the Heading object.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West HeadingConfidence is set to UNAVAILABLE

Parameters
headingobject to set
valueHeading value in degree as decimal number
confidencestandard deviation of heading in degree as decimal number (default: infinity, mapping to HeadingConfidence::UNAVAILABLE)

Definition at line 317 of file denm_ts_setters.h.

327 {
328
330
332
340inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
341 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
342}
343
350inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
351 if (denm.denm.location_is_present) {
352 denm.denm.location.event_position_heading_is_present = presence_of_heading;
353 } else {
354 throw std::invalid_argument("LocationContainer is not present!");
355 }
356}
357
368inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
369 if (denm.denm.location_is_present) {
370 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
371 setIsWGSHeadingPresent(denm, true);
372 } else {
373 throw std::invalid_argument("LocationContainer is not present!");
374 }
375}
376
377} // namespace etsi_its_denm_ts_msgs::access

◆ setHeadingConfidence()

template<typename HeadingConfidence>
void etsi_its_denm_ts_msgs::access::setHeadingConfidence ( HeadingConfidence & heading_confidence,
const double value )
inline

Set the Heading Confidence object.

Parameters
heading_confidenceobject to set
valuestandard deviation of heading in degree as decimal number

Definition at line 296 of file denm_ts_setters.h.

306 {
307
309
311
319inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
320 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
321}
322
329inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
330 if (denm.denm.location_is_present) {
331 denm.denm.location.event_position_heading_is_present = presence_of_heading;
332 } else {
333 throw std::invalid_argument("LocationContainer is not present!");
334 }
335}
336
347inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
348 if (denm.denm.location_is_present) {
349 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
350 setIsWGSHeadingPresent(denm, true);
351 } else {
352 throw std::invalid_argument("LocationContainer is not present!");
353 }
354}
355
356} // namespace etsi_its_denm_ts_msgs::access

◆ setHeadingValue()

template<typename HeadingValue>
void etsi_its_denm_ts_msgs::access::setHeadingValue ( HeadingValue & heading,
const double value )
inline

Set the HeadingValue object.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West

Parameters
headingobject to set
valueHeading value in degree as decimal number

Definition at line 283 of file denm_ts_setters.h.

293 {
294
296
298
306inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
307 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
308}
309
316inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
317 if (denm.denm.location_is_present) {
318 denm.denm.location.event_position_heading_is_present = presence_of_heading;
319 } else {
320 throw std::invalid_argument("LocationContainer is not present!");
321 }
322}
323
334inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
335 if (denm.denm.location_is_present) {
336 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
337 setIsWGSHeadingPresent(denm, true);
338 } else {
339 throw std::invalid_argument("LocationContainer is not present!");
340 }
341}
342
343} // namespace etsi_its_denm_ts_msgs::access

◆ setIsSpeedPresent()

void etsi_its_denm_ts_msgs::access::setIsSpeedPresent ( DENM & denm,
bool presence_of_speed )
inline

Set the IsSpeedPresent object for DENM.

Parameters
denmDENM to set IsSpeedPresent
presence_of_speedIsSpeedPresent-Value (true or false)

Definition at line 62 of file denm_ts_setters.h.

72 {
73
75
77
85inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
86 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
87}
88
95inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
96 if (denm.denm.location_is_present) {
97 denm.denm.location.event_position_heading_is_present = presence_of_heading;
98 } else {
99 throw std::invalid_argument("LocationContainer is not present!");
100 }
101}
102
113inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
114 if (denm.denm.location_is_present) {
115 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
116 setIsWGSHeadingPresent(denm, true);
117 } else {
118 throw std::invalid_argument("LocationContainer is not present!");
119 }
120}
121
122} // namespace etsi_its_denm_ts_msgs::access

◆ setIsWGSHeadingPresent()

void etsi_its_denm_ts_msgs::access::setIsWGSHeadingPresent ( DENM & denm,
bool presence_of_heading )
inline

Set the IsWGSHeadingPresent object for DENM.

Parameters
denmDENM to set IsWGSHeadingPresent
presence_of_headingIsWGSHeadingPresent-Value (true or false)

Definition at line 34 of file denm_ts_setters.h.

34 {
35 if (denm.denm.location_is_present) {
36 denm.denm.location.event_position_heading_is_present = presence_of_heading;
37 } else {
38 throw std::invalid_argument("LocationContainer is not present!");
39 }
40}

◆ setItsPduHeader() [1/2]

void etsi_its_denm_ts_msgs::access::setItsPduHeader ( DENM & denm,
const uint32_t station_id,
const uint8_t protocol_version = 0 )
inline

Set the ItsPduHeader-object for a DENM.

Parameters
denmDENM-Message to set the ItsPduHeader
station_id
protocol_version

Definition at line 24 of file denm_ts_setters.h.

24 {
25 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
26}

◆ setItsPduHeader() [2/2]

void etsi_its_denm_ts_msgs::access::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
headerItsPduHeader to be set
message_idID of the message
station_id
protocol_version

Definition at line 25 of file denm_ts_setters.h.

◆ setLatitude()

void etsi_its_denm_ts_msgs::access::setLatitude ( Latitude & latitude,
const double deg )
inline

Set the Latitude object.

Parameters
latitudeobject to set
degLatitude value in degree as decimal number

Definition at line 67 of file denm_ts_setters.h.

77 {
78
80
82
90inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
91 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
92}
93
100inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
101 if (denm.denm.location_is_present) {
102 denm.denm.location.event_position_heading_is_present = presence_of_heading;
103 } else {
104 throw std::invalid_argument("LocationContainer is not present!");
105 }
106}
107
118inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
119 if (denm.denm.location_is_present) {
120 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
121 setIsWGSHeadingPresent(denm, true);
122 } else {
123 throw std::invalid_argument("LocationContainer is not present!");
124 }
125}
126
127} // namespace etsi_its_denm_ts_msgs::access

◆ setLightBarSirenInUse()

void etsi_its_denm_ts_msgs::access::setLightBarSirenInUse ( LightBarSirenInUse & light_bar_siren_in_use,
const std::vector< bool > & bits )
inline

Set the Lightbar Siren In Use by a vector of bools.

Parameters
light_bar_siren_in_use
bits

Definition at line 118 of file denm_ts_setters.h.

128 {
129
131
133
141inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
142 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
143}
144
151inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
152 if (denm.denm.location_is_present) {
153 denm.denm.location.event_position_heading_is_present = presence_of_heading;
154 } else {
155 throw std::invalid_argument("LocationContainer is not present!");
156 }
157}
158
169inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
170 if (denm.denm.location_is_present) {
171 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
172 setIsWGSHeadingPresent(denm, true);
173 } else {
174 throw std::invalid_argument("LocationContainer is not present!");
175 }
176}
177
178} // namespace etsi_its_denm_ts_msgs::access

◆ setLongitude()

void etsi_its_denm_ts_msgs::access::setLongitude ( Longitude & longitude,
const double deg )
inline

Set the Longitude object.

Parameters
longitudeobject to set
degLongitude value in degree as decimal number

Definition at line 79 of file denm_ts_setters.h.

89 {
90
92
94
102inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
103 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
104}
105
112inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
113 if (denm.denm.location_is_present) {
114 denm.denm.location.event_position_heading_is_present = presence_of_heading;
115 } else {
116 throw std::invalid_argument("LocationContainer is not present!");
117 }
118}
119
130inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
131 if (denm.denm.location_is_present) {
132 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
133 setIsWGSHeadingPresent(denm, true);
134 } else {
135 throw std::invalid_argument("LocationContainer is not present!");
136 }
137}
138
139} // namespace etsi_its_denm_ts_msgs::access

◆ setPosConfidenceEllipse() [1/2]

template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setPosConfidenceEllipse ( PosConfidenceEllipse & position_confidence_ellipse,
const double semi_major_axis,
const double semi_minor_axis,
const double orientation )
inline

Set the Pos Confidence Ellipse object.

Parameters
[out]position_confidence_ellipseThe PosConfidenceEllipse to set
[in]semi_major_axislength of the semi-major axis in meters
[in]semi_minor_axislength of the semi-minor axis in meters
[in]orientationof the semi-major axis in degrees, with respect to WGS84

Definition at line 395 of file denm_ts_setters.h.

405 {
406
408
410
418inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
419 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
420}
421
428inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
429 if (denm.denm.location_is_present) {
430 denm.denm.location.event_position_heading_is_present = presence_of_heading;
431 } else {
432 throw std::invalid_argument("LocationContainer is not present!");
433 }
434}
435
446inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
447 if (denm.denm.location_is_present) {
448 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
449 setIsWGSHeadingPresent(denm, true);
450 } else {
451 throw std::invalid_argument("LocationContainer is not present!");
452 }
453}
454
455} // namespace etsi_its_denm_ts_msgs::access

◆ setPosConfidenceEllipse() [2/2]

template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setPosConfidenceEllipse ( PosConfidenceEllipse & position_confidence_ellipse,
const std::array< double, 4 > & covariance_matrix,
const double object_heading )
inline

Set the Pos Confidence Ellipse object.

Parameters
position_confidence_ellipse
covariance_matrixThe 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_headingThe heading of the object in rad, with respect to WGS84

Definition at line 468 of file denm_ts_setters.h.

478 {
479
481
483
491inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
492 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
493}
494
501inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
502 if (denm.denm.location_is_present) {
503 denm.denm.location.event_position_heading_is_present = presence_of_heading;
504 } else {
505 throw std::invalid_argument("LocationContainer is not present!");
506 }
507}
508
519inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
520 if (denm.denm.location_is_present) {
521 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
522 setIsWGSHeadingPresent(denm, true);
523 } else {
524 throw std::invalid_argument("LocationContainer is not present!");
525 }
526}
527
528} // namespace etsi_its_denm_ts_msgs::access

◆ setReferencePosition() [1/2]

void etsi_its_denm_ts_msgs::access::setReferencePosition ( DENM & denm,
const double latitude,
const double longitude,
const double altitude = AltitudeValue::UNAVAILABLE )
inline

Set the ReferencePositionWithConfidence for a DENM.

This function sets the latitude, longitude, and altitude of the DENMs reference position. If the altitude is not provided, it is set to AltitudeValue::UNAVAILABLE.

Parameters
denmDENM to set the ReferencePosition
latitudeThe latitude value position in degree as decimal number.
longitudeThe longitude value in degree as decimal number.
altitudeThe altitude value (above the reference ellipsoid surface) in meter as decimal number (optional).

Definition at line 51 of file denm_ts_setters.h.

52 {
53 if (denm.denm.location_is_present) {
54 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);

◆ setReferencePosition() [2/2]

template<typename T>
void etsi_its_denm_ts_msgs::access::setReferencePosition ( T & ref_position,
const double latitude,
const double longitude,
const double altitude = AltitudeValue::UNAVAILABLE )
inline

Sets the reference position in the given ReferencePostion object.

This function sets the latitude, longitude, and altitude of the reference position. If the altitude is not provided, it is set to AltitudeValue::UNAVAILABLE.

Parameters
ref_positionReferencePostion or ReferencePositionWithConfidence object to set the reference position in.
latitudeThe latitude value position in degree as decimal number.
longitudeThe longitude value in degree as decimal number.
altitudeThe altitude value (above the reference ellipsoid surface) in meter as decimal number (optional).

Definition at line 232 of file denm_ts_setters.h.

242 {
243
245
247
255inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
256 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
257}
258
265inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
266 if (denm.denm.location_is_present) {
267 denm.denm.location.event_position_heading_is_present = presence_of_heading;
268 } else {
269 throw std::invalid_argument("LocationContainer is not present!");
270 }
271}
272
283inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
284 if (denm.denm.location_is_present) {
285 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
286 setIsWGSHeadingPresent(denm, true);
287 } else {
288 throw std::invalid_argument("LocationContainer is not present!");
289 }
290}
291
292} // namespace etsi_its_denm_ts_msgs::access

◆ setReferenceTime()

void etsi_its_denm_ts_msgs::access::setReferenceTime ( DENM & denm,
const uint64_t unix_nanosecs,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin()->second )
inline

Set the ReferenceTime-value.

Parameters
denmDENM to set the ReferenceTime-Value for
unix_nanosecsTimestamp in unix-nanoseconds to set the ReferenceTime-Value from
n_leap_secondsNumber of leap seconds since 2004 for the given timestamp (Defaults to the todays number of leap seconds since 2004.)

Definition at line 23 of file denm_ts_setters.h.

24 {
25 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
26}
27

◆ setSemiAxis()

template<typename SemiAxisLength>
void etsi_its_denm_ts_msgs::access::setSemiAxis ( SemiAxisLength & semi_axis_length,
const double length )
inline

Set the Semi Axis length.

// See https://godbolt.org/z/Eceavfo99 on how the OneCentimeterHelper works with this template

Parameters
semi_axis_lengthThe SemiAxisLength to set
lengththe desired length in meters

Definition at line 376 of file denm_ts_setters.h.

399inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
400 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
401}
402
409inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
410 if (denm.denm.location_is_present) {
411 denm.denm.location.event_position_heading_is_present = presence_of_heading;
412 } else {
413 throw std::invalid_argument("LocationContainer is not present!");
414 }
415}
416
427inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
428 if (denm.denm.location_is_present) {
429 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
430 setIsWGSHeadingPresent(denm, true);
431 } else {
432 throw std::invalid_argument("LocationContainer is not present!");
433 }
434}
435
436} // namespace etsi_its_denm_ts_msgs::access

◆ setSpeed() [1/2]

void etsi_its_denm_ts_msgs::access::setSpeed ( DENM & denm,
const double speed_val,
const double confidence = std::numeric_limits<double>::infinity() )
inline

Set the vehicle speed.

Parameters
denmDENM to set the speed value
speed_valspeed value to set in m/s as decimal number
confidencespeed confidence value to set in m/s (default: infinity, mapping to SpeedConfidence::UNAVAILABLE)

Definition at line 77 of file denm_ts_setters.h.

87 {
88
90
92
100inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
101 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
102}
103
110inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
111 if (denm.denm.location_is_present) {
112 denm.denm.location.event_position_heading_is_present = presence_of_heading;
113 } else {
114 throw std::invalid_argument("LocationContainer is not present!");
115 }
116}
117
128inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
129 if (denm.denm.location_is_present) {
130 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
131 setIsWGSHeadingPresent(denm, true);
132 } else {
133 throw std::invalid_argument("LocationContainer is not present!");
134 }
135}
136
137} // namespace etsi_its_denm_ts_msgs::access

◆ setSpeed() [2/2]

void etsi_its_denm_ts_msgs::access::setSpeed ( Speed & speed,
const double value,
const double confidence = std::numeric_limits<double>::infinity() )
inline

Set the Speed object.

SpeedConfidence is set to UNAVAILABLE

Parameters
speedobject to set
valueSpeed in in m/s as decimal number
confidencestandard deviation in m/s as decimal number (Optional. Default is std::numeric_limits<double>::infinity(), mapping to SpeedConfidence::UNAVAILABLE)

Definition at line 152 of file denm_ts_setters.h.

162 {
163
165
167
175inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
176 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
177}
178
185inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
186 if (denm.denm.location_is_present) {
187 denm.denm.location.event_position_heading_is_present = presence_of_heading;
188 } else {
189 throw std::invalid_argument("LocationContainer is not present!");
190 }
191}
192
203inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
204 if (denm.denm.location_is_present) {
205 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
206 setIsWGSHeadingPresent(denm, true);
207 } else {
208 throw std::invalid_argument("LocationContainer is not present!");
209 }
210}
211
212} // namespace etsi_its_denm_ts_msgs::access

◆ setSpeedConfidence()

void etsi_its_denm_ts_msgs::access::setSpeedConfidence ( SpeedConfidence & speed_confidence,
const double value )
inline

Set the Speed Confidence object.

Parameters
speed_confidenceobject to set
valuestandard deviation in m/s as decimal number

Definition at line 133 of file denm_ts_setters.h.

143 {
144
146
148
156inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
157 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
158}
159
166inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
167 if (denm.denm.location_is_present) {
168 denm.denm.location.event_position_heading_is_present = presence_of_heading;
169 } else {
170 throw std::invalid_argument("LocationContainer is not present!");
171 }
172}
173
184inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
185 if (denm.denm.location_is_present) {
186 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
187 setIsWGSHeadingPresent(denm, true);
188 } else {
189 throw std::invalid_argument("LocationContainer is not present!");
190 }
191}
192
193} // namespace etsi_its_denm_ts_msgs::access

◆ setSpeedValue()

void etsi_its_denm_ts_msgs::access::setSpeedValue ( SpeedValue & speed,
const double value )
inline

Set the SpeedValue object.

Parameters
speedobject to set
valueSpeedValue in m/s as decimal number

Definition at line 121 of file denm_ts_setters.h.

131 {
132
134
136
144inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
145 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
146}
147
154inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
155 if (denm.denm.location_is_present) {
156 denm.denm.location.event_position_heading_is_present = presence_of_heading;
157 } else {
158 throw std::invalid_argument("LocationContainer is not present!");
159 }
160}
161
172inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
173 if (denm.denm.location_is_present) {
174 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
175 setIsWGSHeadingPresent(denm, true);
176 } else {
177 throw std::invalid_argument("LocationContainer is not present!");
178 }
179}
180
181} // namespace etsi_its_denm_ts_msgs::access

◆ setStationId()

template<typename StationId>
void etsi_its_denm_ts_msgs::access::setStationId ( StationId & station_id,
const uint32_t id_value )
inline

Set the Station Id object.

Parameters
station_id
id_value

Definition at line 28 of file denm_ts_setters.h.

◆ setStationType() [1/2]

void etsi_its_denm_ts_msgs::access::setStationType ( DENM & denm,
const int value )
inline

Set the StationType for a DENM.

Parameters
denmDENM-Message to set the station_type value
valuestation_type value to set

Definition at line 38 of file denm_ts_setters.h.

◆ setStationType() [2/2]

template<typename StationType>
void etsi_its_denm_ts_msgs::access::setStationType ( StationType & station_type,
const uint8_t value )
inline

Set the Station Type.

Parameters
station_type
value

Definition at line 40 of file denm_ts_setters.h.

◆ setTimestampITS()

void etsi_its_denm_ts_msgs::access::setTimestampITS ( TimestampIts & timestamp_its,
const uint64_t unix_nanosecs,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin()->second )
inline

Set the TimestampITS object.

Parameters
[in]timestamp_itsTimestampITS object to set the timestamp
[in]unix_nanosecsUnix-Nanoseconds to set the timestamp for
[in]n_leap_secondsNumber of leap-seconds since 2004. (Defaults to the todays number of leap seconds since 2004.)
[in]epoch_offsetUnix-Timestamp in seconds for the 01.01.2004 at 00:00:00

Definition at line 53 of file denm_ts_setters.h.

53 {
54 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
55 setIsWGSHeadingPresent(denm, true);
56 } else {
57 throw std::invalid_argument("LocationContainer is not present!");
58 }
59}

◆ setWGSHeading()

void etsi_its_denm_ts_msgs::access::setWGSHeading ( DENM & denm,
const double heading_val,
const double confidence = std::numeric_limits<double>::infinity() )
inline

Set the WGS Heading for a DENM.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West Wgs84AngleConfidence is set to UNAVAILABLE

Parameters
denmDENM to set the WGS Heading
heading_valHeading value in degree as decimal number
confidencestandard deviation of heading in degree as decimal number (default: infinity, mapping to Wgs84AngleConfidence::UNAVAILABLE)

Definition at line 52 of file denm_ts_setters.h.

52 {
53 if (denm.denm.location_is_present) {
54 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
55 setIsWGSHeadingPresent(denm, true);
56 } else {
57 throw std::invalid_argument("LocationContainer is not present!");
58 }
59}

◆ setWGSHeadingCDD()

template<typename Wgs84Angle, typename Wgs84AngleConfidence = decltype(Wgs84Angle::confidence)>
void etsi_its_denm_ts_msgs::access::setWGSHeadingCDD ( Wgs84Angle & heading,
const double value,
double confidence = std::numeric_limits<double>::infinity() )

Set the Wgs84Angle object.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West Wgs84AngleConfidence is set to UNAVAILABLE

Parameters
headingobject to set
valueHeading value in degree as decimal number
confidencestandard deviation of heading in degree as decimal number (default: infinity, mapping to Wgs84AngleConfidence::UNAVAILABLE)

Definition at line 77 of file denm_ts_setters.h.

87 {
88
90
92
100inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
101 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
102}
103
110inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
111 if (denm.denm.location_is_present) {
112 denm.denm.location.event_position_heading_is_present = presence_of_heading;
113 } else {
114 throw std::invalid_argument("LocationContainer is not present!");
115 }
116}
117
128inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
129 if (denm.denm.location_is_present) {
130 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
131 setIsWGSHeadingPresent(denm, true);
132 } else {
133 throw std::invalid_argument("LocationContainer is not present!");
134 }
135}
136
137} // namespace etsi_its_denm_ts_msgs::access

◆ setWGSHeadingConfidence()

template<typename Wgs84AngleConfidence>
void etsi_its_denm_ts_msgs::access::setWGSHeadingConfidence ( Wgs84AngleConfidence & confidence,
const double value )
inline

Set the Wgs84AngleConfidence object.

Parameters
confidenceobject to set
valuestandard deviation of heading in degree as decimal number

Definition at line 56 of file denm_ts_setters.h.

56 {
57 throw std::invalid_argument("LocationContainer is not present!");
58 }
59}
60
61} // namespace etsi_its_denm_ts_msgs::access

◆ setWGSHeadingValue()

template<typename Wgs84AngleValue>
void etsi_its_denm_ts_msgs::access::setWGSHeadingValue ( Wgs84AngleValue & heading,
const double value )
inline

Set the Wgs84AngleValue object.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West

Parameters
headingobject to set
valueHeading value in degree as decimal number

Definition at line 43 of file denm_ts_setters.h.

◆ setWGSPosConfidenceEllipse()

template<typename PosConfidenceEllipse>
void etsi_its_denm_ts_msgs::access::setWGSPosConfidenceEllipse ( PosConfidenceEllipse & position_confidence_ellipse,
const std::array< double, 4 > & covariance_matrix )
inline

Set the Pos Confidence Ellipse object.

Parameters
position_confidence_ellipse
covariance_matrixThe 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_headingThe heading of the object in rad, with respect to WGS84

Definition at line 483 of file denm_ts_setters.h.

493 {
494
496
498
506inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
507 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
508}
509
516inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
517 if (denm.denm.location_is_present) {
518 denm.denm.location.event_position_heading_is_present = presence_of_heading;
519 } else {
520 throw std::invalid_argument("LocationContainer is not present!");
521 }
522}
523
534inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
535 if (denm.denm.location_is_present) {
536 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
537 setIsWGSHeadingPresent(denm, true);
538 } else {
539 throw std::invalid_argument("LocationContainer is not present!");
540 }
541}
542
543} // namespace etsi_its_denm_ts_msgs::access

◆ setYawRateCDD()

template<typename YawRate, typename YawRateValue = decltype(YawRate::yaw_rate_value), typename YawRateConfidence = decltype(YawRate::yaw_rate_confidence)>
void etsi_its_denm_ts_msgs::access::setYawRateCDD ( YawRate & yaw_rate,
const double value,
double confidence = std::numeric_limits<double>::infinity() )
inline

Set the Yaw Rate object.

Parameters
yaw_rateobject to set
valueYaw rate in degrees per second as decimal number
confidencestandard deviation of yaw rate in degrees per second as decimal number (default: infinity, mapping to YawRateConfidence::UNAVAILABLE)

Definition at line 330 of file denm_ts_setters.h.

340 {
341
343
345
353inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
354 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
355}
356
363inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
364 if (denm.denm.location_is_present) {
365 denm.denm.location.event_position_heading_is_present = presence_of_heading;
366 } else {
367 throw std::invalid_argument("LocationContainer is not present!");
368 }
369}
370
381inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
382 if (denm.denm.location_is_present) {
383 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
384 setIsWGSHeadingPresent(denm, true);
385 } else {
386 throw std::invalid_argument("LocationContainer is not present!");
387 }
388}
389
390} // namespace etsi_its_denm_ts_msgs::access

◆ throwIfNotPresent()

void etsi_its_denm_ts_msgs::access::throwIfNotPresent ( const bool is_present,
const std::string val_desc )
inline

Throws an exception if the given value is not present.

Parameters
is_presentWhether the value is present.
val_descDescription of the value for the exception message.

Definition at line 35 of file denm_ts_setters.h.

35 {
36 denm.denm.location.event_position_heading_is_present = presence_of_heading;
37 } else {

◆ throwIfOutOfRange()

template<typename T1, typename T2>
void etsi_its_denm_ts_msgs::access::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.

Template Parameters
T1
T2
Parameters
valThe value to check if it is in the range.
minThe minimum value of the range.
maxThe maximum value of the range.
val_descDescription of the value for the exception message.

Definition at line 24 of file denm_ts_setters.h.

24 {
25 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
26}
27