Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
This function checks if the provided container is a PerceivedObjectContainer. If it is, the function adds the given PerceivedObject to the container's perceived_objects array and updates the number_of_perceived_objects value. If the container is not a PerceivedObjectContainer, the function throws an std::invalid_argument exception.
896 {
897
899
909inline void setItsPduHeader(CollectivePerceptionMessage& cpm,
const uint32_t station_id,
910 const uint8_t protocol_version = 0) {
911 setItsPduHeader(cpm.header, MessageId::CPM, station_id, protocol_version);
912}
913
925inline void setReferenceTime(
926 CollectivePerceptionMessage& cpm, const uint64_t unix_nanosecs,
928 TimestampIts t_its;
930 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX,
"TimestampIts");
931 cpm.payload.management_container.reference_time = t_its;
932}
933
945inline void setReferencePosition(CollectivePerceptionMessage& cpm,
const double latitude,
const double longitude,
946 const double altitude = AltitudeValue::UNAVAILABLE) {
947 setReferencePosition(cpm.payload.management_container.reference_position, latitude, longitude, altitude);
948}
949
962inline void setFromUTMPosition(CollectivePerceptionMessage& cpm,
const gm::PointStamped& utm_position,
const int& zone,
963 const bool& northp) {
964 setFromUTMPosition(cpm.payload.management_container.reference_position, utm_position, zone, northp);
965}
966
976 object.object_id.value = id;
977 object.object_id_is_present = true;
978}
979
992 if (delta_time < DeltaTimeMilliSecondSigned::MIN || delta_time > DeltaTimeMilliSecondSigned::MAX) {
993 throw std::invalid_argument("MeasurementDeltaTime out of range");
994 } else {
995 object.measurement_delta_time.value = delta_time;
996 }
997}
998
1013 const double confidence = std::numeric_limits<double>::infinity()) {
1014
1015 if (value < CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE) {
1016 coordinate.value.value = CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE;
1017 } else if (value > CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE) {
1018 coordinate.value.value = CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE;
1019 } else {
1020 coordinate.value.value = static_cast<int32_t>(value);
1021 }
1022
1023
1024 if (confidence == std::numeric_limits<double>::infinity()) {
1025 coordinate.confidence.value = CoordinateConfidence::UNAVAILABLE;
1026 } else if (confidence > CoordinateConfidence::MAX || confidence < CoordinateConfidence::MIN) {
1027 coordinate.confidence.value = CoordinateConfidence::OUT_OF_RANGE;
1028 } else {
1029 coordinate.confidence.value = static_cast<uint16_t>(confidence);
1030 }
1031}
1032
1045 const double x_std = std::numeric_limits<double>::infinity(),
1046 const double y_std = std::numeric_limits<double>::infinity(),
1047 const double z_std = std::numeric_limits<double>::infinity()) {
1050 if (point.z != 0.0) {
1052 object.position.z_coordinate_is_present = true;
1053 }
1054}
1055
1072 const gm::PointStamped& utm_position,
1073 const double x_std = std::numeric_limits<double>::infinity(),
1074 const double y_std = std::numeric_limits<double>::infinity(),
1075 const double z_std = std::numeric_limits<double>::infinity()) {
1077 if (utm_position.header.frame_id != reference_position.header.frame_id) {
1078 throw std::invalid_argument("UTM-Position frame_id (" + utm_position.header.frame_id +
1079 ") does not match the reference position frame_id (" + reference_position.header.frame_id +
1080 ")");
1081 }
1083 (utm_position.point.x - reference_position.point.x) * 100, x_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1085 (utm_position.point.y - reference_position.point.y) * 100, y_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1086 if (utm_position.point.z != 0.0) {
1088 (utm_position.point.z - reference_position.point.z) * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1089 object.position.z_coordinate_is_present = true;
1090 }
1091}
1092
1105 const double confidence = std::numeric_limits<double>::infinity()) {
1106
1107 if (value < VelocityComponentValue::NEGATIVE_OUT_OF_RANGE) {
1108 velocity.value.value = VelocityComponentValue::NEGATIVE_OUT_OF_RANGE;
1109 } else if (value > VelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
1110 velocity.value.value = VelocityComponentValue::POSITIVE_OUT_OF_RANGE;
1111 } else {
1112 velocity.value.value = static_cast<int16_t>(value);
1113 }
1114
1115
1116 if(confidence == std::numeric_limits<double>::infinity()) {
1117 velocity.confidence.value = SpeedConfidence::UNAVAILABLE;
1118 } else if (confidence > SpeedConfidence::MAX || confidence < SpeedConfidence::MIN) {
1119 velocity.confidence.value = SpeedConfidence::OUT_OF_RANGE;
1120 } else {
1121 velocity.confidence.value = static_cast<uint8_t>(confidence);
1122 }
1123}
1124
1133 double confidence = std::numeric_limits<double>::infinity()) {
1134
1135 double wrapped_value = fmod(value, 2*M_PI);
1136 if (wrapped_value < 0.0) {
1137 wrapped_value += 2 * M_PI;
1138 }
1139 angle.value.value = static_cast<uint16_t>(wrapped_value * 180 / M_PI * 10);
1140
1141 confidence *= 180.0 / M_PI * 10.0 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
1142
1143 if(confidence == std::numeric_limits<double>::infinity() || confidence <= 0.0) {
1144 angle.confidence.value = AngleConfidence::UNAVAILABLE;
1145 } else if (confidence > AngleConfidence::MAX || confidence < AngleConfidence::MIN) {
1146 angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
1147 } else {
1148 angle.confidence.value = static_cast<uint8_t>(confidence);
1149 }
1150}
1151
1165 const double x_std = std::numeric_limits<double>::infinity(),
1166 const double y_std = std::numeric_limits<double>::infinity(),
1167 const double z_std = std::numeric_limits<double>::infinity()) {
1168 object.velocity.choice = Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY;
1169 setVelocityComponent(
object.velocity.cartesian_velocity.x_velocity, cartesian_velocity.x * 100, x_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1170 setVelocityComponent(
object.velocity.cartesian_velocity.y_velocity, cartesian_velocity.y * 100, y_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1171 if (cartesian_velocity.z != 0.0) {
1172 setVelocityComponent(
object.velocity.cartesian_velocity.z_velocity, cartesian_velocity.z * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1173 object.velocity.cartesian_velocity.z_velocity_is_present = true;
1174 } else {
1175 object.velocity.cartesian_velocity.z_velocity_is_present = false;
1176 }
1177 object.velocity_is_present = true;
1178}
1179
1195 const double magnitude,
1196 const double angle,
1197 const double z = 0.0,
1198 const double magnitude_std = std::numeric_limits<double>::infinity(),
1199 const double angle_std = std::numeric_limits<double>::infinity(),
1200 const double z_std = std::numeric_limits<double>::infinity()) {
1201 object.velocity.choice = Velocity3dWithConfidence::CHOICE_POLAR_VELOCITY;
1202 setSpeed(
object.velocity.polar_velocity.velocity_magnitude, magnitude, magnitude_std);
1203 setCartesianAngle(
object.velocity.polar_velocity.velocity_direction, angle, angle_std);
1204 if (z != 0.0) {
1205 setVelocityComponent(
object.velocity.cartesian_velocity.z_velocity, z * 100, z_std * 100 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1206 object.velocity.polar_velocity.z_velocity_is_present = true;
1207 } else {
1208 object.velocity.polar_velocity.z_velocity_is_present = false;
1209 }
1210}
1211
1224 const double confidence = std::numeric_limits<double>::infinity()) {
1225
1226 if (value < AccelerationValue::NEGATIVE_OUT_OF_RANGE) {
1227 acceleration.value.value = AccelerationValue::NEGATIVE_OUT_OF_RANGE;
1228 } else if (value > AccelerationValue::POSITIVE_OUT_OF_RANGE) {
1229 acceleration.value.value = AccelerationValue::POSITIVE_OUT_OF_RANGE;
1230 } else {
1231 acceleration.value.value = static_cast<int16_t>(value);
1232 }
1233
1234
1235 if(confidence == std::numeric_limits<double>::infinity()) {
1236 acceleration.confidence.value = AccelerationConfidence::UNAVAILABLE;
1237 } else if (confidence > AccelerationConfidence::MAX || confidence < AccelerationConfidence::MIN) {
1238 acceleration.confidence.value = AccelerationConfidence::OUT_OF_RANGE;
1239 } else {
1240 acceleration.confidence.value = static_cast<uint8_t>(confidence);
1241 }
1242}
1243
1257 const double x_std = std::numeric_limits<double>::infinity(),
1258 const double y_std = std::numeric_limits<double>::infinity(),
1259 const double z_std = std::numeric_limits<double>::infinity()) {
1260 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION;
1262 x_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1264 y_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1265 if (cartesian_acceleration.z != 0.0) {
1267 z_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1268 object.acceleration.cartesian_acceleration.z_acceleration_is_present = true;
1269 }
1270 object.acceleration_is_present = true;
1271}
1272
1285 const double magnitude,
1286 const double angle,
1287 const double z = 0.0,
1288 const double magnitude_std = std::numeric_limits<double>::infinity(),
1289 const double angle_std = std::numeric_limits<double>::infinity(),
1290 const double z_std = std::numeric_limits<double>::infinity()) {
1291 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_POLAR_ACCELERATION;
1293 setCartesianAngle(
object.acceleration.polar_acceleration.acceleration_direction, angle, angle_std);
1294 if (z != 0.0) {
1296 z_std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1297 object.acceleration.polar_acceleration.z_acceleration_is_present = true;
1298 } else {
1299 object.acceleration.polar_acceleration.z_acceleration_is_present = false;
1300 }
1301 object.acceleration_is_present = true;
1302}
1303
1315 double yaw_std = std::numeric_limits<double>::infinity()) {
1316
1317 double yaw_in_degrees = yaw * 180 / M_PI;
1318 while (yaw_in_degrees >= 360.0) yaw_in_degrees -= 360.0;
1319 while (yaw_in_degrees < 0.0) yaw_in_degrees += 360.0;
1320 object.angles.z_angle.value.value = yaw_in_degrees * 10;
1321
1322 if(yaw_std == std::numeric_limits<double>::infinity()) {
1323 object.angles.z_angle.confidence.value = AngleConfidence::UNAVAILABLE;
1324 } else {
1325 yaw_std *= 180.0 / M_PI;
1326 yaw_std *= 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
1327
1328 if (yaw_std > AngleConfidence::MAX || yaw_std < AngleConfidence::MIN) {
1329 object.angles.z_angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
1330 } else {
1331 object.angles.z_angle.confidence.value = static_cast<uint8_t>(yaw_std);
1332 }
1333 }
1334 object.angles_is_present = true;
1335}
1336
1349 double yaw_rate_std = std::numeric_limits<double>::infinity()) {
1350 double yaw_rate_in_degrees = yaw_rate * 180.0 / M_PI;
1351
1352 if (yaw_rate_in_degrees < CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE) {
1353 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE;
1354 } else if (yaw_rate_in_degrees > CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
1355 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE;
1356 }
1357
1358 object.z_angular_velocity.value.value = yaw_rate_in_degrees;
1359
1360 if(yaw_rate_std == std::numeric_limits<double>::infinity()) {
1361 object.z_angular_velocity.confidence.value = AngularSpeedConfidence::UNAVAILABLE;
1362 } else {
1363 yaw_rate_std *= 180.0 / M_PI;
1364 yaw_rate_std *= etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
1365
1366 static const std::map<double, uint8_t> confidence_map = {
1367 {1.0, AngularSpeedConfidence::DEG_SEC_01},
1368 {2.0, AngularSpeedConfidence::DEG_SEC_02},
1369 {5.0, AngularSpeedConfidence::DEG_SEC_05},
1370 {10.0, AngularSpeedConfidence::DEG_SEC_10},
1371 {20.0, AngularSpeedConfidence::DEG_SEC_20},
1372 {50.0, AngularSpeedConfidence::DEG_SEC_50},
1373 {std::numeric_limits<double>::infinity(), AngularSpeedConfidence::OUT_OF_RANGE},
1374 };
1375 for(const auto& [thresh, conf_val] : confidence_map) {
1376 if (yaw_rate_std <= thresh) {
1377 object.z_angular_velocity.confidence.value = conf_val;
1378 break;
1379 }
1380 }
1381 }
1382
1383 object.z_angular_velocity_is_present = true;
1384}
1385
1401 const double confidence = std::numeric_limits<double>::infinity()) {
1402
1403 if (value < ObjectDimensionValue::MIN || value > ObjectDimensionValue::MAX) {
1404 dimension.value.value = ObjectDimensionValue::OUT_OF_RANGE;
1405 } else {
1406 dimension.value.value = static_cast<uint16_t>(value);
1407 }
1408
1409
1410 if (confidence == std::numeric_limits<double>::infinity()) {
1411 dimension.confidence.value = ObjectDimensionConfidence::UNAVAILABLE;
1412 } else if (confidence > ObjectDimensionConfidence::MAX || confidence < ObjectDimensionConfidence::MIN) {
1413 dimension.confidence.value = ObjectDimensionConfidence::OUT_OF_RANGE;
1414 } else {
1415 dimension.confidence.value = static_cast<uint8_t>(confidence);
1416 }
1417
1418}
1419
1431 const double std = std::numeric_limits<double>::infinity()) {
1432 setObjectDimension(
object.object_dimension_x, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1433 object.object_dimension_x_is_present = true;
1434}
1435
1447 const double std = std::numeric_limits<double>::infinity()) {
1448 setObjectDimension(
object.object_dimension_y, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1449 object.object_dimension_y_is_present = true;
1450}
1451
1463 const double std = std::numeric_limits<double>::infinity()) {
1464 setObjectDimension(
object.object_dimension_z, value * 10, std * 10 * etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR);
1465 object.object_dimension_z_is_present = true;
1466}
1467
1480 const double x_std = std::numeric_limits<double>::infinity(),
1481 const double y_std = std::numeric_limits<double>::infinity(),
1482 const double z_std = std::numeric_limits<double>::infinity()) {
1486}
1487
1497inline void initPerceivedObject(PerceivedObject&
object,
const gm::Point& point,
const int16_t delta_time = 0) {
1500}
1501
1515 const gm::PointStamped& point, const int16_t delta_time = 0) {
1518}
1519
1530 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
1531 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
1532}
1533
1548 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
1549 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
1550 container.container_data_perceived_object_container.number_of_perceived_objects.value =
1551 container.container_data_perceived_object_container.perceived_objects.array.size();
1552 } else {
1553 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
1554 }
1555}
1556
1569inline void addContainerToCPM(CollectivePerceptionMessage& cpm,
const WrappedCpmContainer& container) {
1570
1571 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
1572 cpm.payload.cpm_containers.value.array.push_back(container);
1573 } else {
1574 throw std::invalid_argument("Maximum number of CPM-Containers reached");
1575 }
1576}
1577
1586inline void setWGSRefPosConfidence(CollectivePerceptionMessage& cpm,
const std::array<double, 4>& covariance_matrix) {
1588 covariance_matrix);
1589}
1590
1600 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER;
1601 container.container_data_sensor_information_container.array = std::vector<SensorInformation>();
1602}
1603
1614inline void setSensorID(SensorInformation& sensor_information,
const uint8_t sensor_id = 0) {
1616 sensor_information.sensor_id.value = sensor_id;
1617}
1618
1629inline void setSensorType(SensorInformation& sensor_information,
const uint8_t sensor_type = SensorType::UNDEFINED) {
1631 sensor_information.sensor_type.value = sensor_type;
1632}
1633
1653 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER) {
1654
1655 if (container.container_data_sensor_information_container.array.size() < SensorInformationContainer::MAX_SIZE ) {
1656 throwIfOutOfRange(sensor_information.sensor_id.value, Identifier1B::MIN, Identifier1B::MAX,
"SensorID");
1657 throwIfOutOfRange(sensor_information.sensor_type.value, SensorType::MIN, SensorType::MAX,
"SensorType");
1658 container.container_data_sensor_information_container.array.push_back(sensor_information);
1659 } else {
1660 throw std::invalid_argument("Maximum number of entries SensorInformationContainers reached");
1661 }
1662 } else {
1663 throw std::invalid_argument("Container is not a SensorInformationContainer");
1664 }
1665}
1666
1682 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_SENSOR_INFORMATION_CONTAINER) {
1683 throwIfOutOfRange(container.container_data_sensor_information_container.array.size(),
1684 SensorInformationContainer::MIN_SIZE, SensorInformationContainer::MAX_SIZE, "SensorInformationContainer array size"
1685 );
1687 } else {
1688 throw std::invalid_argument("Container is not a SensorInformationContainer");
1689 }
1690}
1691
1692}
void setReferencePosition(CAM &cam, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
Set the ReferencePosition for a CAM.
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.
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
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.
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...
gm::PointStamped getUTMPosition(const T &reference_position, int &zone, bool &northp)
Get the UTM Position defined by the given ReferencePosition.
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 setDimensionsOfPerceivedObject(PerceivedObject &object, const gm::Vector3 &dimensions, 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 all dimensions of a perceived object.
void setYDimensionOfPerceivedObject(PerceivedObject &object, const double value, const double std=std::numeric_limits< double >::infinity())
Sets the y-dimension of a perceived object.
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 addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
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.
void setSpeed(Speed &speed, const double value, const double confidence=std::numeric_limits< double >::infinity())
Set the Speed object.
void initSensorInformationContainer(WrappedCpmContainer &container)
Initializes a WrappedCpmContainer as a SensorInformationContainer.
void initPerceivedObjectWithUTMPosition(CollectivePerceptionMessage &cpm, PerceivedObject &object, const gm::PointStamped &point, const int16_t delta_time=0)
Initializes a PerceivedObject with the given point (utm-position) and delta time.
void setSensorID(SensorInformation &sensor_information, const uint8_t sensor_id=0)
Sets the sensorId of a SensorInformation object.
void initPerceivedObject(PerceivedObject &object, const gm::Point &point, const int16_t delta_time=0)
Initializes a PerceivedObject with the given point and delta time.