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 411 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 452 of file denm_setters.h.

464 {
465
467
469
477inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
478 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
479}
480
487inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
488 if (denm.denm.location_is_present) {
489 denm.denm.location.event_position_heading_is_present = presence_of_heading;
490 } else {
491 throw std::invalid_argument("LocationContainer is not present!");
492 }
493}
494
505inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
506 if (denm.denm.location_is_present) {
507 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
508 setIsHeadingPresent(denm, true);
509 } else {
510 throw std::invalid_argument("LocationContainer is not present!");
511 }
512}
513
514} // 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 38 of file denm_access.h.

71 {
73}
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 210 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

◆ 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 197 of file denm_setters.h.

209 {
210
212
214
222inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
223 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
224}
225
232inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
233 if (denm.denm.location_is_present) {
234 denm.denm.location.event_position_heading_is_present = presence_of_heading;
235 } else {
236 throw std::invalid_argument("LocationContainer is not present!");
237 }
238}
239
250inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
251 if (denm.denm.location_is_present) {
252 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
253 setIsHeadingPresent(denm, true);
254 } else {
255 throw std::invalid_argument("LocationContainer is not present!");
256 }
257}
258
259} // 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 177 of file denm_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, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
204}
205
212inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
231 if (denm.denm.location_is_present) {
232 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
233 setIsHeadingPresent(denm, true);
234 } else {
235 throw std::invalid_argument("LocationContainer is not present!");
236 }
237}
238
239} // 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 164 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

◆ 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 110 of file denm_setters.h.

122 {
123
125
127
135inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
136 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
137}
138
145inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
146 if (denm.denm.location_is_present) {
147 denm.denm.location.event_position_heading_is_present = presence_of_heading;
148 } else {
149 throw std::invalid_argument("LocationContainer is not present!");
150 }
151}
152
163inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
164 if (denm.denm.location_is_present) {
165 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
166 setIsHeadingPresent(denm, true);
167 } else {
168 throw std::invalid_argument("LocationContainer is not present!");
169 }
170}
171
172} // 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 91 of file denm_setters.h.

103 {
104
106
108
116inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
117 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
118}
119
126inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
127 if (denm.denm.location_is_present) {
128 denm.denm.location.event_position_heading_is_present = presence_of_heading;
129 } else {
130 throw std::invalid_argument("LocationContainer is not present!");
131 }
132}
133
144inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
145 if (denm.denm.location_is_present) {
146 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
147 setIsHeadingPresent(denm, true);
148 } else {
149 throw std::invalid_argument("LocationContainer is not present!");
150 }
151}
152
153} // 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 21 of file denm_setters.h.

26 {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
28}
29
36inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
37 if (denm.denm.location_is_present) {
38 denm.denm.location.event_position_heading_is_present = presence_of_heading;
39 } else {
40 throw std::invalid_argument("LocationContainer is not present!");
41 }
42}
43

◆ 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 108 of file denm_setters.h.

133inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
134 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
135}
136
143inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
144 if (denm.denm.location_is_present) {
145 denm.denm.location.event_position_heading_is_present = presence_of_heading;
146 } else {
147 throw std::invalid_argument("LocationContainer is not present!");
148 }
149}
150
161inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
162 if (denm.denm.location_is_present) {
163 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
164 setIsHeadingPresent(denm, true);
165 } else {
166 throw std::invalid_argument("LocationContainer is not present!");
167 }
168}
169
170} // 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 98 of file denm_setters.h.

110 {
111
113
115
123inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
124 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
125}
126
133inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
134 if (denm.denm.location_is_present) {
135 denm.denm.location.event_position_heading_is_present = presence_of_heading;
136 } else {
137 throw std::invalid_argument("LocationContainer is not present!");
138 }
139}
140
151inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
152 if (denm.denm.location_is_present) {
153 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
154 setIsHeadingPresent(denm, true);
155 } else {
156 throw std::invalid_argument("LocationContainer is not present!");
157 }
158}
159
160} // 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 258 of file denm_setters.h.

270 {
271
273
275
283inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
284 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
285}
286
293inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
294 if (denm.denm.location_is_present) {
295 denm.denm.location.event_position_heading_is_present = presence_of_heading;
296 } else {
297 throw std::invalid_argument("LocationContainer is not present!");
298 }
299}
300
311inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
312 if (denm.denm.location_is_present) {
313 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
314 setIsHeadingPresent(denm, true);
315 } else {
316 throw std::invalid_argument("LocationContainer is not present!");
317 }
318}
319
320} // 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 54 of file denm_setters.h.

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

◆ 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 317 of file denm_setters.h.

329 {
330
332
334
342inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
343 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
344}
345
352inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
353 if (denm.denm.location_is_present) {
354 denm.denm.location.event_position_heading_is_present = presence_of_heading;
355 } else {
356 throw std::invalid_argument("LocationContainer is not present!");
357 }
358}
359
370inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
371 if (denm.denm.location_is_present) {
372 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
373 setIsHeadingPresent(denm, true);
374 } else {
375 throw std::invalid_argument("LocationContainer is not present!");
376 }
377}
378
379} // 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 296 of file denm_setters.h.

308 {
309
311
313
321inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
322 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
323}
324
331inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
332 if (denm.denm.location_is_present) {
333 denm.denm.location.event_position_heading_is_present = presence_of_heading;
334 } else {
335 throw std::invalid_argument("LocationContainer is not present!");
336 }
337}
338
349inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
350 if (denm.denm.location_is_present) {
351 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
352 setIsHeadingPresent(denm, true);
353 } else {
354 throw std::invalid_argument("LocationContainer is not present!");
355 }
356}
357
358} // 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 283 of file denm_setters.h.

295 {
296
298
300
308inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
309 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
310}
311
318inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
319 if (denm.denm.location_is_present) {
320 denm.denm.location.event_position_heading_is_present = presence_of_heading;
321 } else {
322 throw std::invalid_argument("LocationContainer is not present!");
323 }
324}
325
336inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
337 if (denm.denm.location_is_present) {
338 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
339 setIsHeadingPresent(denm, true);
340 } else {
341 throw std::invalid_argument("LocationContainer is not present!");
342 }
343}
344
345} // 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 36 of file denm_setters.h.

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

◆ 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 62 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 26 of file denm_setters.h.

26 {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
28}

◆ 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 25 of file denm_setters.h.

26 {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
28}
29

◆ 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 67 of file denm_setters.h.

92inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
93 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
94}
95
102inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
103 if (denm.denm.location_is_present) {
104 denm.denm.location.event_position_heading_is_present = presence_of_heading;
105 } else {
106 throw std::invalid_argument("LocationContainer is not present!");
107 }
108}
109
120inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
121 if (denm.denm.location_is_present) {
122 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
123 setIsHeadingPresent(denm, true);
124 } else {
125 throw std::invalid_argument("LocationContainer is not present!");
126 }
127}
128
129} // 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 118 of file denm_setters.h.

130 {
131
133
135
143inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
144 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
145}
146
153inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
154 if (denm.denm.location_is_present) {
155 denm.denm.location.event_position_heading_is_present = presence_of_heading;
156 } else {
157 throw std::invalid_argument("LocationContainer is not present!");
158 }
159}
160
171inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
172 if (denm.denm.location_is_present) {
173 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
174 setIsHeadingPresent(denm, true);
175 } else {
176 throw std::invalid_argument("LocationContainer is not present!");
177 }
178}
179
180} // 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 79 of file denm_setters.h.

91 {
92
94
96
104inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
105 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
106}
107
114inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
115 if (denm.denm.location_is_present) {
116 denm.denm.location.event_position_heading_is_present = presence_of_heading;
117 } else {
118 throw std::invalid_argument("LocationContainer is not present!");
119 }
120}
121
132inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
133 if (denm.denm.location_is_present) {
134 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
135 setIsHeadingPresent(denm, true);
136 } else {
137 throw std::invalid_argument("LocationContainer is not present!");
138 }
139}
140
141} // 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 395 of file denm_setters.h.

407 {
408
410
412
420inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
421 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
422}
423
430inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
431 if (denm.denm.location_is_present) {
432 denm.denm.location.event_position_heading_is_present = presence_of_heading;
433 } else {
434 throw std::invalid_argument("LocationContainer is not present!");
435 }
436}
437
448inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
449 if (denm.denm.location_is_present) {
450 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
451 setIsHeadingPresent(denm, true);
452 } else {
453 throw std::invalid_argument("LocationContainer is not present!");
454 }
455}
456
457} // 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 468 of file denm_setters.h.

480 {
481
483
485
493inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
494 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
495}
496
503inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
504 if (denm.denm.location_is_present) {
505 denm.denm.location.event_position_heading_is_present = presence_of_heading;
506 } else {
507 throw std::invalid_argument("LocationContainer is not present!");
508 }
509}
510
521inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
522 if (denm.denm.location_is_present) {
523 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
524 setIsHeadingPresent(denm, true);
525 } else {
526 throw std::invalid_argument("LocationContainer is not present!");
527 }
528}
529
530} // 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 51 of file denm_setters.h.

52 : infinity, mapping to HeadingConfidence::UNAVAILABLE)
53 */
54inline 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 232 of file denm_setters.h.

244 {
245
247
249
257inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
258 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
259}
260
267inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
268 if (denm.denm.location_is_present) {
269 denm.denm.location.event_position_heading_is_present = presence_of_heading;
270 } else {
271 throw std::invalid_argument("LocationContainer is not present!");
272 }
273}
274
285inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
286 if (denm.denm.location_is_present) {
287 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
288 setIsHeadingPresent(denm, true);
289 } else {
290 throw std::invalid_argument("LocationContainer is not present!");
291 }
292}
293
294} // 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 23 of file denm_setters.h.

26 {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
28}
29

◆ 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 376 of file denm_setters.h.

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

◆ 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 77 of file denm_setters.h.

89 {
90
92
94
102inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
103 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
104}
105
112inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
113 if (denm.denm.location_is_present) {
114 denm.denm.location.event_position_heading_is_present = presence_of_heading;
115 } else {
116 throw std::invalid_argument("LocationContainer is not present!");
117 }
118}
119
130inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
131 if (denm.denm.location_is_present) {
132 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
133 setIsHeadingPresent(denm, true);
134 } else {
135 throw std::invalid_argument("LocationContainer is not present!");
136 }
137}
138
139} // 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 152 of file denm_setters.h.

164 {
165
167
169
177inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
178 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
179}
180
187inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
206 if (denm.denm.location_is_present) {
207 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
208 setIsHeadingPresent(denm, true);
209 } else {
210 throw std::invalid_argument("LocationContainer is not present!");
211 }
212}
213
214} // 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 133 of file denm_setters.h.

145 {
146
148
150
158inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
159 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
160}
161
168inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
169 if (denm.denm.location_is_present) {
170 denm.denm.location.event_position_heading_is_present = presence_of_heading;
171 } else {
172 throw std::invalid_argument("LocationContainer is not present!");
173 }
174}
175
186inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
187 if (denm.denm.location_is_present) {
188 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
189 setIsHeadingPresent(denm, true);
190 } else {
191 throw std::invalid_argument("LocationContainer is not present!");
192 }
193}
194
195} // 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 121 of file denm_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, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
148}
149
156inline void setIsHeadingPresent(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 setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
175 if (denm.denm.location_is_present) {
176 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
177 setIsHeadingPresent(denm, true);
178 } else {
179 throw std::invalid_argument("LocationContainer is not present!");
180 }
181}
182
183} // 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 28 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 38 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 40 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 53 of file denm_setters.h.

54 {
55 if (denm.denm.location_is_present) {
56 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
57 setIsHeadingPresent(denm, true);
58 } else {
59 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 483 of file denm_setters.h.

495 {
496
498
500
508inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
509 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
510}
511
518inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
519 if (denm.denm.location_is_present) {
520 denm.denm.location.event_position_heading_is_present = presence_of_heading;
521 } else {
522 throw std::invalid_argument("LocationContainer is not present!");
523 }
524}
525
536inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
537 if (denm.denm.location_is_present) {
538 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
539 setIsHeadingPresent(denm, true);
540 } else {
541 throw std::invalid_argument("LocationContainer is not present!");
542 }
543}
544
545} // 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 330 of file denm_setters.h.

342 {
343
345
347
355inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
356 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
357}
358
365inline void setIsHeadingPresent(DENM& denm, bool presence_of_heading) {
366 if (denm.denm.location_is_present) {
367 denm.denm.location.event_position_heading_is_present = presence_of_heading;
368 } else {
369 throw std::invalid_argument("LocationContainer is not present!");
370 }
371}
372
383inline void setHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
384 if (denm.denm.location_is_present) {
385 setHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
386 setIsHeadingPresent(denm, true);
387 } else {
388 throw std::invalid_argument("LocationContainer is not present!");
389 }
390}
391
392} // 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 35 of file denm_setters.h.

36 {
37 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 24 of file denm_setters.h.

26 {
27 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
28}