etsi_its_messages v3.1.0
 
Loading...
Searching...
No Matches
cpm_ts_getters.h
Go to the documentation of this file.
1/*
2=============================================================================
3MIT License
4
5Copyright (c) 2023-2025 Institute for Automotive Engineering (ika), RWTH Aachen University
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24=============================================================================
25*/
26
31
32#pragma once
33
34#include <tuple>
35
36namespace etsi_its_cpm_ts_msgs::access {
37
39
48inline uint32_t getStationID(const CollectivePerceptionMessage &cpm) { return getStationID(cpm.header); }
49
56inline TimestampIts getReferenceTime(const CollectivePerceptionMessage &cpm) {
57 return cpm.payload.management_container.reference_time;
58}
59
66inline uint64_t getReferenceTimeValue(const CollectivePerceptionMessage &cpm) { return getReferenceTime(cpm).value; }
67
74inline double getLatitude(const CollectivePerceptionMessage &cpm) {
75 return getLatitude(cpm.payload.management_container.reference_position.latitude);
76}
77
84inline double getLongitude(const CollectivePerceptionMessage &cpm) {
85 return getLongitude(cpm.payload.management_container.reference_position.longitude);
86}
90
94inline double getAltitude(const CollectivePerceptionMessage &cpm) {
95 return getAltitude(cpm.payload.management_container.reference_position.altitude);
96}
97
104 * @param[in] cpm CPM to get the UTM Position from
105 * @param[out] zone the UTM zone (zero means UPS)
106 * @param[out] northp hemisphere (true means north, false means south)
107 * @return geometry_msgs::PointStamped of the given position with the UTM zone and hemisphere as frame_id
108 */
109inline gm::PointStamped getUTMPosition(const CollectivePerceptionMessage &cpm, int &zone, bool &northp) {
110 return getUTMPosition(cpm.payload.management_container.reference_position, zone, northp);
111}
112
122inline gm::PointStamped getUTMPosition(const CollectivePerceptionMessage &cpm) {
123 int zone;
124 bool northp;
125 return getUTMPosition(cpm, zone, northp);
126}
127
137inline std::vector<uint8_t> getCpmContainerIds(const CollectivePerceptionMessage &cpm) {
138 std::vector<uint8_t> container_ids;
139 for (int i = 0; i < cpm.payload.cpm_containers.value.array.size(); i++) {
140 container_ids.push_back(cpm.payload.cpm_containers.value.array[i].container_id.value);
141 }
142 return container_ids;
144
152 */
153inline WrappedCpmContainer getCpmContainer(const CollectivePerceptionMessage &cpm, const uint8_t container_id) {
154 for (int i = 0; i < cpm.payload.cpm_containers.value.array.size(); i++) {
155 if (cpm.payload.cpm_containers.value.array[i].container_id.value == container_id) {
156 return cpm.payload.cpm_containers.value.array[i];
157 }
158 }
159 throw std::invalid_argument("No Container with ID " + std::to_string(container_id) + " found in CPM");
160}
161
163 * @brief Retrieves the perceived object container from a CPM.
164 *
165 * This function returns the perceived object container from the given CPM.
166 *
167 * @param cpm The CPM from which to retrieve the perceived object container.
168 * @return The perceived object container.
169 */
170inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
171 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
172}
173
181inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
182 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
183 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
184 }
185 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
186 return number;
187}
188
195inline uint8_t getNumberOfPerceivedObjects(const CollectivePerceptionMessage &cpm) {
196 return getNumberOfPerceivedObjects(getPerceivedObjectContainer(cpm));
197}
198
200
202
211inline PerceivedObject getPerceivedObject(const WrappedCpmContainer &container, const uint8_t i) {
212 if (i >= getNumberOfPerceivedObjects(container)) {
213 throw std::invalid_argument("Index out of range");
214 }
215 return container.container_data_perceived_object_container.perceived_objects.array[i];
216}
217
224 * @return The ID of the perceived object.
225 */
226inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
227
228
234inline int32_t getCartesianCoordinate(const CartesianCoordinateWithConfidence &coordinate) {
235 return coordinate.value.value;
236}
241
244inline uint16_t getCartesianCoordinateConfidence(const CartesianCoordinateWithConfidence &coordinate) {
245 return coordinate.confidence.value;
246}
247
251 * @param object The perceived object.
252 * @return The position of the perceived object as a gm::Point (all values in meters).
253 */
254inline gm::Point getPositionOfPerceivedObject(const PerceivedObject &object) {
255 gm::Point point;
256 point.x = double(getCartesianCoordinate(object.position.x_coordinate)) / 100.0;
257 point.y = double(getCartesianCoordinate(object.position.y_coordinate)) / 100.0;
258 if (object.position.z_coordinate_is_present) {
259 point.z = double(getCartesianCoordinate(object.position.z_coordinate)) / 100.0;
261 return point;
262}
263
270 */
271inline std::tuple<double, double, double> getPositionConfidenceOfPerceivedObject(const PerceivedObject &object) {
272 double x_confidence = double(getCartesianCoordinateConfidence(object.position.x_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
273 double y_confidence = double(getCartesianCoordinateConfidence(object.position.y_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
274 double z_confidence = object.position.z_coordinate_is_present
275 ? double(getCartesianCoordinateConfidence(object.position.z_coordinate)) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR
276 : std::numeric_limits<double>::infinity();
277 return std::make_tuple(x_confidence, y_confidence, z_confidence);
278}
279
280/**
281 * @brief Get the Cartesian angle of the PerceivedObject
282 *
283 * @param object PerceivedObject to get the Cartesian angle from
284 * @return unit16_t Cartesian angle of the PerceivedObject in 0,1 degrees
285 */
286inline uint16_t getCartesianAngle(const CartesianAngle &angle) { return angle.value.value; }
287
292 * @return uint8_t confidence of the Cartesian angle in 0,1 degrees
293 */
294inline uint8_t getCartesianAngleConfidence(const CartesianAngle &angle) { return angle.confidence.value; }
295
299
306inline gm::Quaternion getOrientationOfPerceivedObject(const PerceivedObject &object) {
307 if (!object.angles_is_present) throw std::invalid_argument("No angles present in PerceivedObject");
308 tf2::Quaternion q;
309 double roll{0}, pitch{0}, yaw{0};
310
311 if (object.angles.x_angle_is_present) {
312 roll = (((double(getCartesianAngle(object.angles.x_angle)) / 10.0) ) / 180.0) *
313 M_PI;
314 }
315 if (object.angles.y_angle_is_present) {
316 pitch = (((double(getCartesianAngle(object.angles.y_angle)) / 10.0) ) / 180.0) *
317 M_PI;
318 }
319 yaw = (((double(getCartesianAngle(object.angles.z_angle)) / 10.0)) / 180.0) *
320 M_PI;
321 // This wraps from -pi ti pi because setRPY only uses cos and sin of the angles
322 q.setRPY(roll, pitch, yaw);
323
324 return tf2::toMsg(q);
325}
326
333inline double getYawOfPerceivedObject(const PerceivedObject &object) {
334 gm::Quaternion orientation = getOrientationOfPerceivedObject(object);
335 tf2::Quaternion q(orientation.x, orientation.y, orientation.z, orientation.w);
336 double roll, pitch, yaw;
337 tf2::Matrix3x3(q).getRPY(roll, pitch, yaw);
338 return yaw;
339}
340
345 * @return double The standard deviation of the yaw angle in radians
346 * @throws std::invalid_argument If the angles are not present in the object.
347 */
348inline double getYawConfidenceOfPerceivedObject(const PerceivedObject &object) {
349 if(!object.angles_is_present) throw std::invalid_argument("No angles present in PerceivedObject");
350 double yaw_confidence = object.angles.z_angle.confidence.value / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
351 yaw_confidence *= M_PI / 180.0; // convert to radians
352 return yaw_confidence;
353}
354
361inline gm::Pose getPoseOfPerceivedObject(const PerceivedObject &object) {
362 gm::Pose pose;
363 pose.position = getPositionOfPerceivedObject(object);
364 pose.orientation = getOrientationOfPerceivedObject(object);
365 return pose;
366}
367
373 * @throws std::invalid_argument If the yaw rate is not present in the object.
374 */
375inline double getYawRateOfPerceivedObject(const PerceivedObject &object) {
376 if (!object.z_angular_velocity_is_present) throw std::invalid_argument("No yaw rate present in PerceivedObject");
377 return object.z_angular_velocity.value.value * M_PI / 180.0; // convert to rad/s
378}
379
383 * @param object The PerceivedObject to get the yaw rate confidence from
384 * @return double The standard deviation of the yaw rate in rad/s
385 * As defined in the TS, this is rounded up to the next possible value
386 * @throws std::invalid_argument If the yaw rate is not present in the object.
387 *
388 */
389inline double getYawRateConfidenceOfPerceivedObject(const PerceivedObject &object) {
390 if (!object.z_angular_velocity_is_present) throw std::invalid_argument("No yaw rate present in PerceivedObject");
391 auto val = object.z_angular_velocity.confidence.value;
392 static const std::map<uint8_t, double> confidence_map = {
393 {AngularSpeedConfidence::UNAVAILABLE, 0.0},
394 {AngularSpeedConfidence::DEG_SEC_01, 1.0},
395 {AngularSpeedConfidence::DEG_SEC_02, 2.0},
396 {AngularSpeedConfidence::DEG_SEC_05, 5.0},
397 {AngularSpeedConfidence::DEG_SEC_10, 10.0},
398 {AngularSpeedConfidence::DEG_SEC_20, 20.0},
399 {AngularSpeedConfidence::DEG_SEC_50, 50.0},
400 {AngularSpeedConfidence::OUT_OF_RANGE, std::numeric_limits<double>::infinity()},
401 };
402 return confidence_map.at(val) * M_PI / 180.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR; // convert to rad/s
403}
404
411inline double getVelocityComponent(const VelocityComponent &velocity) { return double(velocity.value.value) / 100.0; }
412
416
419inline double getVelocityComponentConfidence(const VelocityComponent &velocity) {
420 return double(velocity.confidence.value) / 100.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
421}
422
426 * @param object PerceivedObject to get the Cartesian velocity from
427 * @return gm::Vector3 Cartesian velocity of the PerceivedObject in m/s (local coordinate system)
428 * @throws std::invalid_argument If the velocity is no cartesian velocity.
429 */
430inline gm::Vector3 getCartesianVelocityOfPerceivedObject(const PerceivedObject &object) {
431 if (!object.velocity_is_present) throw std::invalid_argument("No velocity present in PerceivedObject");
432 if (object.velocity.choice != Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY) {
433 throw std::invalid_argument("Velocity is not Cartesian");
434 }
435 gm::Vector3 velocity;
436 velocity.x = getVelocityComponent(object.velocity.cartesian_velocity.x_velocity);
437 velocity.y = getVelocityComponent(object.velocity.cartesian_velocity.y_velocity);
438 if (object.velocity.cartesian_velocity.z_velocity_is_present) {
439 velocity.z = getVelocityComponent(object.velocity.cartesian_velocity.z_velocity);
440 }
441 return velocity;
443
450
452inline std::tuple<double, double, double> getCartesianVelocityConfidenceOfPerceivedObject(const PerceivedObject &object) {
453 if (!object.velocity_is_present) throw std::invalid_argument("No velocity present in PerceivedObject");
454 if (object.velocity.choice != Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY) {
455 throw std::invalid_argument("Velocity is not Cartesian");
456 }
457 double x_confidence = getVelocityComponentConfidence(object.velocity.cartesian_velocity.x_velocity);
458 double y_confidence = getVelocityComponentConfidence(object.velocity.cartesian_velocity.y_velocity);
459 double z_confidence = object.velocity.cartesian_velocity.z_velocity_is_present
460 ? getVelocityComponentConfidence(object.velocity.cartesian_velocity.z_velocity)
461 : std::numeric_limits<double>::infinity();
462 return std::make_tuple(x_confidence, y_confidence, z_confidence);
463}
464
470 */
471inline double getAccelerationComponent(const AccelerationComponent &acceleration) {
472 return double(acceleration.value.value) / 10.0;
473}
474
477
481inline double getAccelerationComponentConfidence(const AccelerationComponent &acceleration) {
482 return double(acceleration.confidence.value) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
483}
487
492inline gm::Vector3 getCartesianAccelerationOfPerceivedObject(const PerceivedObject &object) {
493 if (!object.acceleration_is_present) throw std::invalid_argument("No acceleration present in PerceivedObject");
494 if (object.acceleration.choice != Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION) {
495 throw std::invalid_argument("Acceleration is not Cartesian");
496 }
497 gm::Vector3 acceleration;
498 acceleration.x = getAccelerationComponent(object.acceleration.cartesian_acceleration.x_acceleration);
499 acceleration.y = getAccelerationComponent(object.acceleration.cartesian_acceleration.y_acceleration);
500 if (object.acceleration.cartesian_acceleration.z_acceleration_is_present) {
501 acceleration.z = getAccelerationComponent(object.acceleration.cartesian_acceleration.z_acceleration);
502 }
503 return acceleration;
504}
505
506
514inline std::tuple<double, double, double> getCartesianAccelerationConfidenceOfPerceivedObject(const PerceivedObject &object) {
515 if (!object.acceleration_is_present) throw std::invalid_argument("No acceleration present in PerceivedObject");
516 if (object.acceleration.choice != Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION) {
517 throw std::invalid_argument("Acceleration is not Cartesian");
518 }
519 double x_confidence = getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.x_acceleration);
520 double y_confidence = getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.y_acceleration);
521 double z_confidence = object.acceleration.cartesian_acceleration.z_acceleration_is_present
522 ? getAccelerationComponentConfidence(object.acceleration.cartesian_acceleration.z_acceleration)
523 : std::numeric_limits<double>::infinity();
524 return std::make_tuple(x_confidence, y_confidence, z_confidence);
525}
526
534 * @param object The PerceivedObject from which to retrieve the x-dimension.
535 * @return The x-dimension of the perceived object in decimeters.
536 * @throws std::invalid_argument if the x-dimension is not present in the PerceivedObject.
537 */
538inline uint16_t getXDimensionOfPerceivedObject(const PerceivedObject &object) {
539 if (!object.object_dimension_x_is_present) throw std::invalid_argument("No x-dimension present in PerceivedObject");
540 return object.object_dimension_x.value.value;
541}
542
543/**
544 * @brief Gets the confidence of the x-dimension of a perceived object.
545 *
546 * @param object The PerceivedObject from which to retrieve the x-dimension confidence.
547 * @return uint8_t The confidence of the x-dimension of the perceived object in decimeters.
548 * @throws std::invalid_argument if the x-dimension is not present in the PerceivedObject.
549 */
550inline uint8_t getXDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
551 if (!object.object_dimension_x_is_present) throw std::invalid_argument("No x-dimension present in PerceivedObject");
552 return object.object_dimension_x.confidence.value;
553}
554
560 * std::invalid_argument exception.
561 *
562 * @param object The PerceivedObject from which to retrieve the y-dimension.
563 * @return uint16_t y-dimension of the perceived object in in decimeters.
564 * @throws std::invalid_argument if the y-dimension is not present in the PerceivedObject.
565 */
566inline uint16_t getYDimensionOfPerceivedObject(const PerceivedObject &object) {
567 if (!object.object_dimension_y_is_present) throw std::invalid_argument("No y-dimension present in PerceivedObject");
568 return object.object_dimension_y.value.value;
569}
570
578inline uint8_t getYDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
579 if (!object.object_dimension_y_is_present) throw std::invalid_argument("No y-dimension present in PerceivedObject");
580 return object.object_dimension_y.confidence.value;
581}
582
594inline uint16_t getZDimensionOfPerceivedObject(const PerceivedObject &object) {
595 if (!object.object_dimension_z_is_present) throw std::invalid_argument("No z-dimension present in PerceivedObject");
596 return object.object_dimension_z.value.value;
597}
598
606inline uint8_t getZDimensionConfidenceOfPerceivedObject(const PerceivedObject &object) {
607 if (!object.object_dimension_z_is_present) throw std::invalid_argument("No z-dimension present in PerceivedObject");
608 return object.object_dimension_z.confidence.value;
609}
610
615
620inline gm::Vector3 getDimensionsOfPerceivedObject(const PerceivedObject &object) {
621 gm::Vector3 dimensions;
622 dimensions.x = double(getXDimensionOfPerceivedObject(object)) / 10.0;
623 dimensions.y = double(getYDimensionOfPerceivedObject(object)) / 10.0;
624 dimensions.z = double(getZDimensionOfPerceivedObject(object)) / 10.0;
625 return dimensions;
626}
627
629
634inline std::tuple<double, double, double> getDimensionsConfidenceOfPerceivedObject(const PerceivedObject &object) {
635 double conf_x = double(getXDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
636 double conf_y = double(getYDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
637 double conf_z = double(getZDimensionConfidenceOfPerceivedObject(object)) / 10.0 / etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR;
638 return {conf_x, conf_y, conf_z};
639}
640
643
650 */
651inline gm::PointStamped getUTMPositionOfPerceivedObject(const CollectivePerceptionMessage &cpm,
652 const PerceivedObject &object) {
653 gm::PointStamped utm_position;
654 gm::PointStamped reference_position = getUTMPosition(cpm);
655 gm::Point relative_position = getPositionOfPerceivedObject(object);
656
657 utm_position.header.frame_id = reference_position.header.frame_id;
658 utm_position.point.x = reference_position.point.x + relative_position.x;
659 utm_position.point.y = reference_position.point.y + relative_position.y;
660 utm_position.point.z = reference_position.point.z + relative_position.z;
661
662 return utm_position;
663}
668
674inline const std::array<double, 4> getWGSRefPosConfidence(const CollectivePerceptionMessage &cpm) {
675 return getWGSPosConfidenceEllipse(cpm.payload.management_container.reference_position.position_confidence_ellipse);
676}
677
678} // namespace etsi_its_cpm_ts_msgs::access
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.
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 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.
double getYawRateOfPerceivedObject(const PerceivedObject &object)
Get the yaw rate of the PerceivedObject.
gm::Pose getPoseOfPerceivedObject(const PerceivedObject &object)
Get the pose 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.
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.
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.
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.