etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
cpm_ts_getters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#pragma once
10
11#include <tuple>
12
13namespace etsi_its_cpm_ts_msgs::access {
14
16
22 * @param cpm The CPM from which to retrieve the station ID.
23 * @return The station ID extracted from the header of the CPM.
24 */
25inline uint32_t getStationID(const CollectivePerceptionMessage &cpm) { return getStationID(cpm.header); }
26
33inline TimestampIts getReferenceTime(const CollectivePerceptionMessage &cpm) {
34 return cpm.payload.management_container.reference_time;
35}
36
42 */
43inline uint64_t getReferenceTimeValue(const CollectivePerceptionMessage &cpm) { return getReferenceTime(cpm).value; }
44
45
48 * @param cpm CPM to get the Latitude value from
49 * @return Latitude value in degree as decimal number
50 */
51inline double getLatitude(const CollectivePerceptionMessage &cpm) {
52 return getLatitude(cpm.payload.management_container.reference_position.latitude);
53}
54
55
61inline double getLongitude(const CollectivePerceptionMessage &cpm) {
62 return getLongitude(cpm.payload.management_container.reference_position.longitude);
63}
69 * @return Altitude value in (above the reference ellipsoid surface) in meter as decimal number
70 */
71inline double getAltitude(const CollectivePerceptionMessage &cpm) {
72 return getAltitude(cpm.payload.management_container.reference_position.altitude);
73}
74
80 *
81 * @param[in] cpm CPM to get the UTM Position from
82 * @param[out] zone the UTM zone (zero means UPS)
83 * @param[out] northp hemisphere (true means north, false means south)
84 * @return geometry_msgs::PointStamped of the given position with the UTM zone and hemisphere as frame_id
85 */
86inline gm::PointStamped getUTMPosition(const CollectivePerceptionMessage &cpm, int &zone, bool &northp) {
87 return getUTMPosition(cpm.payload.management_container.reference_position, zone, northp);
88}
89
91 * @brief Get the UTM Position defined within the ManagementContainer of the CPM
92 *
93 * The position is transformed into UTM by using GeographicLib::UTMUPS
94 * The altitude value is directly used as z-Coordinate
95 *
96 * @param cpm CPM from which to extract the UTM position.
97 * @return geometry_msgs::PointStamped of the given position with the UTM zone and hemisphere as frame_id
98 */
99inline gm::PointStamped getUTMPosition(const CollectivePerceptionMessage &cpm) {
100 int zone;
101 bool northp;
102 return getUTMPosition(cpm, zone, northp);
103}
104
108 * This function iterates over the cpm_containers array in the given CPM
109 * and extracts the container IDs into a vector of uint8_t.
110 *
111 * @param cpm The CPM from which to retrieve the container IDs.
112 * @return A vector containing the container IDs.
113 */
114inline std::vector<uint8_t> getCpmContainerIds(const CollectivePerceptionMessage &cpm) {
115 std::vector<uint8_t> container_ids;
116 for (int i = 0; i < cpm.payload.cpm_containers.value.array.size(); i++) {
117 container_ids.push_back(cpm.payload.cpm_containers.value.array[i].container_id.value);
118 }
119 return container_ids;
120}
121
126
130inline WrappedCpmContainer getCpmContainer(const CollectivePerceptionMessage &cpm, const uint8_t container_id) {
131 for (int i = 0; i < cpm.payload.cpm_containers.value.array.size(); i++) {
132 if (cpm.payload.cpm_containers.value.array[i].container_id.value == container_id) {
133 return cpm.payload.cpm_containers.value.array[i];
134 }
135 }
136 throw std::invalid_argument("No Container with ID " + std::to_string(container_id) + " found in CPM");
137}
138
147inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
148 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
149}
150
156 * @throws std::invalid_argument if the container is not a PerceivedObjectContainer.
157 */
158inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
159 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
160 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
161 }
162 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
163 return number;
164}
165
167 * Retrieves the number of perceived objects from the given CPM.
168 *
169 * @param cpm The CPM from which to retrieve the number of perceived objects.
170 * @return The number of perceived objects.
171 */
172inline uint8_t getNumberOfPerceivedObjects(const CollectivePerceptionMessage &cpm) {
174}
175
179
182
188inline PerceivedObject getPerceivedObject(const WrappedCpmContainer &container, const uint8_t i) {
189 if (i >= getNumberOfPerceivedObjects(container)) {
190 throw std::invalid_argument("Index out of range");
192 return container.container_data_perceived_object_container.perceived_objects.array[i];
193}
194
202 */
203inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) {
204 if (!object.object_id_is_present) {
205 throw std::invalid_argument("No object_id present in PerceivedObject");
206 }
207 return object.object_id.value;
208}
209
216inline int32_t getCartesianCoordinate(const CartesianCoordinateWithConfidence &coordinate) {
217 return coordinate.value.value;
218}
219
221 * @brief Retrieves the confidence value from a CartesianCoordinateWithConfidence object.
222 *
223 * @param coordinate The CartesianCoordinateWithConfidence object from which to retrieve the confidence value.
224 * @return The confidence value of the CartesianCoordinateWithConfidence object in centimeters.
225 */
226inline uint16_t getCartesianCoordinateConfidence(const CartesianCoordinateWithConfidence &coordinate) {
227 return coordinate.confidence.value;
228}
229
236inline gm::Point getPositionOfPerceivedObject(const PerceivedObject &object) {
237 gm::Point point;
238 point.x = double(getCartesianCoordinate(object.position.x_coordinate)) / 100.0;
239 point.y = double(getCartesianCoordinate(object.position.y_coordinate)) / 100.0;
240 if (object.position.z_coordinate_is_present) {
241 point.z = double(getCartesianCoordinate(object.position.z_coordinate)) / 100.0;
242 }
243 return point;
244}
245
250 * @return std::tuple<double, double, double> x,y and z standard deviations of the positions in meters.
251 * The z standard deviation is infinity if the z coordinate is not present.
252 */
253inline std::tuple<double, double, double> getPositionConfidenceOfPerceivedObject(const PerceivedObject &object) {
254 double x_confidence = double(getCartesianCoordinateConfidence(object.position.x_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
255 double y_confidence = double(getCartesianCoordinateConfidence(object.position.y_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
256 double z_confidence = object.position.z_coordinate_is_present
257 ? double(getCartesianCoordinateConfidence(object.position.z_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR
258 : std::numeric_limits<double>::infinity();
259 return std::make_tuple(x_confidence, y_confidence, z_confidence);
260}
261
263 * @brief Get the Cartesian angle of the PerceivedObject
264 *
265 * @param object PerceivedObject to get the Cartesian angle from
266 * @return unit16_t Cartesian angle of the PerceivedObject in 0,1 degrees
267 */
268inline uint16_t getCartesianAngle(const CartesianAngle &angle) { return angle.value.value; }
269
276inline uint8_t getCartesianAngleConfidence(const CartesianAngle &angle) { return angle.confidence.value; }
277
288inline gm::Quaternion getOrientationOfPerceivedObject(const PerceivedObject &object) {
289 if (!object.angles_is_present) throw std::invalid_argument("No angles present in PerceivedObject");
290 tf2::Quaternion q;
291 double roll{0}, pitch{0}, yaw{0};
292
293 if (object.angles.x_angle_is_present) {
294 roll = (((double(getCartesianAngle(object.angles.x_angle)) / 10.0) ) / 180.0) *
295 M_PI;
296 }
297 if (object.angles.y_angle_is_present) {
298 pitch = (((double(getCartesianAngle(object.angles.y_angle)) / 10.0) ) / 180.0) *
299 M_PI;
300 }
301 yaw = (((double(getCartesianAngle(object.angles.z_angle)) / 10.0)) / 180.0) *
302 M_PI;
303 // This wraps from -pi ti pi because setRPY only uses cos and sin of the angles
304 q.setRPY(roll, pitch, yaw);
305
306 return tf2::toMsg(q);
307}
308
315inline double getYawOfPerceivedObject(const PerceivedObject &object) {
316 gm::Quaternion orientation = getOrientationOfPerceivedObject(object);
317 tf2::Quaternion q(orientation.x, orientation.y, orientation.z, orientation.w);
318 double roll, pitch, yaw;
319 tf2::Matrix3x3(q).getRPY(roll, pitch, yaw);
320 return yaw;
321}
322
330inline double getYawConfidenceOfPerceivedObject(const PerceivedObject &object) {
331 if(!object.angles_is_present) throw std::invalid_argument("No angles present in PerceivedObject");
332 double yaw_confidence = object.angles.z_angle.confidence.value / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
333 yaw_confidence *= M_PI / 180.0; // convert to radians
334 return yaw_confidence;
335}
336
343inline gm::Pose getPoseOfPerceivedObject(const PerceivedObject &object) {
344 gm::Pose pose;
345 pose.position = getPositionOfPerceivedObject(object);
346 pose.orientation = getOrientationOfPerceivedObject(object);
347 return pose;
348}
349
357inline double getYawRateOfPerceivedObject(const PerceivedObject &object) {
358 if (!object.z_angular_velocity_is_present) throw std::invalid_argument("No yaw rate present in PerceivedObject");
359 return object.z_angular_velocity.value.value * M_PI / 180.0; // convert to rad/s
360}
361
371inline double getYawRateConfidenceOfPerceivedObject(const PerceivedObject &object) {
372 if (!object.z_angular_velocity_is_present) throw std::invalid_argument("No yaw rate present in PerceivedObject");
373 auto val = object.z_angular_velocity.confidence.value;
374 static const std::map<uint8_t, double> confidence_map = {
375 {AngularSpeedConfidence::UNAVAILABLE, 0.0},
376 {AngularSpeedConfidence::DEG_SEC_01, 1.0},
377 {AngularSpeedConfidence::DEG_SEC_02, 2.0},
378 {AngularSpeedConfidence::DEG_SEC_05, 5.0},
379 {AngularSpeedConfidence::DEG_SEC_10, 10.0},
380 {AngularSpeedConfidence::DEG_SEC_20, 20.0},
381 {AngularSpeedConfidence::DEG_SEC_50, 50.0},
382 {AngularSpeedConfidence::OUT_OF_RANGE, std::numeric_limits<double>::infinity()},
383 };
384 return confidence_map.at(val) * M_PI / 180.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR; // convert to rad/s
385}
386
393inline double getVelocityComponent(const VelocityComponent &velocity) { return double(velocity.value.value) / 100.0; }
394
401inline double getVelocityComponentConfidence(const VelocityComponent &velocity) {
402 return double(velocity.confidence.value) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
403}
404
412inline gm::Vector3 getCartesianVelocityOfPerceivedObject(const PerceivedObject &object) {
413 if (!object.velocity_is_present) {
414 throw std::invalid_argument("No velocity present in PerceivedObject");
415 }
416 gm::Vector3 velocity;
417 if (object.velocity.choice == Velocity3dWithConfidence::CHOICE_POLAR_VELOCITY) {
418 double speed = getSpeed(object.velocity.polar_velocity.velocity_magnitude);
419 double angle = getCartesianAngle(object.velocity.polar_velocity.velocity_direction) * M_PI / 180.0 / 10.0; // convert to radians
420 velocity.x = speed * cos(angle);
421 velocity.y = speed * sin(angle);
422 if (object.velocity.polar_velocity.z_velocity_is_present) {
423 velocity.z = getVelocityComponent(object.velocity.polar_velocity.z_velocity);
424 }
425 } else if (object.velocity.choice == Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY) {
426 velocity.x = getVelocityComponent(object.velocity.cartesian_velocity.x_velocity);
427 velocity.y = getVelocityComponent(object.velocity.cartesian_velocity.y_velocity);
428 if (object.velocity.cartesian_velocity.z_velocity_is_present) {
429 velocity.z = getVelocityComponent(object.velocity.cartesian_velocity.z_velocity);
430 }
431 } else {
432 throw std::invalid_argument("Velocity is neither Polar nor Cartesian");
433 }
434 return velocity;
435}
436
445inline std::tuple<double, double, double> getCartesianVelocityConfidenceOfPerceivedObject(const PerceivedObject &object) {
446 if (!object.velocity_is_present) {
447 throw std::invalid_argument("No velocity present in PerceivedObject");
448 }
449 if (object.velocity.choice == Velocity3dWithConfidence::CHOICE_POLAR_VELOCITY) {
450 double speed_confidence = getSpeedConfidence(object.velocity.polar_velocity.velocity_magnitude);
451 double angle_confidence = getCartesianAngleConfidence(object.velocity.polar_velocity.velocity_direction) * M_PI / 180.0 / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR; // convert to radians
452 double speed = getSpeed(object.velocity.polar_velocity.velocity_magnitude);
453 double angle = getCartesianAngle(object.velocity.polar_velocity.velocity_direction) * M_PI / 180.0 / 10.0; // convert to radians
454 double lateral_confidence = speed * angle_confidence; // not exactly, but best approximation
455 double x_confidence = speed_confidence * cos(angle) * cos(angle)
456 + lateral_confidence * sin(angle) * sin(angle);
457 double y_confidence = speed_confidence * sin(angle) * sin(angle)
458 + lateral_confidence * cos(angle) * cos(angle);
459 // neglect xy covariance, as it is not present in the output of this function
460 double z_confidence = object.velocity.polar_velocity.z_velocity_is_present
461 ? getVelocityComponentConfidence(object.velocity.polar_velocity.z_velocity)
462 : std::numeric_limits<double>::infinity();
463 return std::make_tuple(x_confidence, y_confidence, z_confidence);
464 } else if (object.velocity.choice == Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY) {
465 double x_confidence = getVelocityComponentConfidence(object.velocity.cartesian_velocity.x_velocity);
466 double y_confidence = getVelocityComponentConfidence(object.velocity.cartesian_velocity.y_velocity);
467 double z_confidence = object.velocity.cartesian_velocity.z_velocity_is_present
468 ? getVelocityComponentConfidence(object.velocity.cartesian_velocity.z_velocity)
469 : std::numeric_limits<double>::infinity();
470 return std::make_tuple(x_confidence, y_confidence, z_confidence);
471 } else {
472 throw std::invalid_argument("Velocity is neither Polar nor Cartesian");
473 }
474
475}
476
483inline double getAccelerationComponent(const AccelerationComponent &acceleration) {
484 return double(acceleration.value.value) / 10.0;
485}
486
493inline double getAccelerationComponentConfidence(const AccelerationComponent &acceleration) {
494 return double(acceleration.confidence.value) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
495}
496
504inline gm::Vector3 getCartesianAccelerationOfPerceivedObject(const PerceivedObject &object) {
505 if (!object.acceleration_is_present) {
506 throw std::invalid_argument("No acceleration present in PerceivedObject");
507 }
508 gm::Vector3 acceleration;
509
510 if (object.acceleration.choice == Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION) {
511 acceleration.x = getAccelerationComponent(object.acceleration.cartesian_acceleration.x_acceleration);
512 acceleration.y = getAccelerationComponent(object.acceleration.cartesian_acceleration.y_acceleration);
513 if (object.acceleration.cartesian_acceleration.z_acceleration_is_present) {
514 acceleration.z = getAccelerationComponent(object.acceleration.cartesian_acceleration.z_acceleration);
515 }
516 } else if (object.acceleration.choice == Acceleration3dWithConfidence::CHOICE_POLAR_ACCELERATION) {
517 double magnitude = getAccelerationMagnitude(object.acceleration.polar_acceleration.acceleration_magnitude);
518 double angle = getCartesianAngle(object.acceleration.polar_acceleration.acceleration_direction) * M_PI / 180.0 / 10.0; // convert to radians
519 acceleration.x = magnitude * cos(angle);
520 acceleration.y = magnitude * sin(angle);
521 if (object.acceleration.polar_acceleration.z_acceleration_is_present) {
522 acceleration.z = getAccelerationComponent(object.acceleration.polar_acceleration.z_acceleration);
523 }
524 } else {
525 throw std::invalid_argument("Acceleration is neither Cartesian nor Polar");
526 }
527
528 return acceleration;
529}
530
539inline std::tuple<double, double, double> getCartesianAccelerationConfidenceOfPerceivedObject(const PerceivedObject &object) {
540 if (!object.acceleration_is_present) throw std::invalid_argument("No acceleration present in PerceivedObject");
541
542 if (object.acceleration.choice == Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION) {
543 double x_confidence = getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.x_acceleration);
544 double y_confidence = getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.y_acceleration);
545 double z_confidence = object.acceleration.cartesian_acceleration.z_acceleration_is_present
546 ? getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.z_acceleration)
547 : std::numeric_limits<double>::infinity();
548 return std::make_tuple(x_confidence, y_confidence, z_confidence);
549 } else if (object.acceleration.choice == Acceleration3dWithConfidence::CHOICE_POLAR_ACCELERATION) {
550 double magnitude_confidence = getAccelerationMagnitudeConfidence(object.acceleration.polar_acceleration.acceleration_magnitude);
551 double angle_confidence = getCartesianAngleConfidence(object.acceleration.polar_acceleration.acceleration_direction) * M_PI / 180.0 / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR; // convert to radians
552 double magnitude = getAccelerationMagnitude(object.acceleration.polar_acceleration.acceleration_magnitude);
553 double angle = getCartesianAngle(object.acceleration.polar_acceleration.acceleration_direction) * M_PI / 180.0 / 10.0; // convert to radians
554 double lateral_confidence = magnitude * angle_confidence; // best approximation
555 double x_confidence = magnitude_confidence * cos(angle) * cos(angle)
556 + lateral_confidence * sin(angle) * sin(angle);
557 double y_confidence = magnitude_confidence * sin(angle) * sin(angle)
558 + lateral_confidence * cos(angle) * cos(angle);
559 // neglect xy covariance, as it is not present in the output of this function
560 double z_confidence = object.acceleration.polar_acceleration.z_acceleration_is_present
561 ? getAccelerationComponentConfidence(object.acceleration.polar_acceleration.z_acceleration)
562 : std::numeric_limits<double>::infinity();
563 return std::make_tuple(x_confidence, y_confidence, z_confidence);
564 } else {
565 throw std::invalid_argument("Acceleration is neither Cartesian nor Polar");
566 }
567}
568
580inline uint16_t getXDimensionOfPerceivedObject(const PerceivedObject &object) {
581 if (!object.object_dimension_x_is_present) throw std::invalid_argument("No x-dimension present in PerceivedObject");
582 return object.object_dimension_x.value.value;
583}
584
592inline uint8_t getXDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
593 if (!object.object_dimension_x_is_present) throw std::invalid_argument("No x-dimension present in PerceivedObject");
594 return object.object_dimension_x.confidence.value;
595}
596
608inline uint16_t getYDimensionOfPerceivedObject(const PerceivedObject &object) {
609 if (!object.object_dimension_y_is_present) throw std::invalid_argument("No y-dimension present in PerceivedObject");
610 return object.object_dimension_y.value.value;
611}
612
620inline uint8_t getYDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
621 if (!object.object_dimension_y_is_present) throw std::invalid_argument("No y-dimension present in PerceivedObject");
622 return object.object_dimension_y.confidence.value;
623}
624
636inline uint16_t getZDimensionOfPerceivedObject(const PerceivedObject &object) {
637 if (!object.object_dimension_z_is_present) throw std::invalid_argument("No z-dimension present in PerceivedObject");
638 return object.object_dimension_z.value.value;
639}
640
648inline uint8_t getZDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
649 if (!object.object_dimension_z_is_present) throw std::invalid_argument("No z-dimension present in PerceivedObject");
650 return object.object_dimension_z.confidence.value;
651}
652
662inline gm::Vector3 getDimensionsOfPerceivedObject(const PerceivedObject &object) {
663 gm::Vector3 dimensions;
664 dimensions.x = double(getXDimensionOfPerceivedObject(object)) / 10.0;
665 dimensions.y = double(getYDimensionOfPerceivedObject(object)) / 10.0;
666 dimensions.z = double(getZDimensionOfPerceivedObject(object)) / 10.0;
667 return dimensions;
668}
669
676inline std::tuple<double, double, double> getDimensionsConfidenceOfPerceivedObject(const PerceivedObject &object) {
677 double conf_x = double(getXDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
678 double conf_y = double(getYDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
679 double conf_z = double(getZDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
680 return {conf_x, conf_y, conf_z};
681}
682
693inline gm::PointStamped getUTMPositionOfPerceivedObject(const CollectivePerceptionMessage &cpm,
694 const PerceivedObject &object) {
695 gm::PointStamped utm_position;
696 gm::PointStamped reference_position = getUTMPosition(cpm);
697 gm::Point relative_position = getPositionOfPerceivedObject(object);
698
699 utm_position.header.frame_id = reference_position.header.frame_id;
700 utm_position.point.x = reference_position.point.x + relative_position.x;
701 utm_position.point.y = reference_position.point.y + relative_position.y;
702 utm_position.point.z = reference_position.point.z + relative_position.z;
703
704 return utm_position;
705}
706
716inline const std::array<double, 4> getWGSRefPosConfidence(const CollectivePerceptionMessage &cpm) {
717 return getWGSPosConfidenceEllipse(cpm.payload.management_container.reference_position.position_confidence_ellipse);
718}
719
726inline uint8_t getSensorID(const SensorInformation &sensor_information) {
727 return sensor_information.sensor_id.value;
728}
729
736inline uint8_t getSensorType(const SensorInformation &sensor_information) {
737 return sensor_information.sensor_type.value;
738}
739
740} // namespace etsi_its_cpm_ts_msgs::access
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v2.1.1.
double getYawRateConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Yaw Rate Confidence Of Perceived Object.
double getSpeed(const Speed &speed)
Get the vehicle speed.
double getAccelerationMagnitude(const AccelerationMagnitude &acceleration_magnitude)
Get the AccelerationMagnitude value.
std::tuple< double, double, double > getDimensionsConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Dimensions Confidence Of Perceived Object.
std::tuple< double, double, double > getCartesianAccelerationConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Cartesian Acceleration Confidence Of Perceived Object.
double getYawConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Yaw Confidence Of Perceived Object object.
int32_t getCartesianCoordinate(const CartesianCoordinateWithConfidence &coordinate)
Retrieves the Cartesian coordinate value from a CartesianCoordinateWithConfidence object.
double getAltitude(const Altitude &altitude)
Get the Altitude value.
uint16_t getZDimensionOfPerceivedObject(const PerceivedObject &object)
Retrieves the z-dimension of a perceived object.
uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container)
gm::Point getPositionOfPerceivedObject(const PerceivedObject &object)
uint64_t getReferenceTimeValue(const CollectivePerceptionMessage &cpm)
Get the ReferenceTime-Value.
uint16_t getCartesianCoordinateConfidence(const CartesianCoordinateWithConfidence &coordinate)
Retrieves the confidence value from a CartesianCoordinateWithConfidence object.
uint8_t getCartesianAngleConfidence(const CartesianAngle &angle)
Get the confidence of the Cartesian angle.
uint16_t getYDimensionOfPerceivedObject(const PerceivedObject &object)
Retrieves the y-dimension of a perceived object.
double getVelocityComponent(const VelocityComponent &velocity)
Get the velocity component of the PerceivedObject.
WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm)
Retrieves the perceived object container from a CPM.
uint8_t getSensorType(const SensorInformation &sensor_information)
Get the sensorType of a SensorInformation object.
double getYawRateOfPerceivedObject(const PerceivedObject &object)
Get the yaw rate of the PerceivedObject.
gm::Vector3 getDimensionsOfPerceivedObject(const PerceivedObject &object)
Retrieves the dimensions of a perceived object.
gm::Pose getPoseOfPerceivedObject(const PerceivedObject &object)
Get the pose of the PerceivedObject.
double getSpeedConfidence(const Speed &speed)
Get the Speed Confidence.
double getYawOfPerceivedObject(const PerceivedObject &object)
Get the yaw of the PerceivedObject.
double getLongitude(const Longitude &longitude)
Get the Longitude value.
uint32_t getStationID(const ItsPduHeader &header)
Get the StationID of ItsPduHeader.
uint8_t getYDimensionConfidenceOfPerceivedObject(const PerceivedObject &object)
Gets the confidence of the y-dimension of a perceived object.
gm::PointStamped getUTMPositionOfPerceivedObject(const CollectivePerceptionMessage &cpm, const PerceivedObject &object)
Calculates the UTM position of a perceived object based on the CPMs referencep position.
double getLatitude(const Latitude &latitude)
Get the Latitude value.
std::tuple< double, double, double > getCartesianVelocityConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Cartesian Velocity Confidence Of Perceived Object object.
uint8_t getZDimensionConfidenceOfPerceivedObject(const PerceivedObject &object)
Gets the confidence of the z-dimension of a perceived object.
uint16_t getCartesianAngle(const CartesianAngle &angle)
Get the Cartesian angle of the PerceivedObject.
double getVelocityComponentConfidence(const VelocityComponent &velocity)
Get the confidence of the velocity component.
std::array< double, 4 > getWGSPosConfidenceEllipse(const PosConfidenceEllipse &position_confidence_ellipse)
Get the covariance matrix of the position confidence ellipse.
uint8_t getXDimensionConfidenceOfPerceivedObject(const PerceivedObject &object)
Gets the confidence of the x-dimension of a perceived object.
uint16_t getIdOfPerceivedObject(const PerceivedObject &object)
Retrieves the ID of a perceived object.
gm::Vector3 getCartesianVelocityOfPerceivedObject(const PerceivedObject &object)
Get the Cartesian velocity of the PerceivedObject.
uint16_t getXDimensionOfPerceivedObject(const PerceivedObject &object)
Gets the x-dimension of a perceived object.
double getAccelerationMagnitudeConfidence(const AccelerationMagnitude &acceleration_magnitude)
Get the AccelerationMagnitude Confidence.
uint8_t getSensorID(const SensorInformation &sensor_information)
Get the sensorId of a SensorInformation object.
TimestampIts getReferenceTime(const CollectivePerceptionMessage &cpm)
Get the Reference Time object.
std::vector< uint8_t > getCpmContainerIds(const CollectivePerceptionMessage &cpm)
Retrieves the container IDs from a CPM.
double getAccelerationComponentConfidence(const AccelerationComponent &acceleration)
Get the confidence of the acceleration component.
const std::array< double, 4 > getWGSRefPosConfidence(const CollectivePerceptionMessage &cpm)
Get the confidence ellipse of the reference position as Covariance matrix.
WrappedCpmContainer getCpmContainer(const CollectivePerceptionMessage &cpm, const uint8_t container_id)
PerceivedObject getPerceivedObject(const WrappedCpmContainer &container, const uint8_t i)
Retrieves the PerceivedObject at the specified index from the given WrappedCpmContainer.
gm::Vector3 getCartesianAccelerationOfPerceivedObject(const PerceivedObject &object)
Get the Cartesian acceleration of the PerceivedObject.
double getAccelerationComponent(const AccelerationComponent &acceleration)
Get the acceleration component of the PerceivedObject.
std::tuple< double, double, double > getPositionConfidenceOfPerceivedObject(const PerceivedObject &object)
Get the Position Confidences Of Perceived Object.
gm::Quaternion getOrientationOfPerceivedObject(const PerceivedObject &object)
Calculates the orientation of a perceived object.
gm::PointStamped getUTMPosition(const T &reference_position, int &zone, bool &northp)
Get the UTM Position defined by the given ReferencePosition.