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 34 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 434 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 475 of file denm_ts_setters.h.

521inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
522 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
523}
524
531inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
532 if (denm.denm.location_is_present) {
533 denm.denm.location.event_position_heading_is_present = presence_of_heading;
534 } else {
535 throw std::invalid_argument("LocationContainer is not present!");
536 }
537}
538
549inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
550 if (denm.denm.location_is_present) {
551 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
552 setIsWGSHeadingPresent(denm, true);
553 } else {
554 throw std::invalid_argument("LocationContainer is not present!");
555 }
556}
557
558} // 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 61 of file denm_ts_access.h.

117 {
119}
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 233 of file denm_ts_setters.h.

266 {
267
269
271
279inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
280 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
281}
282
289inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
290 if (denm.denm.location_is_present) {
291 denm.denm.location.event_position_heading_is_present = presence_of_heading;
292 } else {
293 throw std::invalid_argument("LocationContainer is not present!");
294 }
295}
296
307inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
308 if (denm.denm.location_is_present) {
309 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
310 setIsWGSHeadingPresent(denm, true);
311 } else {
312 throw std::invalid_argument("LocationContainer is not present!");
313 }
314}
315
316} // 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 220 of file denm_ts_setters.h.

253 {
254
256
258
266inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
267 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
268}
269
276inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
277 if (denm.denm.location_is_present) {
278 denm.denm.location.event_position_heading_is_present = presence_of_heading;
279 } else {
280 throw std::invalid_argument("LocationContainer is not present!");
281 }
282}
283
294inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
295 if (denm.denm.location_is_present) {
296 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
297 setIsWGSHeadingPresent(denm, true);
298 } else {
299 throw std::invalid_argument("LocationContainer is not present!");
300 }
301}
302
303} // 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 200 of file denm_ts_setters.h.

233 {
234
236
238
246inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
247 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
248}
249
256inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
257 if (denm.denm.location_is_present) {
258 denm.denm.location.event_position_heading_is_present = presence_of_heading;
259 } else {
260 throw std::invalid_argument("LocationContainer is not present!");
261 }
262}
263
274inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
275 if (denm.denm.location_is_present) {
276 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
277 setIsWGSHeadingPresent(denm, true);
278 } else {
279 throw std::invalid_argument("LocationContainer is not present!");
280 }
281}
282
283} // 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 187 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

◆ 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 133 of file denm_ts_setters.h.

166 {
167
169
171
179inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
180 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
181}
182
189inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
190 if (denm.denm.location_is_present) {
191 denm.denm.location.event_position_heading_is_present = presence_of_heading;
192 } else {
193 throw std::invalid_argument("LocationContainer is not present!");
194 }
195}
196
207inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
208 if (denm.denm.location_is_present) {
209 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
210 setIsWGSHeadingPresent(denm, true);
211 } else {
212 throw std::invalid_argument("LocationContainer is not present!");
213 }
214}
215
216} // 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 114 of file denm_ts_setters.h.

147 {
148
150
152
160inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
161 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
162}
163
170inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
171 if (denm.denm.location_is_present) {
172 denm.denm.location.event_position_heading_is_present = presence_of_heading;
173 } else {
174 throw std::invalid_argument("LocationContainer is not present!");
175 }
176}
177
188inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
189 if (denm.denm.location_is_present) {
190 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
191 setIsWGSHeadingPresent(denm, true);
192 } else {
193 throw std::invalid_argument("LocationContainer is not present!");
194 }
195}
196
197} // 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 44 of file denm_ts_setters.h.

47 {
48 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
49}
50
57inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
58 if (denm.denm.location_is_present) {
59 denm.denm.location.event_position_heading_is_present = presence_of_heading;
60 } else {
61 throw std::invalid_argument("LocationContainer is not present!");
62 }
63}
64

◆ 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 131 of file denm_ts_setters.h.

177inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
178 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
179}
180
187inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
188 if (denm.denm.location_is_present) {
189 denm.denm.location.event_position_heading_is_present = presence_of_heading;
190 } else {
191 throw std::invalid_argument("LocationContainer is not present!");
192 }
193}
194
205inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
206 if (denm.denm.location_is_present) {
207 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
208 setIsWGSHeadingPresent(denm, true);
209 } else {
210 throw std::invalid_argument("LocationContainer is not present!");
211 }
212}
213
214} // 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 121 of file denm_ts_setters.h.

154 {
155
157
159
167inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
168 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
169}
170
177inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
178 if (denm.denm.location_is_present) {
179 denm.denm.location.event_position_heading_is_present = presence_of_heading;
180 } else {
181 throw std::invalid_argument("LocationContainer is not present!");
182 }
183}
184
195inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
196 if (denm.denm.location_is_present) {
197 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
198 setIsWGSHeadingPresent(denm, true);
199 } else {
200 throw std::invalid_argument("LocationContainer is not present!");
201 }
202}
203
204} // 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 281 of file denm_ts_setters.h.

314 {
315
317
319
327inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
328 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
329}
330
337inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
338 if (denm.denm.location_is_present) {
339 denm.denm.location.event_position_heading_is_present = presence_of_heading;
340 } else {
341 throw std::invalid_argument("LocationContainer is not present!");
342 }
343}
344
355inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
356 if (denm.denm.location_is_present) {
357 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
358 setIsWGSHeadingPresent(denm, true);
359 } else {
360 throw std::invalid_argument("LocationContainer is not present!");
361 }
362}
363
364} // 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 340 of file denm_ts_setters.h.

373 {
374
376
378
386inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
387 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
388}
389
396inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
397 if (denm.denm.location_is_present) {
398 denm.denm.location.event_position_heading_is_present = presence_of_heading;
399 } else {
400 throw std::invalid_argument("LocationContainer is not present!");
401 }
402}
403
414inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
415 if (denm.denm.location_is_present) {
416 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
417 setIsWGSHeadingPresent(denm, true);
418 } else {
419 throw std::invalid_argument("LocationContainer is not present!");
420 }
421}
422
423} // 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 319 of file denm_ts_setters.h.

352 {
353
355
357
365inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
366 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
367}
368
375inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
376 if (denm.denm.location_is_present) {
377 denm.denm.location.event_position_heading_is_present = presence_of_heading;
378 } else {
379 throw std::invalid_argument("LocationContainer is not present!");
380 }
381}
382
393inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
394 if (denm.denm.location_is_present) {
395 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
396 setIsWGSHeadingPresent(denm, true);
397 } else {
398 throw std::invalid_argument("LocationContainer is not present!");
399 }
400}
401
402} // 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 306 of file denm_ts_setters.h.

339 {
340
342
344
352inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
353 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
354}
355
362inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
363 if (denm.denm.location_is_present) {
364 denm.denm.location.event_position_heading_is_present = presence_of_heading;
365 } else {
366 throw std::invalid_argument("LocationContainer is not present!");
367 }
368}
369
380inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
381 if (denm.denm.location_is_present) {
382 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
383 setIsWGSHeadingPresent(denm, true);
384 } else {
385 throw std::invalid_argument("LocationContainer is not present!");
386 }
387}
388
389} // 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 85 of file denm_ts_setters.h.

118 {
119
121
123
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

◆ 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 57 of file denm_ts_setters.h.

57 {
58 if (denm.denm.location_is_present) {
59 denm.denm.location.event_position_heading_is_present = presence_of_heading;
60 } else {
61 throw std::invalid_argument("LocationContainer is not present!");
62 }
63}

◆ 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 47 of file denm_ts_setters.h.

47 {
48 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
49}

◆ 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 48 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 90 of file denm_ts_setters.h.

123 {
124
126
128
136inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
137 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
138}
139
146inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
147 if (denm.denm.location_is_present) {
148 denm.denm.location.event_position_heading_is_present = presence_of_heading;
149 } else {
150 throw std::invalid_argument("LocationContainer is not present!");
151 }
152}
153
164inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
165 if (denm.denm.location_is_present) {
166 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
167 setIsWGSHeadingPresent(denm, true);
168 } else {
169 throw std::invalid_argument("LocationContainer is not present!");
170 }
171}
172
173} // 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 141 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

◆ 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 102 of file denm_ts_setters.h.

135 {
136
138
140
148inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
149 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
150}
151
158inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
159 if (denm.denm.location_is_present) {
160 denm.denm.location.event_position_heading_is_present = presence_of_heading;
161 } else {
162 throw std::invalid_argument("LocationContainer is not present!");
163 }
164}
165
176inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
177 if (denm.denm.location_is_present) {
178 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
179 setIsWGSHeadingPresent(denm, true);
180 } else {
181 throw std::invalid_argument("LocationContainer is not present!");
182 }
183}
184
185} // 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 418 of file denm_ts_setters.h.

451 {
452
454
456
464inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
465 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
466}
467
474inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
475 if (denm.denm.location_is_present) {
476 denm.denm.location.event_position_heading_is_present = presence_of_heading;
477 } else {
478 throw std::invalid_argument("LocationContainer is not present!");
479 }
480}
481
492inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
493 if (denm.denm.location_is_present) {
494 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
495 setIsWGSHeadingPresent(denm, true);
496 } else {
497 throw std::invalid_argument("LocationContainer is not present!");
498 }
499}
500
501} // 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 491 of file denm_ts_setters.h.

524 {
525
527
529
537inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
538 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
539}
540
547inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
548 if (denm.denm.location_is_present) {
549 denm.denm.location.event_position_heading_is_present = presence_of_heading;
550 } else {
551 throw std::invalid_argument("LocationContainer is not present!");
552 }
553}
554
565inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
566 if (denm.denm.location_is_present) {
567 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
568 setIsWGSHeadingPresent(denm, true);
569 } else {
570 throw std::invalid_argument("LocationContainer is not present!");
571 }
572}
573
574} // 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 74 of file denm_ts_setters.h.

75 {
76 if (denm.denm.location_is_present) {
77 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 255 of file denm_ts_setters.h.

288 {
289
291
293
301inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
302 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
303}
304
311inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
312 if (denm.denm.location_is_present) {
313 denm.denm.location.event_position_heading_is_present = presence_of_heading;
314 } else {
315 throw std::invalid_argument("LocationContainer is not present!");
316 }
317}
318
329inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
330 if (denm.denm.location_is_present) {
331 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
332 setIsWGSHeadingPresent(denm, true);
333 } else {
334 throw std::invalid_argument("LocationContainer is not present!");
335 }
336}
337
338} // 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 46 of file denm_ts_setters.h.

47 {
48 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
49}
50

◆ 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 399 of file denm_ts_setters.h.

445inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
446 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
447}
448
455inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
456 if (denm.denm.location_is_present) {
457 denm.denm.location.event_position_heading_is_present = presence_of_heading;
458 } else {
459 throw std::invalid_argument("LocationContainer is not present!");
460 }
461}
462
473inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
474 if (denm.denm.location_is_present) {
475 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
476 setIsWGSHeadingPresent(denm, true);
477 } else {
478 throw std::invalid_argument("LocationContainer is not present!");
479 }
480}
481
482} // 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 100 of file denm_ts_setters.h.

133 {
134
136
138
146inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
147 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
148}
149
156inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
157 if (denm.denm.location_is_present) {
158 denm.denm.location.event_position_heading_is_present = presence_of_heading;
159 } else {
160 throw std::invalid_argument("LocationContainer is not present!");
161 }
162}
163
174inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
175 if (denm.denm.location_is_present) {
176 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
177 setIsWGSHeadingPresent(denm, true);
178 } else {
179 throw std::invalid_argument("LocationContainer is not present!");
180 }
181}
182
183} // 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 175 of file denm_ts_setters.h.

208 {
209
211
213
221inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
222 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
223}
224
231inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
232 if (denm.denm.location_is_present) {
233 denm.denm.location.event_position_heading_is_present = presence_of_heading;
234 } else {
235 throw std::invalid_argument("LocationContainer is not present!");
236 }
237}
238
249inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
250 if (denm.denm.location_is_present) {
251 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
252 setIsWGSHeadingPresent(denm, true);
253 } else {
254 throw std::invalid_argument("LocationContainer is not present!");
255 }
256}
257
258} // 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 156 of file denm_ts_setters.h.

189 {
190
192
194
202inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
203 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
204}
205
212inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
213 if (denm.denm.location_is_present) {
214 denm.denm.location.event_position_heading_is_present = presence_of_heading;
215 } else {
216 throw std::invalid_argument("LocationContainer is not present!");
217 }
218}
219
230inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
231 if (denm.denm.location_is_present) {
232 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
233 setIsWGSHeadingPresent(denm, true);
234 } else {
235 throw std::invalid_argument("LocationContainer is not present!");
236 }
237}
238
239} // 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 144 of file denm_ts_setters.h.

177 {
178
180
182
190inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
191 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
192}
193
200inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
201 if (denm.denm.location_is_present) {
202 denm.denm.location.event_position_heading_is_present = presence_of_heading;
203 } else {
204 throw std::invalid_argument("LocationContainer is not present!");
205 }
206}
207
218inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
219 if (denm.denm.location_is_present) {
220 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
221 setIsWGSHeadingPresent(denm, true);
222 } else {
223 throw std::invalid_argument("LocationContainer is not present!");
224 }
225}
226
227} // 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 51 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 61 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 63 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 76 of file denm_ts_setters.h.

76 {
77 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
78 setIsWGSHeadingPresent(denm, true);
79 } else {
80 throw std::invalid_argument("LocationContainer is not present!");
81 }
82}

◆ 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 75 of file denm_ts_setters.h.

75 {
76 if (denm.denm.location_is_present) {
77 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
78 setIsWGSHeadingPresent(denm, true);
79 } else {
80 throw std::invalid_argument("LocationContainer is not present!");
81 }
82}

◆ 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 100 of file denm_ts_setters.h.

133 {
134
136
138
146inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
147 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
148}
149
156inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
157 if (denm.denm.location_is_present) {
158 denm.denm.location.event_position_heading_is_present = presence_of_heading;
159 } else {
160 throw std::invalid_argument("LocationContainer is not present!");
161 }
162}
163
174inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
175 if (denm.denm.location_is_present) {
176 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
177 setIsWGSHeadingPresent(denm, true);
178 } else {
179 throw std::invalid_argument("LocationContainer is not present!");
180 }
181}
182
183} // 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 79 of file denm_ts_setters.h.

79 {
80 throw std::invalid_argument("LocationContainer is not present!");
81 }
82}
83
84} // 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 66 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 506 of file denm_ts_setters.h.

539 {
540
542
544
552inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
553 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
554}
555
562inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
563 if (denm.denm.location_is_present) {
564 denm.denm.location.event_position_heading_is_present = presence_of_heading;
565 } else {
566 throw std::invalid_argument("LocationContainer is not present!");
567 }
568}
569
580inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
581 if (denm.denm.location_is_present) {
582 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
583 setIsWGSHeadingPresent(denm, true);
584 } else {
585 throw std::invalid_argument("LocationContainer is not present!");
586 }
587}
588
589} // 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 353 of file denm_ts_setters.h.

386 {
387
389
391
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

◆ 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 58 of file denm_ts_setters.h.

58 {
59 denm.denm.location.event_position_heading_is_present = presence_of_heading;
60 } 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 47 of file denm_ts_setters.h.

47 {
48 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
49}
50