etsi_its_messages 2.4.0
Loading...
Searching...
No Matches
cam_setters.h File Reference

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

Go to the source code of this file.

Functions

template<typename T1 , typename T2 >
void etsi_its_cam_msgs::access::throwIfOutOfRange (const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
 
uint16_t etsi_its_cam_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 (const uint64_t unix_seconds)
 Get the leap second insertions since 2004 for given unix seconds.
 
void etsi_its_cam_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.end() ->second)
 Set the TimestampITS object.
 
void etsi_its_cam_msgs::access::setLatitude (Latitude &latitude, const double deg)
 Set the Latitude object.
 
void etsi_its_cam_msgs::access::setLongitude (Longitude &longitude, const double deg)
 Set the Longitude object.
 
void etsi_its_cam_msgs::access::setAltitudeValue (AltitudeValue &altitude, const double value)
 Set the AltitudeValue object.
 
void etsi_its_cam_msgs::access::setAltitude (Altitude &altitude, const double value)
 Set the Altitude object.
 
void etsi_its_cam_msgs::access::setSpeedValue (SpeedValue &speed, const double value)
 Set the SpeedValue object.
 
void etsi_its_cam_msgs::access::setSpeed (Speed &speed, const double value)
 Set the Speed object.
 
template<typename T >
void etsi_its_cam_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_cam_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 T >
void etsi_its_cam_msgs::access::setBitString (T &bitstring, const std::vector< bool > &bits)
 Set a Bit String by a vector of bools.
 
void etsi_its_cam_msgs::access::setStationId (StationID &station_id, const uint32_t id_value)
 Set the Station Id object.
 
void etsi_its_cam_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.
 
void etsi_its_cam_msgs::access::setStationType (StationType &station_type, const uint8_t value)
 Set the Station Type.
 
void etsi_its_cam_msgs::access::setItsPduHeader (CAM &cam, const uint32_t station_id, const uint8_t protocol_version=0)
 Set the ItsPduHeader-object for a CAM.
 
void etsi_its_cam_msgs::access::setLongitudinalAccelerationValue (LongitudinalAccelerationValue &accel, const double value)
 Set the LongitudinalAccelerationValue object.
 
void etsi_its_cam_msgs::access::setLongitudinalAcceleration (LongitudinalAcceleration &accel, const double value)
 Set the LongitudinalAcceleration object.
 
void etsi_its_cam_msgs::access::setLateralAccelerationValue (LateralAccelerationValue &accel, const double value)
 Set the LateralAccelerationValue object.
 
void etsi_its_cam_msgs::access::setLateralAcceleration (LateralAcceleration &accel, const double value)
 Set the LateralAcceleration object.
 
void etsi_its_cam_msgs::access::setGenerationDeltaTime (GenerationDeltaTime &generation_delta_time, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
 Set the GenerationDeltaTime-Value.
 
void etsi_its_cam_msgs::access::setGenerationDeltaTime (CAM &cam, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
 Set the Generation Delta Time object.
 
void etsi_its_cam_msgs::access::setStationType (CAM &cam, const uint8_t value)
 Set the StationType for a CAM.
 
void etsi_its_cam_msgs::access::setHeadingValue (HeadingValue &heading, const double value)
 Set the HeadingValue object.
 
void etsi_its_cam_msgs::access::setHeading (Heading &heading, const double value)
 Set the Heading object.
 
void etsi_its_cam_msgs::access::setHeading (CAM &cam, const double heading_val)
 Set the Heading for a CAM.
 
void etsi_its_cam_msgs::access::setVehicleWidth (VehicleWidth &vehicle_width, const double value)
 Set the VehicleWidth object.
 
void etsi_its_cam_msgs::access::setVehicleLengthValue (VehicleLengthValue &vehicle_length, const double value)
 Set the VehicleLengthValue object.
 
void etsi_its_cam_msgs::access::setVehicleLength (VehicleLength &vehicle_length, const double value)
 Set the VehicleLength object.
 
void etsi_its_cam_msgs::access::setVehicleDimensions (CAM &cam, const double vehicle_length, const double vehicle_width)
 Set the vehicle dimensions.
 
void etsi_its_cam_msgs::access::setSpeed (CAM &cam, const double speed_val)
 Set the vehicle speed.
 
void etsi_its_cam_msgs::access::setLongitudinalAcceleration (CAM &cam, const double lon_accel)
 Set the longitudinal acceleration.
 
void etsi_its_cam_msgs::access::setLateralAcceleration (CAM &cam, const double lat_accel)
 Set the lateral acceleration.
 
void etsi_its_cam_msgs::access::setReferencePosition (CAM &cam, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
 Set the ReferencePosition for a CAM.
 
void etsi_its_cam_msgs::access::setFromUTMPosition (CAM &cam, const gm::PointStamped &utm_position, const int &zone, const bool &northp)
 Set the ReferencePosition of a CAM from a given UTM-Position.
 
void etsi_its_cam_msgs::access::setExteriorLights (ExteriorLights &exterior_lights, const std::vector< bool > &bits)
 Set the Exterior Lights by a vector of bools.
 
void etsi_its_cam_msgs::access::setExteriorLights (CAM &cam, const std::vector< bool > &exterior_lights)
 Set the Exterior Lights by using a vector of bools.
 
void etsi_its_cam_msgs::access::setAccelerationControl (AccelerationControl &acceleration_control, const std::vector< bool > &bits)
 Set the Acceleration Control by a vector of bools.
 
void etsi_its_cam_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_cam_msgs::access::setSpecialTransportType (SpecialTransportType &special_transport_type, const std::vector< bool > &bits)
 Set the Special Transport Type by a vector of bools.
 
void etsi_its_cam_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_cam_msgs::access::setEmergencyPriority (EmergencyPriority &emergency_priority, const std::vector< bool > &bits)
 Set the Emergency Priority by a vector of bools.
 

Detailed Description

Setter functions for the ETSI ITS CAM (EN)

Definition in file cam_setters.h.

Function Documentation

◆ getLeapSecondInsertionsSince2004()

uint16_t etsi_its_cam_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 cam_access.h.

114 {
116}
Utility functions for the ETSI ITS CAM (EN and TS)

◆ setAccelerationControl()

void etsi_its_cam_msgs::access::setAccelerationControl ( AccelerationControl & acceleration_control,
const std::vector< bool > & bits )
inline

Set the Acceleration Control by a vector of bools.

Parameters
acceleration_control
bits

Definition at line 316 of file cam_setters.h.

◆ setAltitude()

void etsi_its_cam_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 140 of file cam_setters.h.

175 {
176
178
186inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
187 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
188}
189
196inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
197 int64_t accel_val = (int64_t)std::round(value * 1e1);
198 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
199 accel.value = accel_val;
200 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
201 accel.value = LongitudinalAccelerationValue::MIN;
202 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
203 accel.value = LongitudinalAccelerationValue::MAX - 1;
204 }
205}
206
215inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
216 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
217 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
218}
219
226inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
227 int64_t accel_val = (int64_t)std::round(value * 1e1);
228 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
229 accel.value = accel_val;
230 } else if (accel_val < LateralAccelerationValue::MIN) {
231 accel.value = LateralAccelerationValue::MIN;
232 } else if (accel_val > LateralAccelerationValue::MAX) {
233 accel.value = LateralAccelerationValue::MAX - 1;
234 }
235}
236
245inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
246 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
247 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
248}
249
251
252} // namespace etsi_its_cam_msgs::access
Common setter functions for the ETSI ITS CAM (EN and TS)
void setLongitudinalAcceleration(CAM &cam, const double lon_accel)
Set the longitudinal acceleration.
void setLateralAcceleration(CAM &cam, const double lat_accel)
Set the lateral acceleration.
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
void setItsPduHeader(ItsPduHeader &header, const uint8_t message_id, const uint32_t station_id, const uint8_t protocol_version=0)
Set the Its Pdu Header object.
void setLateralAccelerationValue(AccelerationValue &accel, const double value)
Set the LateralAccelerationValue object.
void setLongitudinalAccelerationValue(AccelerationValue &accel, const double value)
Set the LongitudinalAccelerationValue object.

◆ setAltitudeValue()

void etsi_its_cam_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 121 of file cam_setters.h.

156 {
157
159
167inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
168 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
169}
170
177inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
178 int64_t accel_val = (int64_t)std::round(value * 1e1);
179 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
180 accel.value = accel_val;
181 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
182 accel.value = LongitudinalAccelerationValue::MIN;
183 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
184 accel.value = LongitudinalAccelerationValue::MAX - 1;
185 }
186}
187
196inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
197 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
198 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
199}
200
207inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
208 int64_t accel_val = (int64_t)std::round(value * 1e1);
209 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
210 accel.value = accel_val;
211 } else if (accel_val < LateralAccelerationValue::MIN) {
212 accel.value = LateralAccelerationValue::MIN;
213 } else if (accel_val > LateralAccelerationValue::MAX) {
214 accel.value = LateralAccelerationValue::MAX - 1;
215 }
216}
217
226inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
227 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
228 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
229}
230
232
233} // namespace etsi_its_cam_msgs::access

◆ setBitString()

template<typename T >
void etsi_its_cam_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 232 of file cam_setters.h.

267 {
268
270
278inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
279 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
280}
281
288inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
289 int64_t accel_val = (int64_t)std::round(value * 1e1);
290 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
291 accel.value = accel_val;
292 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
293 accel.value = LongitudinalAccelerationValue::MIN;
294 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
295 accel.value = LongitudinalAccelerationValue::MAX - 1;
296 }
297}
298
307inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
308 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
309 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
310}
311
318inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
319 int64_t accel_val = (int64_t)std::round(value * 1e1);
320 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
321 accel.value = accel_val;
322 } else if (accel_val < LateralAccelerationValue::MIN) {
323 accel.value = LateralAccelerationValue::MIN;
324 } else if (accel_val > LateralAccelerationValue::MAX) {
325 accel.value = LateralAccelerationValue::MAX - 1;
326 }
327}
328
337inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
338 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
339 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
340}
341
343
344} // namespace etsi_its_cam_msgs::access

◆ setDrivingLaneStatus()

void etsi_its_cam_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 326 of file cam_setters.h.

361 {
362
364
372inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
373 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
374}
375
382inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
383 int64_t accel_val = (int64_t)std::round(value * 1e1);
384 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
385 accel.value = accel_val;
386 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
387 accel.value = LongitudinalAccelerationValue::MIN;
388 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
389 accel.value = LongitudinalAccelerationValue::MAX - 1;
390 }
391}
392
401inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
402 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
403 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
404}
405
412inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
413 int64_t accel_val = (int64_t)std::round(value * 1e1);
414 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
415 accel.value = accel_val;
416 } else if (accel_val < LateralAccelerationValue::MIN) {
417 accel.value = LateralAccelerationValue::MIN;
418 } else if (accel_val > LateralAccelerationValue::MAX) {
419 accel.value = LateralAccelerationValue::MAX - 1;
420 }
421}
422
431inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
432 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
433 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
434}
435
437
438} // namespace etsi_its_cam_msgs::access

◆ setEmergencyPriority()

void etsi_its_cam_msgs::access::setEmergencyPriority ( EmergencyPriority & emergency_priority,
const std::vector< bool > & bits )
inline

Set the Emergency Priority by a vector of bools.

Parameters
emergency_priority
bits

Definition at line 356 of file cam_setters.h.

391 {
392
394
402inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
403 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
404}
405
412inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
413 int64_t accel_val = (int64_t)std::round(value * 1e1);
414 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
415 accel.value = accel_val;
416 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
417 accel.value = LongitudinalAccelerationValue::MIN;
418 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
419 accel.value = LongitudinalAccelerationValue::MAX - 1;
420 }
421}
422
431inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
432 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
433 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
434}
435
442inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
443 int64_t accel_val = (int64_t)std::round(value * 1e1);
444 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
445 accel.value = accel_val;
446 } else if (accel_val < LateralAccelerationValue::MIN) {
447 accel.value = LateralAccelerationValue::MIN;
448 } else if (accel_val > LateralAccelerationValue::MAX) {
449 accel.value = LateralAccelerationValue::MAX - 1;
450 }
451}
452
461inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
462 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
463 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
464}
465
467
468} // namespace etsi_its_cam_msgs::access

◆ setExteriorLights() [1/2]

void etsi_its_cam_msgs::access::setExteriorLights ( CAM & cam,
const std::vector< bool > & exterior_lights )
inline

Set the Exterior Lights by using a vector of bools.

Parameters
camCAM to set the exterior lights
exterior_lightsvector of bools to set the exterior lights

Definition at line 291 of file cam_setters.h.

326 {
327
329
337inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
338 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
339}
340
347inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
348 int64_t accel_val = (int64_t)std::round(value * 1e1);
349 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
350 accel.value = accel_val;
351 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
352 accel.value = LongitudinalAccelerationValue::MIN;
353 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
354 accel.value = LongitudinalAccelerationValue::MAX - 1;
355 }
356}
357
366inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
367 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
368 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
369}
370
377inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
378 int64_t accel_val = (int64_t)std::round(value * 1e1);
379 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
380 accel.value = accel_val;
381 } else if (accel_val < LateralAccelerationValue::MIN) {
382 accel.value = LateralAccelerationValue::MIN;
383 } else if (accel_val > LateralAccelerationValue::MAX) {
384 accel.value = LateralAccelerationValue::MAX - 1;
385 }
386}
387
396inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
397 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
398 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
399}
400
402
403} // namespace etsi_its_cam_msgs::access

◆ setExteriorLights() [2/2]

void etsi_its_cam_msgs::access::setExteriorLights ( ExteriorLights & exterior_lights,
const std::vector< bool > & bits )
inline

Set the Exterior Lights by a vector of bools.

Parameters
exterior_lights
bits

Definition at line 281 of file cam_setters.h.

316 {
317
319
327inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
328 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
329}
330
337inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
338 int64_t accel_val = (int64_t)std::round(value * 1e1);
339 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
340 accel.value = accel_val;
341 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
342 accel.value = LongitudinalAccelerationValue::MIN;
343 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
344 accel.value = LongitudinalAccelerationValue::MAX - 1;
345 }
346}
347
356inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
357 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
358 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
359}
360
367inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
368 int64_t accel_val = (int64_t)std::round(value * 1e1);
369 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
370 accel.value = accel_val;
371 } else if (accel_val < LateralAccelerationValue::MIN) {
372 accel.value = LateralAccelerationValue::MIN;
373 } else if (accel_val > LateralAccelerationValue::MAX) {
374 accel.value = LateralAccelerationValue::MAX - 1;
375 }
376}
377
386inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
387 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
388 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
389}
390
392
393} // namespace etsi_its_cam_msgs::access

◆ setFromUTMPosition() [1/2]

void etsi_its_cam_msgs::access::setFromUTMPosition ( CAM & cam,
const gm::PointStamped & utm_position,
const int & zone,
const bool & northp )
inline

Set the ReferencePosition of a CAM 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]camCAM 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 271 of file cam_setters.h.

306 {
307
309
317inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
318 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
319}
320
327inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
328 int64_t accel_val = (int64_t)std::round(value * 1e1);
329 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
330 accel.value = accel_val;
331 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
332 accel.value = LongitudinalAccelerationValue::MIN;
333 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
334 accel.value = LongitudinalAccelerationValue::MAX - 1;
335 }
336}
337
346inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
347 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
348 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
349}
350
357inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
358 int64_t accel_val = (int64_t)std::round(value * 1e1);
359 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
360 accel.value = accel_val;
361 } else if (accel_val < LateralAccelerationValue::MIN) {
362 accel.value = LateralAccelerationValue::MIN;
363 } else if (accel_val > LateralAccelerationValue::MAX) {
364 accel.value = LateralAccelerationValue::MAX - 1;
365 }
366}
367
376inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
377 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
378 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
379}
380
382
383} // namespace etsi_its_cam_msgs::access

◆ setFromUTMPosition() [2/2]

template<typename T >
void etsi_its_cam_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 208 of file cam_setters.h.

243 {
244
246
254inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
255 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
256}
257
264inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
265 int64_t accel_val = (int64_t)std::round(value * 1e1);
266 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
267 accel.value = accel_val;
268 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
269 accel.value = LongitudinalAccelerationValue::MIN;
270 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
271 accel.value = LongitudinalAccelerationValue::MAX - 1;
272 }
273}
274
283inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
284 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
285 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
286}
287
294inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
295 int64_t accel_val = (int64_t)std::round(value * 1e1);
296 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
297 accel.value = accel_val;
298 } else if (accel_val < LateralAccelerationValue::MIN) {
299 accel.value = LateralAccelerationValue::MIN;
300 } else if (accel_val > LateralAccelerationValue::MAX) {
301 accel.value = LateralAccelerationValue::MAX - 1;
302 }
303}
304
313inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
314 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
315 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
316}
317
319
320} // namespace etsi_its_cam_msgs::access

◆ setGenerationDeltaTime() [1/2]

void etsi_its_cam_msgs::access::setGenerationDeltaTime ( CAM & cam,
const uint64_t unix_nanosecs,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second )
inline

Set the Generation Delta Time object.

Parameters
camCAM to set the GenerationDeltaTime-Value for
unix_nanosecsTimestamp in unix-nanoseconds to set the GenerationDeltaTime-Value from
n_leap_secondsNumber of leap seconds since 2004 for the given timestamp (Default: etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second)

Definition at line 97 of file cam_setters.h.

◆ setGenerationDeltaTime() [2/2]

void etsi_its_cam_msgs::access::setGenerationDeltaTime ( GenerationDeltaTime & generation_delta_time,
const uint64_t unix_nanosecs,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second )
inline

Set the GenerationDeltaTime-Value.

Parameters
generation_delta_timeGenerationDeltaTime to set the GenerationDeltaTime-Value for
unix_nanosecsTimestamp in unix-nanoseconds to set the GenerationDeltaTime-Value from
n_leap_secondsNumber of leap seconds since 2004 for the given timestamp (Default: etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second)

Definition at line 80 of file cam_setters.h.

87 {
88 int64_t accel_val = (int64_t)std::round(value * 1e1);

◆ setHeading() [1/2]

void etsi_its_cam_msgs::access::setHeading ( CAM & cam,
const double heading_val )
inline

Set the Heading for a CAM.

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
camCAM to set the ReferencePosition
valueHeading value in degree as decimal number

Definition at line 150 of file cam_setters.h.

185 {
186
188
196inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
197 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
198}
199
206inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
207 int64_t accel_val = (int64_t)std::round(value * 1e1);
208 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
209 accel.value = accel_val;
210 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
211 accel.value = LongitudinalAccelerationValue::MIN;
212 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
213 accel.value = LongitudinalAccelerationValue::MAX - 1;
214 }
215}
216
225inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
226 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
227 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
228}
229
236inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
237 int64_t accel_val = (int64_t)std::round(value * 1e1);
238 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
239 accel.value = accel_val;
240 } else if (accel_val < LateralAccelerationValue::MIN) {
241 accel.value = LateralAccelerationValue::MIN;
242 } else if (accel_val > LateralAccelerationValue::MAX) {
243 accel.value = LateralAccelerationValue::MAX - 1;
244 }
245}
246
255inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
256 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
257 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
258}
259
261
262} // namespace etsi_its_cam_msgs::access

◆ setHeading() [2/2]

void etsi_its_cam_msgs::access::setHeading ( Heading & heading,
const double value )
inline

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

Definition at line 136 of file cam_setters.h.

171 {
172
174
182inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
183 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
184}
185
192inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
193 int64_t accel_val = (int64_t)std::round(value * 1e1);
194 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
195 accel.value = accel_val;
196 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
197 accel.value = LongitudinalAccelerationValue::MIN;
198 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
199 accel.value = LongitudinalAccelerationValue::MAX - 1;
200 }
201}
202
211inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
212 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
213 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
214}
215
222inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
223 int64_t accel_val = (int64_t)std::round(value * 1e1);
224 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
225 accel.value = accel_val;
226 } else if (accel_val < LateralAccelerationValue::MIN) {
227 accel.value = LateralAccelerationValue::MIN;
228 } else if (accel_val > LateralAccelerationValue::MAX) {
229 accel.value = LateralAccelerationValue::MAX - 1;
230 }
231}
232
241inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
242 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
243 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
244}
245
247
248} // namespace etsi_its_cam_msgs::access

◆ setHeadingValue()

void etsi_its_cam_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 121 of file cam_setters.h.

156 {
157
159
167inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
168 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
169}
170
177inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
178 int64_t accel_val = (int64_t)std::round(value * 1e1);
179 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
180 accel.value = accel_val;
181 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
182 accel.value = LongitudinalAccelerationValue::MIN;
183 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
184 accel.value = LongitudinalAccelerationValue::MAX - 1;
185 }
186}
187
196inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
197 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
198 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
199}
200
207inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
208 int64_t accel_val = (int64_t)std::round(value * 1e1);
209 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
210 accel.value = accel_val;
211 } else if (accel_val < LateralAccelerationValue::MIN) {
212 accel.value = LateralAccelerationValue::MIN;
213 } else if (accel_val > LateralAccelerationValue::MAX) {
214 accel.value = LateralAccelerationValue::MAX - 1;
215 }
216}
217
226inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
227 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
228 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
229}
230
232
233} // namespace etsi_its_cam_msgs::access

◆ setItsPduHeader() [1/2]

void etsi_its_cam_msgs::access::setItsPduHeader ( CAM & cam,
const uint32_t station_id,
const uint8_t protocol_version = 0 )
inline

Set the ItsPduHeader-object for a CAM.

Parameters
camCAM-Message to set the ItsPduHeader
station_id
protocol_version

Definition at line 96 of file cam_setters.h.

◆ setItsPduHeader() [2/2]

void etsi_its_cam_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 66 of file cam_setters.h.

◆ setLateralAcceleration() [1/2]

void etsi_its_cam_msgs::access::setLateralAcceleration ( CAM & cam,
const double lat_accel )
inline

Set the lateral acceleration.

Parameters
camCAM to set the acceleration value s
lat_accellateral acceleration to set in m/s^2 as decimal number (left is positiv), if not available use 16.1 m/s^2

Definition at line 235 of file cam_setters.h.

270 {
271
273
281inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
282 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
283}
284
291inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
292 int64_t accel_val = (int64_t)std::round(value * 1e1);
293 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
294 accel.value = accel_val;
295 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
296 accel.value = LongitudinalAccelerationValue::MIN;
297 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
298 accel.value = LongitudinalAccelerationValue::MAX - 1;
299 }
300}
301
310inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
311 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
312 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
313}
314
321inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
322 int64_t accel_val = (int64_t)std::round(value * 1e1);
323 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
324 accel.value = accel_val;
325 } else if (accel_val < LateralAccelerationValue::MIN) {
326 accel.value = LateralAccelerationValue::MIN;
327 } else if (accel_val > LateralAccelerationValue::MAX) {
328 accel.value = LateralAccelerationValue::MAX - 1;
329 }
330}
331
340inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
341 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
342 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
343}
344
346
347} // namespace etsi_its_cam_msgs::access

◆ setLateralAcceleration() [2/2]

void etsi_its_cam_msgs::access::setLateralAcceleration ( LateralAcceleration & accel,
const double value )
inline

Set the LateralAcceleration object.

AccelerationConfidence is set to UNAVAILABLE

Parameters
accelobject to set
valueLaterallAccelerationValue in m/s^2 as decimal number (left is positive)

Definition at line 155 of file cam_setters.h.

190 {
191
193
201inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
202 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
203}
204
211inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
212 int64_t accel_val = (int64_t)std::round(value * 1e1);
213 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
214 accel.value = accel_val;
215 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
216 accel.value = LongitudinalAccelerationValue::MIN;
217 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
218 accel.value = LongitudinalAccelerationValue::MAX - 1;
219 }
220}
221
230inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
231 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
232 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
233}
234
241inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
242 int64_t accel_val = (int64_t)std::round(value * 1e1);
243 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
244 accel.value = accel_val;
245 } else if (accel_val < LateralAccelerationValue::MIN) {
246 accel.value = LateralAccelerationValue::MIN;
247 } else if (accel_val > LateralAccelerationValue::MAX) {
248 accel.value = LateralAccelerationValue::MAX - 1;
249 }
250}
251
260inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
261 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
262 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
263}
264
266
267} // namespace etsi_its_cam_msgs::access

◆ setLateralAccelerationValue()

void etsi_its_cam_msgs::access::setLateralAccelerationValue ( LateralAccelerationValue & accel,
const double value )
inline

Set the LateralAccelerationValue object.

Parameters
accelobject to set
valueLateralAccelerationValue in m/s^2 as decimal number (left is positive)

Definition at line 136 of file cam_setters.h.

171 {
172
174
182inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
183 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
184}
185
192inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
193 int64_t accel_val = (int64_t)std::round(value * 1e1);
194 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
195 accel.value = accel_val;
196 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
197 accel.value = LongitudinalAccelerationValue::MIN;
198 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
199 accel.value = LongitudinalAccelerationValue::MAX - 1;
200 }
201}
202
211inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
212 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
213 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
214}
215
222inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
223 int64_t accel_val = (int64_t)std::round(value * 1e1);
224 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
225 accel.value = accel_val;
226 } else if (accel_val < LateralAccelerationValue::MIN) {
227 accel.value = LateralAccelerationValue::MIN;
228 } else if (accel_val > LateralAccelerationValue::MAX) {
229 accel.value = LateralAccelerationValue::MAX - 1;
230 }
231}
232
241inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
242 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
243 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
244}
245
247
248} // namespace etsi_its_cam_msgs::access

◆ setLatitude()

void etsi_its_cam_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 97 of file cam_setters.h.

◆ setLightBarSirenInUse()

void etsi_its_cam_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 346 of file cam_setters.h.

381 {
382
384
392inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
393 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
394}
395
402inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
403 int64_t accel_val = (int64_t)std::round(value * 1e1);
404 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
405 accel.value = accel_val;
406 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
407 accel.value = LongitudinalAccelerationValue::MIN;
408 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
409 accel.value = LongitudinalAccelerationValue::MAX - 1;
410 }
411}
412
421inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
422 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
423 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
424}
425
432inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
433 int64_t accel_val = (int64_t)std::round(value * 1e1);
434 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
435 accel.value = accel_val;
436 } else if (accel_val < LateralAccelerationValue::MIN) {
437 accel.value = LateralAccelerationValue::MIN;
438 } else if (accel_val > LateralAccelerationValue::MAX) {
439 accel.value = LateralAccelerationValue::MAX - 1;
440 }
441}
442
451inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
452 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
453 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
454}
455
457
458} // namespace etsi_its_cam_msgs::access

◆ setLongitude()

void etsi_its_cam_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 109 of file cam_setters.h.

◆ setLongitudinalAcceleration() [1/2]

void etsi_its_cam_msgs::access::setLongitudinalAcceleration ( CAM & cam,
const double lon_accel )
inline

Set the longitudinal acceleration.

Parameters
camCAM to set the acceleration value s
lon_accellongitudinal acceleration to set in m/s^2 as decimal number (braking is negative), if not available use 16.1 m/s^2

Definition at line 223 of file cam_setters.h.

258 {
259
261
269inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
270 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
271}
272
279inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
280 int64_t accel_val = (int64_t)std::round(value * 1e1);
281 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
282 accel.value = accel_val;
283 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
284 accel.value = LongitudinalAccelerationValue::MIN;
285 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
286 accel.value = LongitudinalAccelerationValue::MAX - 1;
287 }
288}
289
298inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
299 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
300 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
301}
302
309inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
310 int64_t accel_val = (int64_t)std::round(value * 1e1);
311 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
312 accel.value = accel_val;
313 } else if (accel_val < LateralAccelerationValue::MIN) {
314 accel.value = LateralAccelerationValue::MIN;
315 } else if (accel_val > LateralAccelerationValue::MAX) {
316 accel.value = LateralAccelerationValue::MAX - 1;
317 }
318}
319
328inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
329 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
330 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
331}
332
334
335} // namespace etsi_its_cam_msgs::access

◆ setLongitudinalAcceleration() [2/2]

void etsi_its_cam_msgs::access::setLongitudinalAcceleration ( LongitudinalAcceleration & accel,
const double value )
inline

Set the LongitudinalAcceleration object.

AccelerationConfidence is set to UNAVAILABLE

Parameters
accelobject to set
valueLongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative)

Definition at line 125 of file cam_setters.h.

160 {
161
163
171inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
172 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
173}
174
181inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
182 int64_t accel_val = (int64_t)std::round(value * 1e1);
183 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
184 accel.value = accel_val;
185 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
186 accel.value = LongitudinalAccelerationValue::MIN;
187 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
188 accel.value = LongitudinalAccelerationValue::MAX - 1;
189 }
190}
191
200inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
201 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
202 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
203}
204
211inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
212 int64_t accel_val = (int64_t)std::round(value * 1e1);
213 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
214 accel.value = accel_val;
215 } else if (accel_val < LateralAccelerationValue::MIN) {
216 accel.value = LateralAccelerationValue::MIN;
217 } else if (accel_val > LateralAccelerationValue::MAX) {
218 accel.value = LateralAccelerationValue::MAX - 1;
219 }
220}
221
230inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
231 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
232 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
233}
234
236
237} // namespace etsi_its_cam_msgs::access

◆ setLongitudinalAccelerationValue()

void etsi_its_cam_msgs::access::setLongitudinalAccelerationValue ( LongitudinalAccelerationValue & accel,
const double value )
inline

Set the LongitudinalAccelerationValue object.

Parameters
accelobject to set
valueLongitudinalAccelerationValue in m/s^2 as decimal number (braking is negative)

Definition at line 106 of file cam_setters.h.

106 {
107 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
108 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
109}
110
112
113} // namespace etsi_its_cam_msgs::access

◆ setReferencePosition() [1/2]

void etsi_its_cam_msgs::access::setReferencePosition ( CAM & cam,
const double latitude,
const double longitude,
const double altitude = AltitudeValue::UNAVAILABLE )
inline

Set the ReferencePosition for a CAM.

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

Parameters
camCAM 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 254 of file cam_setters.h.

289 {
290
292
300inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
301 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
302}
303
310inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
311 int64_t accel_val = (int64_t)std::round(value * 1e1);
312 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
313 accel.value = accel_val;
314 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
315 accel.value = LongitudinalAccelerationValue::MIN;
316 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
317 accel.value = LongitudinalAccelerationValue::MAX - 1;
318 }
319}
320
329inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
330 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
331 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
332}
333
340inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
341 int64_t accel_val = (int64_t)std::round(value * 1e1);
342 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
343 accel.value = accel_val;
344 } else if (accel_val < LateralAccelerationValue::MIN) {
345 accel.value = LateralAccelerationValue::MIN;
346 } else if (accel_val > LateralAccelerationValue::MAX) {
347 accel.value = LateralAccelerationValue::MAX - 1;
348 }
349}
350
359inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
360 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
361 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
362}
363
365
366} // namespace etsi_its_cam_msgs::access

◆ setReferencePosition() [2/2]

template<typename T >
void etsi_its_cam_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 182 of file cam_setters.h.

217 {
218
220
228inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
229 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
230}
231
238inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
239 int64_t accel_val = (int64_t)std::round(value * 1e1);
240 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
241 accel.value = accel_val;
242 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
243 accel.value = LongitudinalAccelerationValue::MIN;
244 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
245 accel.value = LongitudinalAccelerationValue::MAX - 1;
246 }
247}
248
257inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
258 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
259 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
260}
261
268inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
269 int64_t accel_val = (int64_t)std::round(value * 1e1);
270 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
271 accel.value = accel_val;
272 } else if (accel_val < LateralAccelerationValue::MIN) {
273 accel.value = LateralAccelerationValue::MIN;
274 } else if (accel_val > LateralAccelerationValue::MAX) {
275 accel.value = LateralAccelerationValue::MAX - 1;
276 }
277}
278
287inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
288 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
289 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
290}
291
293
294} // namespace etsi_its_cam_msgs::access

◆ setSpecialTransportType()

void etsi_its_cam_msgs::access::setSpecialTransportType ( SpecialTransportType & special_transport_type,
const std::vector< bool > & bits )
inline

Set the Special Transport Type by a vector of bools.

Parameters
special_transport_type
bits

Definition at line 336 of file cam_setters.h.

371 {
372
374
382inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
383 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
384}
385
392inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
393 int64_t accel_val = (int64_t)std::round(value * 1e1);
394 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
395 accel.value = accel_val;
396 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
397 accel.value = LongitudinalAccelerationValue::MIN;
398 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
399 accel.value = LongitudinalAccelerationValue::MAX - 1;
400 }
401}
402
411inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
412 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
413 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
414}
415
422inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
423 int64_t accel_val = (int64_t)std::round(value * 1e1);
424 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
425 accel.value = accel_val;
426 } else if (accel_val < LateralAccelerationValue::MIN) {
427 accel.value = LateralAccelerationValue::MIN;
428 } else if (accel_val > LateralAccelerationValue::MAX) {
429 accel.value = LateralAccelerationValue::MAX - 1;
430 }
431}
432
441inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
442 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
443 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
444}
445
447
448} // namespace etsi_its_cam_msgs::access

◆ setSpeed() [1/2]

void etsi_its_cam_msgs::access::setSpeed ( CAM & cam,
const double speed_val )
inline

Set the vehicle speed.

Parameters
camCAM to set the speed value
speed_valspeed value to set in m/s as decimal number

Definition at line 213 of file cam_setters.h.

248 {
249
251
259inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
260 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
261}
262
269inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
270 int64_t accel_val = (int64_t)std::round(value * 1e1);
271 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
272 accel.value = accel_val;
273 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
274 accel.value = LongitudinalAccelerationValue::MIN;
275 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
276 accel.value = LongitudinalAccelerationValue::MAX - 1;
277 }
278}
279
288inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
289 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
290 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
291}
292
299inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
300 int64_t accel_val = (int64_t)std::round(value * 1e1);
301 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
302 accel.value = accel_val;
303 } else if (accel_val < LateralAccelerationValue::MIN) {
304 accel.value = LateralAccelerationValue::MIN;
305 } else if (accel_val > LateralAccelerationValue::MAX) {
306 accel.value = LateralAccelerationValue::MAX - 1;
307 }
308}
309
318inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
319 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
320 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
321}
322
324
325} // namespace etsi_its_cam_msgs::access

◆ setSpeed() [2/2]

void etsi_its_cam_msgs::access::setSpeed ( Speed & speed,
const double value )
inline

Set the Speed object.

SpeedConfidence is set to UNAVAILABLE

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

Definition at line 165 of file cam_setters.h.

200 {
201
203
211inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
212 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
213}
214
221inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
222 int64_t accel_val = (int64_t)std::round(value * 1e1);
223 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
224 accel.value = accel_val;
225 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
226 accel.value = LongitudinalAccelerationValue::MIN;
227 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
228 accel.value = LongitudinalAccelerationValue::MAX - 1;
229 }
230}
231
240inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
241 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
242 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
243}
244
251inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
252 int64_t accel_val = (int64_t)std::round(value * 1e1);
253 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
254 accel.value = accel_val;
255 } else if (accel_val < LateralAccelerationValue::MIN) {
256 accel.value = LateralAccelerationValue::MIN;
257 } else if (accel_val > LateralAccelerationValue::MAX) {
258 accel.value = LateralAccelerationValue::MAX - 1;
259 }
260}
261
270inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
271 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
272 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
273}
274
276
277} // namespace etsi_its_cam_msgs::access

◆ setSpeedValue()

void etsi_its_cam_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 151 of file cam_setters.h.

186 {
187
189
197inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
198 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
199}
200
207inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
208 int64_t accel_val = (int64_t)std::round(value * 1e1);
209 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
210 accel.value = accel_val;
211 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
212 accel.value = LongitudinalAccelerationValue::MIN;
213 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
214 accel.value = LongitudinalAccelerationValue::MAX - 1;
215 }
216}
217
226inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
227 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
228 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
229}
230
237inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
238 int64_t accel_val = (int64_t)std::round(value * 1e1);
239 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
240 accel.value = accel_val;
241 } else if (accel_val < LateralAccelerationValue::MIN) {
242 accel.value = LateralAccelerationValue::MIN;
243 } else if (accel_val > LateralAccelerationValue::MAX) {
244 accel.value = LateralAccelerationValue::MAX - 1;
245 }
246}
247
256inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
257 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
258 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
259}
260
262
263} // namespace etsi_its_cam_msgs::access

◆ setStationId()

void etsi_its_cam_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 53 of file cam_setters.h.

◆ setStationType() [1/2]

void etsi_its_cam_msgs::access::setStationType ( CAM & cam,
const uint8_t value )
inline

Set the StationType for a CAM.

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

Definition at line 109 of file cam_setters.h.

◆ setStationType() [2/2]

void etsi_its_cam_msgs::access::setStationType ( StationType & station_type,
const uint8_t value )
inline

Set the Station Type.

Parameters
station_type
value

Definition at line 82 of file cam_setters.h.

◆ setTimestampITS()

void etsi_its_cam_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.end()->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. (Default: etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second)
[in]epoch_offsetUnix-Timestamp in seconds for the 01.01.2004 at 00:00:00

Definition at line 83 of file cam_setters.h.

87 {
88 int64_t accel_val = (int64_t)std::round(value * 1e1);
89 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {

◆ setVehicleDimensions()

void etsi_its_cam_msgs::access::setVehicleDimensions ( CAM & cam,
const double vehicle_length,
const double vehicle_width )
inline

Set the vehicle dimensions.

Parameters
camCAM to set the vehicle dimensions
vehicle_lengthvehicle length in meter as decimal number
vehicle_widthvehicle width in meter as decimal number

Definition at line 199 of file cam_setters.h.

234 {
235
237
245inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
246 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
247}
248
255inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
256 int64_t accel_val = (int64_t)std::round(value * 1e1);
257 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
258 accel.value = accel_val;
259 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
260 accel.value = LongitudinalAccelerationValue::MIN;
261 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
262 accel.value = LongitudinalAccelerationValue::MAX - 1;
263 }
264}
265
274inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
275 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
276 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
277}
278
285inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
286 int64_t accel_val = (int64_t)std::round(value * 1e1);
287 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
288 accel.value = accel_val;
289 } else if (accel_val < LateralAccelerationValue::MIN) {
290 accel.value = LateralAccelerationValue::MIN;
291 } else if (accel_val > LateralAccelerationValue::MAX) {
292 accel.value = LateralAccelerationValue::MAX - 1;
293 }
294}
295
304inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
305 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
306 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
307}
308
310
311} // namespace etsi_its_cam_msgs::access

◆ setVehicleLength()

void etsi_its_cam_msgs::access::setVehicleLength ( VehicleLength & vehicle_length,
const double value )
inline

Set the VehicleLength object.

VehicleLengthConfidenceIndication is set to UNAVAILABLE

Parameters
vehicle_lengthobject to set
valueVehicleLengthValue in meter as decimal number

Definition at line 187 of file cam_setters.h.

222 {
223
225
233inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
234 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
235}
236
243inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
244 int64_t accel_val = (int64_t)std::round(value * 1e1);
245 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
246 accel.value = accel_val;
247 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
248 accel.value = LongitudinalAccelerationValue::MIN;
249 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
250 accel.value = LongitudinalAccelerationValue::MAX - 1;
251 }
252}
253
262inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
263 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
264 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
265}
266
273inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
274 int64_t accel_val = (int64_t)std::round(value * 1e1);
275 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
276 accel.value = accel_val;
277 } else if (accel_val < LateralAccelerationValue::MIN) {
278 accel.value = LateralAccelerationValue::MIN;
279 } else if (accel_val > LateralAccelerationValue::MAX) {
280 accel.value = LateralAccelerationValue::MAX - 1;
281 }
282}
283
292inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
293 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
294 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
295}
296
298
299} // namespace etsi_its_cam_msgs::access

◆ setVehicleLengthValue()

void etsi_its_cam_msgs::access::setVehicleLengthValue ( VehicleLengthValue & vehicle_length,
const double value )
inline

Set the VehicleLengthValue object.

Parameters
vehicle_lengthobject to set
valueVehicleLengthValue in meter as decimal number

Definition at line 173 of file cam_setters.h.

208 {
209
211
219inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
220 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
221}
222
229inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
230 int64_t accel_val = (int64_t)std::round(value * 1e1);
231 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
232 accel.value = accel_val;
233 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
234 accel.value = LongitudinalAccelerationValue::MIN;
235 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
236 accel.value = LongitudinalAccelerationValue::MAX - 1;
237 }
238}
239
248inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
249 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
250 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
251}
252
259inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
260 int64_t accel_val = (int64_t)std::round(value * 1e1);
261 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
262 accel.value = accel_val;
263 } else if (accel_val < LateralAccelerationValue::MIN) {
264 accel.value = LateralAccelerationValue::MIN;
265 } else if (accel_val > LateralAccelerationValue::MAX) {
266 accel.value = LateralAccelerationValue::MAX - 1;
267 }
268}
269
278inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
279 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
280 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
281}
282
284
285} // namespace etsi_its_cam_msgs::access

◆ setVehicleWidth()

void etsi_its_cam_msgs::access::setVehicleWidth ( VehicleWidth & vehicle_width,
const double value )
inline

Set the VehicleWidth object.

Parameters
vehicle_widthobject to set
valueVehicleWidth in meter as decimal number

Definition at line 161 of file cam_setters.h.

196 {
197
199
207inline void setItsPduHeader(CAM &cam, const uint32_t station_id, const uint8_t protocol_version = 0) {
208 setItsPduHeader(cam.header, ItsPduHeader::MESSAGE_ID_CAM, station_id, protocol_version);
209}
210
217inline void setLongitudinalAccelerationValue(LongitudinalAccelerationValue& accel, const double value) {
218 int64_t accel_val = (int64_t)std::round(value * 1e1);
219 if (accel_val >= LongitudinalAccelerationValue::MIN && accel_val <= LongitudinalAccelerationValue::MAX) {
220 accel.value = accel_val;
221 } else if (accel_val < LongitudinalAccelerationValue::MIN) {
222 accel.value = LongitudinalAccelerationValue::MIN;
223 } else if (accel_val > LongitudinalAccelerationValue::MAX) {
224 accel.value = LongitudinalAccelerationValue::MAX - 1;
225 }
226}
227
236inline void setLongitudinalAcceleration(LongitudinalAcceleration& accel, const double value) {
237 accel.longitudinal_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
238 setLongitudinalAccelerationValue(accel.longitudinal_acceleration_value, value);
239}
240
247inline void setLateralAccelerationValue(LateralAccelerationValue& accel, const double value) {
248 int64_t accel_val = (int64_t)std::round(value * 1e1);
249 if (accel_val >= LateralAccelerationValue::MIN && accel_val <= LateralAccelerationValue::MAX) {
250 accel.value = accel_val;
251 } else if (accel_val < LateralAccelerationValue::MIN) {
252 accel.value = LateralAccelerationValue::MIN;
253 } else if (accel_val > LateralAccelerationValue::MAX) {
254 accel.value = LateralAccelerationValue::MAX - 1;
255 }
256}
257
266inline void setLateralAcceleration(LateralAcceleration& accel, const double value) {
267 accel.lateral_acceleration_confidence.value = AccelerationConfidence::UNAVAILABLE;
268 setLateralAccelerationValue(accel.lateral_acceleration_value, value);
269}
270
272
273} // namespace etsi_its_cam_msgs::access

◆ throwIfOutOfRange()

template<typename T1 , typename T2 >
void etsi_its_cam_msgs::access::throwIfOutOfRange ( const T1 & val,
const T2 & min,
const T2 & max,
const std::string val_desc )

Definition at line 37 of file cam_access.h.