37namespace etsi_its_cpm_ts_msgs::access {
50inline void setItsPduHeader(CollectivePerceptionMessage& cpm,
const uint32_t station_id,
51 const uint8_t protocol_version = 0) {
52 setItsPduHeader(cpm.header, MessageId::CPM, station_id, protocol_version);
67 CollectivePerceptionMessage& cpm,
const uint64_t unix_nanosecs,
71 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX,
"TimestampIts");
72 cpm.payload.management_container.reference_time = t_its;
86inline void setReferencePosition(CollectivePerceptionMessage& cpm,
const double latitude,
const double longitude,
87 const double altitude = AltitudeValue::UNAVAILABLE) {
103inline void setFromUTMPosition(CollectivePerceptionMessage& cpm,
const gm::PointStamped& utm_position,
const int& zone,
104 const bool& northp) {
105 setFromUTMPosition(cpm.payload.management_container.reference_position, utm_position, zone, northp);
117 object.object_id.value = id;
118 object.object_id_is_present =
true;
133 if (delta_time < DeltaTimeMilliSecondSigned::MIN || delta_time > DeltaTimeMilliSecondSigned::MAX) {
134 throw std::invalid_argument(
"MeasurementDeltaTime out of range");
136 object.measurement_delta_time.value = delta_time;
154 const double confidence = std::numeric_limits<double>::infinity()) {
156 if (value < CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE) {
157 coordinate.value.value = CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE;
158 }
else if (value > CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE) {
159 coordinate.value.value = CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE;
161 coordinate.value.value =
static_cast<int32_t
>(value);
165 if (confidence == std::numeric_limits<double>::infinity()) {
166 coordinate.confidence.value = CoordinateConfidence::UNAVAILABLE;
167 }
else if (confidence > CoordinateConfidence::MAX || confidence < CoordinateConfidence::MIN) {
168 coordinate.confidence.value = CoordinateConfidence::OUT_OF_RANGE;
170 coordinate.confidence.value =
static_cast<uint16_t
>(confidence);
186 const double x_std = std::numeric_limits<double>::infinity(),
187 const double y_std = std::numeric_limits<double>::infinity(),
188 const double z_std = std::numeric_limits<double>::infinity()) {
191 if (point.z != 0.0) {
193 object.position.z_coordinate_is_present =
true;
213 const gm::PointStamped& utm_position,
214 const double x_std = std::numeric_limits<double>::infinity(),
215 const double y_std = std::numeric_limits<double>::infinity(),
216 const double z_std = std::numeric_limits<double>::infinity()) {
218 if (utm_position.header.frame_id != reference_position.header.frame_id) {
219 throw std::invalid_argument(
"UTM-Position frame_id (" + utm_position.header.frame_id +
220 ") does not match the reference position frame_id (" + reference_position.header.frame_id +
223 setCartesianCoordinateWithConfidence(
object.position.x_coordinate,
224 (utm_position.point.x - reference_position.point.x) * 100, x_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
225 setCartesianCoordinateWithConfidence(
object.position.y_coordinate,
226 (utm_position.point.y - reference_position.point.y) * 100, y_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
227 if (utm_position.point.z != 0.0) {
228 setCartesianCoordinateWithConfidence(
object.position.z_coordinate,
229 (utm_position.point.z - reference_position.point.z) * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
230 object.position.z_coordinate_is_present =
true;
246 const double confidence = std::numeric_limits<double>::infinity()) {
248 if (value < VelocityComponentValue::NEGATIVE_OUT_OF_RANGE) {
249 velocity.value.value = VelocityComponentValue::NEGATIVE_OUT_OF_RANGE;
250 }
else if (value > VelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
251 velocity.value.value = VelocityComponentValue::POSITIVE_OUT_OF_RANGE;
253 velocity.value.value =
static_cast<int16_t
>(value);
257 if(confidence == std::numeric_limits<double>::infinity()) {
258 velocity.confidence.value = SpeedConfidence::UNAVAILABLE;
259 }
else if (confidence > SpeedConfidence::MAX || confidence < SpeedConfidence::MIN) {
260 velocity.confidence.value = SpeedConfidence::OUT_OF_RANGE;
262 velocity.confidence.value =
static_cast<uint8_t
>(confidence);
274 double confidence = std::numeric_limits<double>::infinity()) {
276 double wrapped_value = fmod(value, 2*M_PI);
277 if (wrapped_value < 0.0) {
278 wrapped_value += 2 * M_PI;
280 angle.value.value =
static_cast<uint16_t
>(wrapped_value * 180 / M_PI * 10);
282 confidence *= 180.0 / M_PI * 10.0 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
284 if(confidence == std::numeric_limits<double>::infinity() || confidence <= 0.0) {
285 angle.confidence.value = AngleConfidence::UNAVAILABLE;
286 }
else if (confidence > AngleConfidence::MAX || confidence < AngleConfidence::MIN) {
287 angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
289 angle.confidence.value =
static_cast<uint8_t
>(confidence);
306 const double x_std = std::numeric_limits<double>::infinity(),
307 const double y_std = std::numeric_limits<double>::infinity(),
308 const double z_std = std::numeric_limits<double>::infinity()) {
309 object.velocity.choice = Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY;
310 setVelocityComponent(
object.velocity.cartesian_velocity.x_velocity, cartesian_velocity.x * 100, x_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
311 setVelocityComponent(
object.velocity.cartesian_velocity.y_velocity, cartesian_velocity.y * 100, y_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
312 if (cartesian_velocity.z != 0.0) {
313 setVelocityComponent(
object.velocity.cartesian_velocity.z_velocity, cartesian_velocity.z * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
314 object.velocity.cartesian_velocity.z_velocity_is_present =
true;
316 object.velocity.cartesian_velocity.z_velocity_is_present =
false;
318 object.velocity_is_present =
true;
336 const double magnitude,
338 const double z = 0.0,
339 const double magnitude_std = std::numeric_limits<double>::infinity(),
340 const double angle_std = std::numeric_limits<double>::infinity(),
341 const double z_std = std::numeric_limits<double>::infinity()) {
342 object.velocity.choice = Velocity3dWithConfidence::CHOICE_POLAR_VELOCITY;
343 setSpeed(
object.velocity.polar_velocity.velocity_magnitude, magnitude, magnitude_std);
344 setCartesianAngle(
object.velocity.polar_velocity.velocity_direction, angle, angle_std);
346 setVelocityComponent(
object.velocity.cartesian_velocity.z_velocity, z * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
347 object.velocity.polar_velocity.z_velocity_is_present =
true;
349 object.velocity.polar_velocity.z_velocity_is_present =
false;
365 const double confidence = std::numeric_limits<double>::infinity()) {
367 if (value < AccelerationValue::NEGATIVE_OUT_OF_RANGE) {
368 acceleration.value.value = AccelerationValue::NEGATIVE_OUT_OF_RANGE;
369 }
else if (value > AccelerationValue::POSITIVE_OUT_OF_RANGE) {
370 acceleration.value.value = AccelerationValue::POSITIVE_OUT_OF_RANGE;
372 acceleration.value.value =
static_cast<int16_t
>(value);
376 if(confidence == std::numeric_limits<double>::infinity()) {
377 acceleration.confidence.value = AccelerationConfidence::UNAVAILABLE;
378 }
else if (confidence > AccelerationConfidence::MAX || confidence < AccelerationConfidence::MIN) {
379 acceleration.confidence.value = AccelerationConfidence::OUT_OF_RANGE;
381 acceleration.confidence.value =
static_cast<uint8_t
>(confidence);
398 const double x_std = std::numeric_limits<double>::infinity(),
399 const double y_std = std::numeric_limits<double>::infinity(),
400 const double z_std = std::numeric_limits<double>::infinity()) {
401 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION;
403 x_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
405 y_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
406 if (cartesian_acceleration.z != 0.0) {
408 z_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
409 object.acceleration.cartesian_acceleration.z_acceleration_is_present =
true;
411 object.acceleration_is_present =
true;
426 const double magnitude,
428 const double z = 0.0,
429 const double magnitude_std = std::numeric_limits<double>::infinity(),
430 const double angle_std = std::numeric_limits<double>::infinity(),
431 const double z_std = std::numeric_limits<double>::infinity()) {
432 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_POLAR_ACCELERATION;
434 setCartesianAngle(
object.acceleration.polar_acceleration.acceleration_direction, angle, angle_std);
437 z_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
438 object.acceleration.polar_acceleration.z_acceleration_is_present =
true;
440 object.acceleration.polar_acceleration.z_acceleration_is_present =
false;
442 object.acceleration_is_present =
true;
456 double yaw_std = std::numeric_limits<double>::infinity()) {
458 double yaw_in_degrees = yaw * 180 / M_PI;
459 while (yaw_in_degrees >= 360.0) yaw_in_degrees -= 360.0;
460 while (yaw_in_degrees < 0.0) yaw_in_degrees += 360.0;
461 object.angles.z_angle.value.value = yaw_in_degrees * 10;
463 if(yaw_std == std::numeric_limits<double>::infinity()) {
464 object.angles.z_angle.confidence.value = AngleConfidence::UNAVAILABLE;
466 yaw_std *= 180.0 / M_PI;
467 yaw_std *= 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
469 if (yaw_std > AngleConfidence::MAX || yaw_std < AngleConfidence::MIN) {
470 object.angles.z_angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
472 object.angles.z_angle.confidence.value =
static_cast<uint8_t
>(yaw_std);
475 object.angles_is_present =
true;
490 double yaw_rate_std = std::numeric_limits<double>::infinity()) {
491 double yaw_rate_in_degrees = yaw_rate * 180.0 / M_PI;
493 if (yaw_rate_in_degrees < CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE) {
494 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE;
495 }
else if (yaw_rate_in_degrees > CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
496 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE;
499 object.z_angular_velocity.value.value = yaw_rate_in_degrees;
501 if(yaw_rate_std == std::numeric_limits<double>::infinity()) {
502 object.z_angular_velocity.confidence.value = AngularSpeedConfidence::UNAVAILABLE;
504 yaw_rate_std *= 180.0 / M_PI;
505 yaw_rate_std *= etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
507 static const std::map<double, uint8_t> confidence_map = {
508 {1.0, AngularSpeedConfidence::DEG_SEC_01},
509 {2.0, AngularSpeedConfidence::DEG_SEC_02},
510 {5.0, AngularSpeedConfidence::DEG_SEC_05},
511 {10.0, AngularSpeedConfidence::DEG_SEC_10},
512 {20.0, AngularSpeedConfidence::DEG_SEC_20},
513 {50.0, AngularSpeedConfidence::DEG_SEC_50},
514 {std::numeric_limits<double>::infinity(), AngularSpeedConfidence::OUT_OF_RANGE},
516 for(
const auto& [thresh, conf_val] : confidence_map) {
517 if (yaw_rate_std <= thresh) {
518 object.z_angular_velocity.confidence.value = conf_val;
524 object.z_angular_velocity_is_present =
true;
542 const double confidence = std::numeric_limits<double>::infinity()) {
544 if (value < ObjectDimensionValue::MIN || value > ObjectDimensionValue::MAX) {
545 dimension.value.value = ObjectDimensionValue::OUT_OF_RANGE;
547 dimension.value.value =
static_cast<uint16_t
>(value);
551 if (confidence == std::numeric_limits<double>::infinity()) {
552 dimension.confidence.value = ObjectDimensionConfidence::UNAVAILABLE;
553 }
else if (confidence > ObjectDimensionConfidence::MAX || confidence < ObjectDimensionConfidence::MIN) {
554 dimension.confidence.value = ObjectDimensionConfidence::OUT_OF_RANGE;
556 dimension.confidence.value =
static_cast<uint8_t
>(confidence);
572 const double std = std::numeric_limits<double>::infinity()) {
573 setObjectDimension(
object.object_dimension_x, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
574 object.object_dimension_x_is_present =
true;
587inline void setYDimensionOfPerceivedObject(PerceivedObject&
object,
const double value,
588 const double std = std::numeric_limits<double>::infinity()) {
589 setObjectDimension(
object.object_dimension_y, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
590 object.object_dimension_y_is_present =
true;
604 const double std = std::numeric_limits<double>::infinity()) {
605 setObjectDimension(
object.object_dimension_z, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
606 object.object_dimension_z_is_present =
true;
620inline void setDimensionsOfPerceivedObject(PerceivedObject&
object,
const gm::Vector3& dimensions,
621 const double x_std = std::numeric_limits<double>::infinity(),
622 const double y_std = std::numeric_limits<double>::infinity(),
623 const double z_std = std::numeric_limits<double>::infinity()) {
624 setXDimensionOfPerceivedObject(
object, dimensions.x, x_std);
625 setYDimensionOfPerceivedObject(
object, dimensions.y, y_std);
626 setZDimensionOfPerceivedObject(
object, dimensions.z, z_std);
638inline void initPerceivedObject(PerceivedObject&
object,
const gm::Point& point,
const int16_t delta_time = 0) {
639 setPositionOfPerceivedObject(
object, point);
640 setMeasurementDeltaTimeOfPerceivedObject(
object, delta_time);
655inline void initPerceivedObjectWithUTMPosition(CollectivePerceptionMessage& cpm, PerceivedObject&
object,
656 const gm::PointStamped& point,
const int16_t delta_time = 0) {
657 setUTMPositionOfPerceivedObject(cpm,
object, point);
658 setMeasurementDeltaTimeOfPerceivedObject(
object, delta_time);
671 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
672 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
688inline void addPerceivedObjectToContainer(WrappedCpmContainer& container,
const PerceivedObject& perceived_object) {
689 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
690 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
691 container.container_data_perceived_object_container.number_of_perceived_objects.value =
692 container.container_data_perceived_object_container.perceived_objects.array.size();
694 throw std::invalid_argument(
"Container is not a PerceivedObjectContainer");
710inline void addContainerToCPM(CollectivePerceptionMessage& cpm,
const WrappedCpmContainer& container) {
712 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
713 cpm.payload.cpm_containers.value.array.push_back(container);
715 throw std::invalid_argument(
"Maximum number of CPM-Containers reached");
727inline void setWGSRefPosConfidence(CollectivePerceptionMessage& cpm,
const std::array<double, 4>& covariance_matrix) {
741 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER;
742 container.container_data_sensor_information_container.array = std::vector<SensorInformation>();
755inline void setSensorID(SensorInformation& sensor_information,
const uint8_t sensor_id = 0) {
757 sensor_information.sensor_id.value = sensor_id;
770inline void setSensorType(SensorInformation& sensor_information,
const uint8_t sensor_type = SensorType::UNDEFINED) {
772 sensor_information.sensor_type.value = sensor_type;
794 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER) {
796 if (container.container_data_sensor_information_container.array.size() < SensorInformationContainer::MAX_SIZE ) {
797 throwIfOutOfRange(sensor_information.sensor_id.value, Identifier1B::MIN, Identifier1B::MAX,
"SensorID");
798 throwIfOutOfRange(sensor_information.sensor_type.value, SensorType::MIN, SensorType::MAX,
"SensorType");
799 container.container_data_sensor_information_container.array.push_back(sensor_information);
801 throw std::invalid_argument(
"Maximum number of entries SensorInformationContainers reached");
804 throw std::invalid_argument(
"Container is not a SensorInformationContainer");
823 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER) {
824 throwIfOutOfRange(container.container_data_sensor_information_container.array.size(),
825 SensorInformationContainer::MIN_SIZE, SensorInformationContainer::MAX_SIZE,
"SensorInformationContainer array size"
829 throw std::invalid_argument(
"Container is not a SensorInformationContainer");
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
Sanity-check functions etc.
void 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.
File containing constants that are used in the context of ETIS ITS Messages.
gm::PointStamped getUTMPosition(const T &reference_position, int &zone, bool &northp)
Get the UTM Position defined by the given ReferencePosition.
void setReferencePosition(T &ref_position, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
Sets the reference position in the given ReferencePostion object.
void setCartesianAngle(CartesianAngle &angle, const double value, double confidence=std::numeric_limits< double >::infinity())
Set a Cartesian Angle.
void addSensorInformationToContainer(WrappedCpmContainer &container, const SensorInformation &sensor_information)
Adds a SensorInformation to the SensorInformationContainer / WrappedCpmContainer.
void setVelocityOfPerceivedObject(PerceivedObject &object, const gm::Vector3 &cartesian_velocity, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
void setWGSPosConfidenceEllipse(PosConfidenceEllipse &position_confidence_ellipse, const std::array< double, 4 > &covariance_matrix)
Set the Pos Confidence Ellipse object.
void setAccelerationComponent(AccelerationComponent &acceleration, const double value, const double confidence=std::numeric_limits< double >::infinity())
Sets the value and confidence of a AccelerationComponent.
void setAccelerationOfPerceivedObject(PerceivedObject &object, const gm::Vector3 &cartesian_acceleration, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
Sets the acceleration of a perceived object.
void initPerceivedObjectContainer(WrappedCpmContainer &container, const uint8_t n_objects=0)
Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects.
void addSensorInformationContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
void setWGSRefPosConfidence(CollectivePerceptionMessage &cpm, const std::array< double, 4 > &covariance_matrix)
Set the confidence of the reference position.
void setVelocityComponent(VelocityComponent &velocity, const double value, const double confidence=std::numeric_limits< double >::infinity())
Sets the value and confidence of a VelocityComponent.
void setYawRateOfPerceivedObject(PerceivedObject &object, const double yaw_rate, double yaw_rate_std=std::numeric_limits< double >::infinity())
Sets the yaw rate of a perceived object.
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 setFromUTMPosition(T &reference_position, const gm::PointStamped &utm_position, const int zone, const bool northp)
Set the ReferencePosition from a given UTM-Position.
void setYawOfPerceivedObject(PerceivedObject &object, const double yaw, double yaw_std=std::numeric_limits< double >::infinity())
Sets the yaw angle of a perceived object.
void setUTMPositionOfPerceivedObject(CollectivePerceptionMessage &cpm, PerceivedObject &object, const gm::PointStamped &utm_position, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
Sets the position of a perceived object based on a UTM position.
void setPolarVelocityOfPerceivedObject(PerceivedObject &object, const double magnitude, const double angle, const double z=0.0, const double magnitude_std=std::numeric_limits< double >::infinity(), const double angle_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
void addContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
void 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 setIdOfPerceivedObject(PerceivedObject &object, const uint16_t id)
Set the ID of a PerceivedObject.
void setAccelerationMagnitude(AccelerationMagnitude &accel_mag, const double value, const double confidence=std::numeric_limits< double >::infinity())
Set the AccelerationMagnitude object.
void setPolarAccelerationOfPerceivedObject(PerceivedObject &object, const double magnitude, const double angle, const double z=0.0, const double magnitude_std=std::numeric_limits< double >::infinity(), const double angle_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
Set the Polar Acceleration Of Perceived Object object.
void setObjectDimension(ObjectDimension &dimension, const double value, const double confidence=std::numeric_limits< double >::infinity())
Sets the object dimension with the given value and confidence.
void setXDimensionOfPerceivedObject(PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity())
Sets the x-dimension of a perceived object.
void setZDimensionOfPerceivedObject(PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity())
Sets the z-dimension of a perceived object.
void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence &coordinate, const double value, const double confidence=std::numeric_limits< double >::infinity())
Sets the value and confidence of a CartesianCoordinateWithConfidence object.
void setPositionOfPerceivedObject(PerceivedObject &object, const gm::Point &point, const double x_std=std::numeric_limits< double >::infinity(), const double y_std=std::numeric_limits< double >::infinity(), const double z_std=std::numeric_limits< double >::infinity())
Sets the position of a perceived object (relative to the CPM's reference position).
void setMeasurementDeltaTimeOfPerceivedObject(PerceivedObject &object, const int16_t delta_time=0)
Sets the measurement delta time of a PerceivedObject.
void setSensorType(SensorInformation &sensor_information, const uint8_t sensor_type=SensorType::UNDEFINED)
Sets the sensorType of a SensorInformation object.
const std::map< uint64_t, uint16_t > LEAP_SECOND_INSERTIONS_SINCE_2004
std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the in...
void setSpeed(Speed &speed, const double value, const double confidence=std::numeric_limits< double >::infinity())
Set the Speed object.
void setReferenceTime(CollectivePerceptionMessage &cpm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
Sets the reference time in a CPM.
void initSensorInformationContainer(WrappedCpmContainer &container)
Initializes a WrappedCpmContainer as a SensorInformationContainer.
void setTimestampITS(TimestampIts ×tamp_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.