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

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

Go to the source code of this file.

Classes

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

Functions

template<typename T1, typename T2>
void etsi_its_denm_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_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_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_msgs::access::setStationId (StationId &station_id, const uint32_t id_value)
 Set the Station Id object.
template<typename StationType>
void etsi_its_denm_msgs::access::setStationType (StationType &station_type, const uint8_t value)
 Set the Station Type.
void etsi_its_denm_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_msgs::access::setLatitude (Latitude &latitude, const double deg)
 Set the Latitude object.
void etsi_its_denm_msgs::access::setLongitude (Longitude &longitude, const double deg)
 Set the Longitude object.
void etsi_its_denm_msgs::access::setAltitudeValue (AltitudeValue &altitude, const double value)
 Set the AltitudeValue object.
void etsi_its_denm_msgs::access::setAltitude (Altitude &altitude, const double value)
 Set the Altitude object.
void etsi_its_denm_msgs::access::setSpeedValue (SpeedValue &speed, const double value)
 Set the SpeedValue object.
void etsi_its_denm_msgs::access::setSpeedConfidence (SpeedConfidence &speed_confidence, const double value)
 Set the Speed Confidence object.
void etsi_its_denm_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_msgs::access::setAccelerationMagnitudeValue (AccelerationMagnitudeValue &accel_mag_value, const double value)
 Set the Acceleration Magnitude Value object.
template<typename AccelerationConfidence>
void etsi_its_denm_msgs::access::setAccelerationMagnitudeConfidence (AccelerationConfidence &accel_mag_confidence, const double value)
 Set the AccelerationMagnitude Confidence object.
template<typename AccelerationMagnitude>
void etsi_its_denm_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_msgs::access::setAccelerationConfidence (AccelerationConfidence &accel_confidence, const double value)
 Set the Acceleration Confidence object.
template<typename T>
void etsi_its_denm_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_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_msgs::access::setHeadingValue (HeadingValue &heading, const double value)
 Set the HeadingValue object.
template<typename HeadingConfidence>
void etsi_its_denm_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_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_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_msgs::access::setSemiAxis (SemiAxisLength &semi_axis_length, const double length)
 Set the Semi Axis length.
template<typename PosConfidenceEllipse>
void etsi_its_denm_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_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_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_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_msgs::access::setWGSPosConfidenceEllipse (PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix)
 Set the Pos Confidence Ellipse object.
void etsi_its_denm_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 T>
void etsi_its_denm_msgs::access::setBitString (T &bitstring, const std::vector< bool > &bits)
 Set a Bit String by a vector of bools.
void etsi_its_denm_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_msgs::access::setStationType (DENM &denm, const int value)
 Set the StationType for a DENM.
void etsi_its_denm_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_msgs::access::setIsSpeedPresent (DENM &denm, bool presence_of_speed)
 Set the IsSpeedPresent object for DENM.
void etsi_its_denm_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_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_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_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_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_msgs::access::setIsHeadingPresent (DENM &denm, bool presence_of_heading)
 Set the IsHeadingPresent object for DENM.
void etsi_its_denm_msgs::access::setHeading (DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
 Set the Heading for a DENM.

Detailed Description

Setter functions for the ETSI ITS DENM (EN).

Definition in file denm_setters.h.

Function Documentation

◆ confidenceEllipseFromCovMatrix()

std::tuple< double, double, double > etsi_its_denm_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_setters.h.

◆ confidenceEllipseFromWGSCovMatrix()

std::tuple< double, double, double > etsi_its_denm_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_setters.h.

510 {
511
513
515
523inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
524 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
525}
526
533inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
534 if (denm.denm.location_is_present) {
535 denm.denm.location.event_position_heading_is_present = presence_of_heading;
536 } else {
537 throw std::invalid_argument("LocationContainer is not present!");
538 }
539}
540
551inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
552 if (denm.denm.location_is_present) {
553 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
554 setIsHeadingPresent(denm, true);
555 } else {
556 throw std::invalid_argument("LocationContainer is not present!");
557 }
558}
559
560} // namespace etsi_its_denm_msgs::access
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
void setHeading(DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
Set the Heading for a DENM.
void setHeadingCDD(Heading &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
Set the Heading object.
void setIsHeadingPresent(DENM &denm, bool presence_of_heading)
Set the IsHeadingPresent object for 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.
Common setter functions for the ETSI ITS DENM (EN and TS).

◆ getLeapSecondInsertionsSince2004()

uint16_t etsi_its_denm_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_access.h.

117 {
119}
Utility functions for the ETSI ITS DENM (EN and TS).

◆ setAccelerationConfidence()

template<typename AccelerationConfidence>
void etsi_its_denm_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_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, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
283}
284
291inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
310 if (denm.denm.location_is_present) {
311 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
312 setIsHeadingPresent(denm, true);
313 } else {
314 throw std::invalid_argument("LocationContainer is not present!");
315 }
316}
317
318} // namespace etsi_its_denm_msgs::access

◆ setAccelerationMagnitude()

template<typename AccelerationMagnitude>
void etsi_its_denm_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_setters.h.

255 {
256
258
260
268inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
269 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
270}
271
278inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
279 if (denm.denm.location_is_present) {
280 denm.denm.location.event_position_heading_is_present = presence_of_heading;
281 } else {
282 throw std::invalid_argument("LocationContainer is not present!");
283 }
284}
285
296inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
297 if (denm.denm.location_is_present) {
298 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
299 setIsHeadingPresent(denm, true);
300 } else {
301 throw std::invalid_argument("LocationContainer is not present!");
302 }
303}
304
305} // namespace etsi_its_denm_msgs::access

◆ setAccelerationMagnitudeConfidence()

template<typename AccelerationConfidence>
void etsi_its_denm_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_setters.h.

235 {
236
238
240
248inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
249 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
250}
251
258inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
259 if (denm.denm.location_is_present) {
260 denm.denm.location.event_position_heading_is_present = presence_of_heading;
261 } else {
262 throw std::invalid_argument("LocationContainer is not present!");
263 }
264}
265
276inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
277 if (denm.denm.location_is_present) {
278 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
279 setIsHeadingPresent(denm, true);
280 } else {
281 throw std::invalid_argument("LocationContainer is not present!");
282 }
283}
284
285} // namespace etsi_its_denm_msgs::access

◆ setAccelerationMagnitudeValue()

template<typename AccelerationMagnitudeValue>
void etsi_its_denm_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_setters.h.

222 {
223
225
227
235inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
236 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
237}
238
245inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
246 if (denm.denm.location_is_present) {
247 denm.denm.location.event_position_heading_is_present = presence_of_heading;
248 } else {
249 throw std::invalid_argument("LocationContainer is not present!");
250 }
251}
252
263inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
264 if (denm.denm.location_is_present) {
265 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
266 setIsHeadingPresent(denm, true);
267 } else {
268 throw std::invalid_argument("LocationContainer is not present!");
269 }
270}
271
272} // namespace etsi_its_denm_msgs::access

◆ setAltitude()

void etsi_its_denm_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_setters.h.

168 {
169
171
173
181inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
182 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
183}
184
191inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
192 if (denm.denm.location_is_present) {
193 denm.denm.location.event_position_heading_is_present = presence_of_heading;
194 } else {
195 throw std::invalid_argument("LocationContainer is not present!");
196 }
197}
198
209inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
210 if (denm.denm.location_is_present) {
211 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
212 setIsHeadingPresent(denm, true);
213 } else {
214 throw std::invalid_argument("LocationContainer is not present!");
215 }
216}
217
218} // namespace etsi_its_denm_msgs::access

◆ setAltitudeValue()

void etsi_its_denm_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_setters.h.

149 {
150
152
154
162inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
163 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
164}
165
172inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
173 if (denm.denm.location_is_present) {
174 denm.denm.location.event_position_heading_is_present = presence_of_heading;
175 } else {
176 throw std::invalid_argument("LocationContainer is not present!");
177 }
178}
179
190inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
191 if (denm.denm.location_is_present) {
192 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
193 setIsHeadingPresent(denm, true);
194 } else {
195 throw std::invalid_argument("LocationContainer is not present!");
196 }
197}
198
199} // namespace etsi_its_denm_msgs::access

◆ setBitString()

template<typename T>
void etsi_its_denm_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_setters.h.

49 {
50 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
51}
52
59inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
60 if (denm.denm.location_is_present) {
61 denm.denm.location.event_position_heading_is_present = presence_of_heading;
62 } else {
63 throw std::invalid_argument("LocationContainer is not present!");
64 }
65}
66

◆ setDrivingLaneStatus()

void etsi_its_denm_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_setters.h.

179inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
180 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
181}
182
189inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
208 if (denm.denm.location_is_present) {
209 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
210 setIsHeadingPresent(denm, true);
211 } else {
212 throw std::invalid_argument("LocationContainer is not present!");
213 }
214}
215
216} // namespace etsi_its_denm_msgs::access

◆ setFromUTMPosition() [1/2]

void etsi_its_denm_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_setters.h.

156 {
157
159
161
169inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
170 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
171}
172
179inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
180 if (denm.denm.location_is_present) {
181 denm.denm.location.event_position_heading_is_present = presence_of_heading;
182 } else {
183 throw std::invalid_argument("LocationContainer is not present!");
184 }
185}
186
197inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
198 if (denm.denm.location_is_present) {
199 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
200 setIsHeadingPresent(denm, true);
201 } else {
202 throw std::invalid_argument("LocationContainer is not present!");
203 }
204}
205
206} // namespace etsi_its_denm_msgs::access

◆ setFromUTMPosition() [2/2]

template<typename T>
void etsi_its_denm_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_setters.h.

316 {
317
319
321
329inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
330 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
331}
332
339inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
340 if (denm.denm.location_is_present) {
341 denm.denm.location.event_position_heading_is_present = presence_of_heading;
342 } else {
343 throw std::invalid_argument("LocationContainer is not present!");
344 }
345}
346
357inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
358 if (denm.denm.location_is_present) {
359 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
360 setIsHeadingPresent(denm, true);
361 } else {
362 throw std::invalid_argument("LocationContainer is not present!");
363 }
364}
365
366} // namespace etsi_its_denm_msgs::access

◆ setHeading()

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

Set the 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 HeadingConfidence is set to UNAVAILABLE

Parameters
denmDENM to set the ReferencePosition
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 77 of file denm_setters.h.

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

◆ setHeadingCDD()

template<typename Heading, typename HeadingConfidence = decltype(Heading::heading_confidence)>
void etsi_its_denm_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_setters.h.

375 {
376
378
380
388inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
389 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
390}
391
398inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
399 if (denm.denm.location_is_present) {
400 denm.denm.location.event_position_heading_is_present = presence_of_heading;
401 } else {
402 throw std::invalid_argument("LocationContainer is not present!");
403 }
404}
405
416inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
417 if (denm.denm.location_is_present) {
418 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
419 setIsHeadingPresent(denm, true);
420 } else {
421 throw std::invalid_argument("LocationContainer is not present!");
422 }
423}
424
425} // namespace etsi_its_denm_msgs::access

◆ setHeadingConfidence()

template<typename HeadingConfidence>
void etsi_its_denm_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_setters.h.

354 {
355
357
359
367inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
368 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
369}
370
377inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
378 if (denm.denm.location_is_present) {
379 denm.denm.location.event_position_heading_is_present = presence_of_heading;
380 } else {
381 throw std::invalid_argument("LocationContainer is not present!");
382 }
383}
384
395inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
396 if (denm.denm.location_is_present) {
397 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
398 setIsHeadingPresent(denm, true);
399 } else {
400 throw std::invalid_argument("LocationContainer is not present!");
401 }
402}
403
404} // namespace etsi_its_denm_msgs::access

◆ setHeadingValue()

template<typename HeadingValue>
void etsi_its_denm_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_setters.h.

341 {
342
344
346
354inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
355 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
356}
357
364inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
365 if (denm.denm.location_is_present) {
366 denm.denm.location.event_position_heading_is_present = presence_of_heading;
367 } else {
368 throw std::invalid_argument("LocationContainer is not present!");
369 }
370}
371
382inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
383 if (denm.denm.location_is_present) {
384 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
385 setIsHeadingPresent(denm, true);
386 } else {
387 throw std::invalid_argument("LocationContainer is not present!");
388 }
389}
390
391} // namespace etsi_its_denm_msgs::access

◆ setIsHeadingPresent()

void etsi_its_denm_msgs::access::setIsHeadingPresent ( DENM & denm,
bool presence_of_heading )
inline

Set the IsHeadingPresent object for DENM.

Parameters
denmDENM to set IsHeadingPresent
presence_of_headingIsHeadingPresent-Value (true or false)

Definition at line 59 of file denm_setters.h.

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

◆ setIsSpeedPresent()

void etsi_its_denm_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_setters.h.

◆ setItsPduHeader() [1/2]

void etsi_its_denm_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 49 of file denm_setters.h.

49 {
50 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
51}

◆ setItsPduHeader() [2/2]

void etsi_its_denm_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_setters.h.

49 {
50 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
51}
52

◆ setLatitude()

void etsi_its_denm_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_setters.h.

138inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
139 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
140}
141
148inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
149 if (denm.denm.location_is_present) {
150 denm.denm.location.event_position_heading_is_present = presence_of_heading;
151 } else {
152 throw std::invalid_argument("LocationContainer is not present!");
153 }
154}
155
166inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
167 if (denm.denm.location_is_present) {
168 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
169 setIsHeadingPresent(denm, true);
170 } else {
171 throw std::invalid_argument("LocationContainer is not present!");
172 }
173}
174
175} // namespace etsi_its_denm_msgs::access

◆ setLightBarSirenInUse()

void etsi_its_denm_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_setters.h.

176 {
177
179
181
189inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
190 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
191}
192
199inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
200 if (denm.denm.location_is_present) {
201 denm.denm.location.event_position_heading_is_present = presence_of_heading;
202 } else {
203 throw std::invalid_argument("LocationContainer is not present!");
204 }
205}
206
217inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
218 if (denm.denm.location_is_present) {
219 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
220 setIsHeadingPresent(denm, true);
221 } else {
222 throw std::invalid_argument("LocationContainer is not present!");
223 }
224}
225
226} // namespace etsi_its_denm_msgs::access

◆ setLongitude()

void etsi_its_denm_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_setters.h.

137 {
138
140
142
150inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
151 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
152}
153
160inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
161 if (denm.denm.location_is_present) {
162 denm.denm.location.event_position_heading_is_present = presence_of_heading;
163 } else {
164 throw std::invalid_argument("LocationContainer is not present!");
165 }
166}
167
178inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
179 if (denm.denm.location_is_present) {
180 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
181 setIsHeadingPresent(denm, true);
182 } else {
183 throw std::invalid_argument("LocationContainer is not present!");
184 }
185}
186
187} // namespace etsi_its_denm_msgs::access

◆ setPosConfidenceEllipse() [1/2]

template<typename PosConfidenceEllipse>
void etsi_its_denm_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_setters.h.

453 {
454
456
458
466inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
467 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
468}
469
476inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
477 if (denm.denm.location_is_present) {
478 denm.denm.location.event_position_heading_is_present = presence_of_heading;
479 } else {
480 throw std::invalid_argument("LocationContainer is not present!");
481 }
482}
483
494inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
495 if (denm.denm.location_is_present) {
496 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
497 setIsHeadingPresent(denm, true);
498 } else {
499 throw std::invalid_argument("LocationContainer is not present!");
500 }
501}
502
503} // namespace etsi_its_denm_msgs::access

◆ setPosConfidenceEllipse() [2/2]

template<typename PosConfidenceEllipse>
void etsi_its_denm_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_setters.h.

526 {
527
529
531
539inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
540 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
541}
542
549inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
550 if (denm.denm.location_is_present) {
551 denm.denm.location.event_position_heading_is_present = presence_of_heading;
552 } else {
553 throw std::invalid_argument("LocationContainer is not present!");
554 }
555}
556
567inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
568 if (denm.denm.location_is_present) {
569 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
570 setIsHeadingPresent(denm, true);
571 } else {
572 throw std::invalid_argument("LocationContainer is not present!");
573 }
574}
575
576} // namespace etsi_its_denm_msgs::access

◆ setReferencePosition() [1/2]

void etsi_its_denm_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_setters.h.

75 : infinity, mapping to HeadingConfidence::UNAVAILABLE)
76 */
77inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {

◆ setReferencePosition() [2/2]

template<typename T>
void etsi_its_denm_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_setters.h.

290 {
291
293
295
303inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
304 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
305}
306
313inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
314 if (denm.denm.location_is_present) {
315 denm.denm.location.event_position_heading_is_present = presence_of_heading;
316 } else {
317 throw std::invalid_argument("LocationContainer is not present!");
318 }
319}
320
331inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
332 if (denm.denm.location_is_present) {
333 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
334 setIsHeadingPresent(denm, true);
335 } else {
336 throw std::invalid_argument("LocationContainer is not present!");
337 }
338}
339
340} // namespace etsi_its_denm_msgs::access

◆ setReferenceTime()

void etsi_its_denm_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_setters.h.

49 {
50 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
51}
52

◆ setSemiAxis()

template<typename SemiAxisLength>
void etsi_its_denm_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_setters.h.

447inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
448 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
449}
450
457inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
458 if (denm.denm.location_is_present) {
459 denm.denm.location.event_position_heading_is_present = presence_of_heading;
460 } else {
461 throw std::invalid_argument("LocationContainer is not present!");
462 }
463}
464
475inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
476 if (denm.denm.location_is_present) {
477 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
478 setIsHeadingPresent(denm, true);
479 } else {
480 throw std::invalid_argument("LocationContainer is not present!");
481 }
482}
483
484} // namespace etsi_its_denm_msgs::access

◆ setSpeed() [1/2]

void etsi_its_denm_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_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, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
150}
151
158inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
177 if (denm.denm.location_is_present) {
178 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
179 setIsHeadingPresent(denm, true);
180 } else {
181 throw std::invalid_argument("LocationContainer is not present!");
182 }
183}
184
185} // namespace etsi_its_denm_msgs::access

◆ setSpeed() [2/2]

void etsi_its_denm_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_setters.h.

210 {
211
213
215
223inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
224 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
225}
226
233inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
234 if (denm.denm.location_is_present) {
235 denm.denm.location.event_position_heading_is_present = presence_of_heading;
236 } else {
237 throw std::invalid_argument("LocationContainer is not present!");
238 }
239}
240
251inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
252 if (denm.denm.location_is_present) {
253 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
254 setIsHeadingPresent(denm, true);
255 } else {
256 throw std::invalid_argument("LocationContainer is not present!");
257 }
258}
259
260} // namespace etsi_its_denm_msgs::access

◆ setSpeedConfidence()

void etsi_its_denm_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_setters.h.

191 {
192
194
196
204inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
205 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
206}
207
214inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
215 if (denm.denm.location_is_present) {
216 denm.denm.location.event_position_heading_is_present = presence_of_heading;
217 } else {
218 throw std::invalid_argument("LocationContainer is not present!");
219 }
220}
221
232inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
233 if (denm.denm.location_is_present) {
234 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
235 setIsHeadingPresent(denm, true);
236 } else {
237 throw std::invalid_argument("LocationContainer is not present!");
238 }
239}
240
241} // namespace etsi_its_denm_msgs::access

◆ setSpeedValue()

void etsi_its_denm_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_setters.h.

179 {
180
182
184
192inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
193 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
194}
195
202inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
203 if (denm.denm.location_is_present) {
204 denm.denm.location.event_position_heading_is_present = presence_of_heading;
205 } else {
206 throw std::invalid_argument("LocationContainer is not present!");
207 }
208}
209
220inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
221 if (denm.denm.location_is_present) {
222 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
223 setIsHeadingPresent(denm, true);
224 } else {
225 throw std::invalid_argument("LocationContainer is not present!");
226 }
227}
228
229} // namespace etsi_its_denm_msgs::access

◆ setStationId()

template<typename StationId>
void etsi_its_denm_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_setters.h.

◆ setStationType() [1/2]

void etsi_its_denm_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_setters.h.

◆ setStationType() [2/2]

template<typename StationType>
void etsi_its_denm_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_setters.h.

◆ setTimestampITS()

void etsi_its_denm_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_setters.h.

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

◆ setWGSPosConfidenceEllipse()

template<typename PosConfidenceEllipse>
void etsi_its_denm_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_setters.h.

541 {
542
544
546
554inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
555 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
556}
557
564inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
565 if (denm.denm.location_is_present) {
566 denm.denm.location.event_position_heading_is_present = presence_of_heading;
567 } else {
568 throw std::invalid_argument("LocationContainer is not present!");
569 }
570}
571
582inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
583 if (denm.denm.location_is_present) {
584 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
585 setIsHeadingPresent(denm, true);
586 } else {
587 throw std::invalid_argument("LocationContainer is not present!");
588 }
589}
590
591} // namespace etsi_its_denm_msgs::access

◆ setYawRateCDD()

template<typename YawRate, typename YawRateValue = decltype(YawRate::yaw_rate_value), typename YawRateConfidence = decltype(YawRate::yaw_rate_confidence)>
void etsi_its_denm_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_setters.h.

388 {
389
391
393
401inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
402 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
403}
404
411inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
412 if (denm.denm.location_is_present) {
413 denm.denm.location.event_position_heading_is_present = presence_of_heading;
414 } else {
415 throw std::invalid_argument("LocationContainer is not present!");
416 }
417}
418
429inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
430 if (denm.denm.location_is_present) {
431 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
432 setIsHeadingPresent(denm, true);
433 } else {
434 throw std::invalid_argument("LocationContainer is not present!");
435 }
436}
437
438} // namespace etsi_its_denm_msgs::access

◆ throwIfNotPresent()

void etsi_its_denm_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_setters.h.

59 {
60 if (denm.denm.location_is_present) {

◆ throwIfOutOfRange()

template<typename T1, typename T2>
void etsi_its_denm_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_setters.h.

49 {
50 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
51}