diff --git a/cpm__ts__getters_8h.html b/cpm__ts__getters_8h.html index d3357cf5..6ab4debe 100644 --- a/cpm__ts__getters_8h.html +++ b/cpm__ts__getters_8h.html @@ -360,14 +360,14 @@

686}
687
696inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
697 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
697 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
698}
699
707inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
708 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
708 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
709 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
710 }
-
711 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
711 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
712 return number;
713}
714
@@ -380,7 +380,7 @@

738 if (i >= getNumberOfPerceivedObjects(container)) {
739 throw std::invalid_argument("Index out of range");
740 }
-
741 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
741 return container.container_data_perceived_object_container.perceived_objects.array[i];
742}
743
752inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -773,14 +773,14 @@

697}
698
707inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
708 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
708 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
709}
710
718inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
719 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
719 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
720 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
721 }
-
722 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
722 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
723 return number;
724}
725
@@ -793,7 +793,7 @@

749 if (i >= getNumberOfPerceivedObjects(container)) {
750 throw std::invalid_argument("Index out of range");
751 }
-
752 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
752 return container.container_data_perceived_object_container.perceived_objects.array[i];
753}
754
763inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -1309,14 +1309,14 @@

768}
769
778inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
779 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
779 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
780}
781
789inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
790 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
790 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
791 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
792 }
-
793 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
793 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
794 return number;
795}
796
@@ -1329,7 +1329,7 @@

820 if (i >= getNumberOfPerceivedObjects(container)) {
821 throw std::invalid_argument("Index out of range");
822 }
-
823 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
823 return container.container_data_perceived_object_container.perceived_objects.array[i];
824}
825
834inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -2435,14 +2435,14 @@

786}
787
796inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
797 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
797 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
798}
799
807inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
808 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
808 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
809 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
810 }
-
811 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
811 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
812 return number;
813}
814
@@ -2455,7 +2455,7 @@

838 if (i >= getNumberOfPerceivedObjects(container)) {
839 throw std::invalid_argument("Index out of range");
840 }
-
841 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
841 return container.container_data_perceived_object_container.perceived_objects.array[i];
842}
843
852inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -2769,14 +2769,14 @@

722}
723
732inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
733 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
733 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
734}
735
743inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
744 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
744 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
745 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
746 }
-
747 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
747 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
748 return number;
749}
750
@@ -2789,7 +2789,7 @@

774 if (i >= getNumberOfPerceivedObjects(container)) {
775 throw std::invalid_argument("Index out of range");
776 }
-
777 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
777 return container.container_data_perceived_object_container.perceived_objects.array[i];
778}
779
788inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -3112,14 +3112,14 @@

738}
739
748inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
749 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
749 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
750}
751
759inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
760 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
760 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
761 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
762 }
-
763 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
763 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
764 return number;
765}
766
@@ -3132,7 +3132,7 @@

790 if (i >= getNumberOfPerceivedObjects(container)) {
791 throw std::invalid_argument("Index out of range");
792 }
-
793 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
793 return container.container_data_perceived_object_container.perceived_objects.array[i];
794}
795
804inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
@@ -3374,14 +3374,14 @@

754}
755
764inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
765 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
765 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
766}
767
775inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
776 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
776 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
777 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
778 }
-
779 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
779 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
780 return number;
781}
782
@@ -3394,7 +3394,7 @@

806 if (i >= getNumberOfPerceivedObjects(container)) {
807 throw std::invalid_argument("Index out of range");
808 }
-
809 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
809 return container.container_data_perceived_object_container.perceived_objects.array[i];
810}
811
820inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
diff --git a/cpm__ts__getters_8h_source.html b/cpm__ts__getters_8h_source.html index 4fe242ef..c07aa811 100644 --- a/cpm__ts__getters_8h_source.html +++ b/cpm__ts__getters_8h_source.html @@ -178,15 +178,15 @@
168inline WrappedCpmContainer getPerceivedObjectContainer(const CollectivePerceptionMessage &cpm) {
-
169 return getCpmContainer(cpm, CpmContainerId::PERCEIVED_OBJECT_CONTAINER);
+
169 return getCpmContainer(cpm, WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER);
170}
171
179inline uint8_t getNumberOfPerceivedObjects(const WrappedCpmContainer &container) {
-
180 if (container.container_id.value != CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
+
180 if (container.container_id.value != WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
181 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
182 }
-
183 uint8_t number = container.container_data.perceived_object_container.number_of_perceived_objects.value;
+
183 uint8_t number = container.container_data_perceived_object_container.number_of_perceived_objects.value;
184 return number;
185}
@@ -202,7 +202,7 @@
211 throw std::invalid_argument("Index out of range");
212 }
-
213 return container.container_data.perceived_object_container.perceived_objects.array[i];
+
213 return container.container_data_perceived_object_container.perceived_objects.array[i];
214}
215
224inline uint16_t getIdOfPerceivedObject(const PerceivedObject &object) { return object.object_id.value; }
diff --git a/cpm__ts__setters_8h.html b/cpm__ts__setters_8h.html index 599b7767..cf114ee5 100644 --- a/cpm__ts__setters_8h.html +++ b/cpm__ts__setters_8h.html @@ -288,7 +288,7 @@

Definition at line 717 of file cpm_ts_setters.h.

+

Definition at line 715 of file cpm_ts_setters.h.

@@ -335,284 +335,282 @@

Definition at line 694 of file cpm_ts_setters.h.

-
729 {
-
730
- -
732
-
742inline void setItsPduHeader(CollectivePerceptionMessage& cpm, const uint32_t station_id,
-
743 const uint8_t protocol_version = 0) {
-
744 setItsPduHeader(cpm.header, MessageId::CPM, station_id, protocol_version);
-
745}
-
746
-
758inline void setReferenceTime(
-
759 CollectivePerceptionMessage& cpm, const uint64_t unix_nanosecs,
-
760 const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second) {
-
761 TimestampIts t_its;
-
762 setTimestampITS(t_its, unix_nanosecs, n_leap_seconds);
-
763 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX, "TimestampIts");
-
764 cpm.payload.management_container.reference_time = t_its;
-
765}
-
766
-
778inline void setReferencePosition(CollectivePerceptionMessage& cpm, const double latitude, const double longitude,
-
779 const double altitude = AltitudeValue::UNAVAILABLE) {
-
780 setReferencePosition(cpm.payload.management_container.reference_position, latitude, longitude, altitude);
-
781}
-
782
-
795inline void setFromUTMPosition(CollectivePerceptionMessage& cpm, const gm::PointStamped& utm_position, const int& zone,
-
796 const bool& northp) {
-
797 setFromUTMPosition(cpm.payload.management_container.reference_position, utm_position, zone, northp);
-
798}
-
799
-
808inline void setIdOfPerceivedObject(PerceivedObject& object, const uint16_t id) {
-
809 object.object_id.value = id;
-
810 object.object_id_is_present = true;
-
811}
-
812
-
824inline void setMeasurementDeltaTimeOfPerceivedObject(PerceivedObject& object, const int16_t delta_time = 0) {
-
825 if (delta_time < DeltaTimeMilliSecondSigned::MIN || delta_time > DeltaTimeMilliSecondSigned::MAX) {
-
826 throw std::invalid_argument("MeasurementDeltaTime out of range");
-
827 } else {
-
828 object.measurement_delta_time.value = delta_time;
-
829 }
-
830}
-
831
-
845inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int32_t value,
-
846 const uint16_t confidence = CoordinateConfidence::UNAVAILABLE) {
-
847 // limit value range
-
848 if (value < CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE) {
-
849 coordinate.value.value = CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE;
-
850 } else if (value > CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE) {
-
851 coordinate.value.value = CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE;
-
852 } else {
-
853 coordinate.value.value = value;
-
854 }
-
855
-
856 // limit confidence range
-
857 if (confidence > CoordinateConfidence::MAX || confidence < CoordinateConfidence::MIN) {
-
858 coordinate.confidence.value = CoordinateConfidence::OUT_OF_RANGE;
-
859 } else {
-
860 coordinate.confidence.value = confidence;
-
861 }
-
862}
-
863
-
875inline void setPositionOfPerceivedObject(PerceivedObject& object, const gm::Point& point,
-
876 const uint16_t x_confidence = CoordinateConfidence::UNAVAILABLE,
-
877 const uint16_t y_confidence = CoordinateConfidence::UNAVAILABLE,
-
878 const uint16_t z_confidence = CoordinateConfidence::UNAVAILABLE) {
-
879 setCartesianCoordinateWithConfidence(object.position.x_coordinate, point.x * 100, x_confidence * 100);
-
880 setCartesianCoordinateWithConfidence(object.position.y_coordinate, point.y * 100, y_confidence * 100);
-
881 if (point.z != 0.0) {
-
882 setCartesianCoordinateWithConfidence(object.position.z_coordinate, point.z * 100, z_confidence * 100);
-
883 object.position.z_coordinate_is_present = true;
-
884 }
-
885}
-
886
-
902inline void setUTMPositionOfPerceivedObject(CollectivePerceptionMessage& cpm, PerceivedObject& object,
-
903 const gm::PointStamped& utm_position,
-
904 const uint16_t x_confidence = CoordinateConfidence::UNAVAILABLE,
-
905 const uint16_t y_confidence = CoordinateConfidence::UNAVAILABLE,
-
906 const uint16_t z_confidence = CoordinateConfidence::UNAVAILABLE) {
-
907 gm::PointStamped reference_position = getUTMPosition(cpm);
-
908 if (utm_position.header.frame_id != reference_position.header.frame_id) {
-
909 throw std::invalid_argument("UTM-Position frame_id (" + utm_position.header.frame_id +
-
910 ") does not match the reference position frame_id (" + reference_position.header.frame_id +
-
911 ")");
-
912 }
-
913 setCartesianCoordinateWithConfidence(object.position.x_coordinate,
-
914 (utm_position.point.x - reference_position.point.x) * 100, x_confidence);
-
915 setCartesianCoordinateWithConfidence(object.position.y_coordinate,
-
916 (utm_position.point.y - reference_position.point.y) * 100, y_confidence);
-
917 if (utm_position.point.z != 0.0) {
-
918 setCartesianCoordinateWithConfidence(object.position.z_coordinate,
-
919 (utm_position.point.z - reference_position.point.z) * 100, z_confidence);
-
920 object.position.z_coordinate_is_present = true;
-
921 }
-
922}
-
923
-
935inline void setVelocityComponent(VelocityComponent& velocity, const int16_t value,
-
936 const uint8_t confidence = SpeedConfidence::UNAVAILABLE) {
-
937 // limit value range
-
938 if (value < VelocityComponentValue::NEGATIVE_OUT_OF_RANGE) {
-
939 velocity.value.value = VelocityComponentValue::NEGATIVE_OUT_OF_RANGE;
-
940 } else if (value > VelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
-
941 velocity.value.value = VelocityComponentValue::POSITIVE_OUT_OF_RANGE;
-
942 } else {
-
943 velocity.value.value = value;
-
944 }
-
945
-
946 // limit confidence range
-
947 if (confidence > SpeedConfidence::MAX || confidence < SpeedConfidence::MIN) {
-
948 velocity.confidence.value = SpeedConfidence::OUT_OF_RANGE;
-
949 } else {
-
950 velocity.confidence.value = confidence;
-
951 }
-
952}
-
953
-
966inline void setVelocityOfPerceivedObject(PerceivedObject& object, const gm::Vector3& cartesian_velocity,
-
967 const uint8_t x_confidence = SpeedConfidence::UNAVAILABLE,
-
968 const uint8_t y_confidence = SpeedConfidence::UNAVAILABLE,
-
969 const uint8_t z_confidence = SpeedConfidence::UNAVAILABLE) {
-
970 object.velocity.choice = Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY;
-
971 setVelocityComponent(object.velocity.cartesian_velocity.x_velocity, cartesian_velocity.x * 100, x_confidence * 100);
-
972 setVelocityComponent(object.velocity.cartesian_velocity.y_velocity, cartesian_velocity.y * 100, y_confidence * 100);
-
973 if (cartesian_velocity.z != 0.0) {
-
974 setVelocityComponent(object.velocity.cartesian_velocity.z_velocity, cartesian_velocity.z * 100, z_confidence * 100);
-
975 object.velocity.cartesian_velocity.z_velocity_is_present = true;
-
976 }
-
977 object.velocity_is_present = true;
-
978}
-
979
-
991inline void setAccelerationComponent(AccelerationComponent& acceleration, const int16_t value,
-
992 const uint8_t confidence = AccelerationConfidence::UNAVAILABLE) {
-
993 // limit value range
-
994 if (value < AccelerationValue::NEGATIVE_OUT_OF_RANGE) {
-
995 acceleration.value.value = AccelerationValue::NEGATIVE_OUT_OF_RANGE;
-
996 } else if (value > AccelerationValue::POSITIVE_OUT_OF_RANGE) {
-
997 acceleration.value.value = AccelerationValue::POSITIVE_OUT_OF_RANGE;
-
998 } else {
-
999 acceleration.value.value = value;
-
1000 }
-
1001
-
1002 // limit confidence range
-
1003 if (confidence > AccelerationConfidence::MAX || confidence < AccelerationConfidence::MIN) {
-
1004 acceleration.confidence.value = AccelerationConfidence::OUT_OF_RANGE;
-
1005 } else {
-
1006 acceleration.confidence.value = confidence;
-
1007 }
-
1008}
-
1009
-
1022inline void setAccelerationOfPerceivedObject(PerceivedObject& object, const gm::Vector3& cartesian_acceleration,
-
1023 const uint8_t x_confidence = AccelerationConfidence::UNAVAILABLE,
-
1024 const uint8_t y_confidence = AccelerationConfidence::UNAVAILABLE,
-
1025 const uint8_t z_confidence = AccelerationConfidence::UNAVAILABLE) {
-
1026 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION;
-
1027 setAccelerationComponent(object.acceleration.cartesian_acceleration.x_acceleration, cartesian_acceleration.x * 10,
-
1028 x_confidence * 10);
-
1029 setAccelerationComponent(object.acceleration.cartesian_acceleration.y_acceleration, cartesian_acceleration.y * 10,
-
1030 y_confidence * 10);
-
1031 if (cartesian_acceleration.z != 0.0) {
-
1032 setAccelerationComponent(object.acceleration.cartesian_acceleration.z_acceleration, cartesian_acceleration.z * 10,
-
1033 z_confidence * 10);
-
1034 object.acceleration.cartesian_acceleration.z_acceleration_is_present = true;
-
1035 }
-
1036 object.acceleration_is_present = true;
-
1037}
-
1038
-
1049inline void setYawOfPerceivedObject(PerceivedObject& object, const double yaw,
-
1050 const uint8_t confidence = AngleConfidence::UNAVAILABLE) {
-
1051 // wrap angle to range [0, 360]
-
1052 double yaw_in_degrees = yaw * 180 / M_PI + 180; // TODO: check if this is correct
-
1053 while (yaw_in_degrees > 360.0) yaw_in_degrees -= 360.0;
-
1054 while (yaw_in_degrees < 0) yaw_in_degrees += 360.0;
-
1055 object.angles.z_angle.value.value = yaw_in_degrees * 10;
-
1056
-
1057 if (confidence > AngleConfidence::MAX || confidence < AngleConfidence::MIN) {
-
1058 object.angles.z_angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
-
1059 } else {
-
1060 object.angles.z_angle.confidence.value = confidence;
-
1061 }
-
1062 object.angles_is_present = true;
-
1063}
-
1064
-
1076inline void setYawRateOfPerceivedObject(PerceivedObject& object, const double yaw_rate,
-
1077 const uint8_t confidence = AngularSpeedConfidence::UNAVAILABLE) {
-
1078 int16_t yaw_rate_in_degrees = yaw_rate * 180 / M_PI;
-
1079 if (yaw_rate_in_degrees != CartesianAngularVelocityComponentValue::UNAVAILABLE) {
-
1080 // limit value range
-
1081 if (yaw_rate_in_degrees < CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE) {
-
1082 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE;
-
1083 } else if (yaw_rate_in_degrees > CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
-
1084 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE;
-
1085 }
-
1086 }
-
1087 object.z_angular_velocity.value.value = yaw_rate_in_degrees;
-
1088 object.z_angular_velocity.confidence.value = confidence;
-
1089 object.z_angular_velocity_is_present = true;
-
1090}
-
1091
-
1106inline void setObjectDimension(ObjectDimension& dimension, const uint16_t value,
-
1107 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
-
1108 // limit value range
-
1109 if (value < ObjectDimensionValue::MIN || value > ObjectDimensionValue::MAX) {
-
1110 dimension.value.value = ObjectDimensionValue::OUT_OF_RANGE;
-
1111 } else {
-
1112 dimension.value.value = value;
-
1113 }
-
1114
-
1115 // limit confidence range
-
1116 if (confidence > ObjectDimensionConfidence::MAX || confidence < ObjectDimensionConfidence::MIN) {
-
1117 dimension.confidence.value = ObjectDimensionConfidence::OUT_OF_RANGE;
-
1118 } else {
-
1119 dimension.confidence.value = confidence;
-
1120 }
-
1121}
-
1122
-
1133inline void setXDimensionOfPerceivedObject(PerceivedObject& object, const double value,
-
1134 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
-
1135 setObjectDimension(object.object_dimension_x, (uint16_t)(value * 10), confidence * 10);
-
1136 object.object_dimension_x_is_present = true;
-
1137}
-
1138
-
1149inline void setYDimensionOfPerceivedObject(PerceivedObject& object, const double value,
-
1150 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
-
1151 setObjectDimension(object.object_dimension_y, (uint16_t)(value * 10), confidence * 10);
-
1152 object.object_dimension_y_is_present = true;
-
1153}
-
1154
-
1165inline void setZDimensionOfPerceivedObject(PerceivedObject& object, const double value,
-
1166 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
-
1167 setObjectDimension(object.object_dimension_z, (uint16_t)(value * 10), confidence * 10);
-
1168 object.object_dimension_z_is_present = true;
-
1169}
-
1170
-
1182inline void setDimensionsOfPerceivedObject(PerceivedObject& object, const gm::Vector3& dimensions,
-
1183 const uint8_t x_confidence = ObjectDimensionConfidence::UNAVAILABLE,
-
1184 const uint8_t y_confidence = ObjectDimensionConfidence::UNAVAILABLE,
-
1185 const uint8_t z_confidence = ObjectDimensionConfidence::UNAVAILABLE) {
-
1186 setXDimensionOfPerceivedObject(object, dimensions.x, x_confidence);
-
1187 setYDimensionOfPerceivedObject(object, dimensions.y, y_confidence);
-
1188 setZDimensionOfPerceivedObject(object, dimensions.z, z_confidence);
-
1189}
-
1190
-
1200inline void initPerceivedObject(PerceivedObject& object, const gm::Point& point, const int16_t delta_time = 0) {
-
1201 setPositionOfPerceivedObject(object, point);
-
1202 setMeasurementDeltaTimeOfPerceivedObject(object, delta_time);
-
1203}
-
1204
-
1217inline void initPerceivedObjectWithUTMPosition(CollectivePerceptionMessage& cpm, PerceivedObject& object,
-
1218 const gm::PointStamped& point, const int16_t delta_time = 0) {
-
1219 setUTMPositionOfPerceivedObject(cpm, object, point);
-
1220 setMeasurementDeltaTimeOfPerceivedObject(object, delta_time);
-
1221}
-
1222
-
1232inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1233 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1234 container.container_data.choice = container.container_id;
-
1235 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1236}
-
1237
-
1251inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1252 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1253 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1254 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1255 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1256 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1257 } else {
-
1258 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1259 }
-
1260}
-
1261
-
1274inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1275 // check for maximum number of containers
-
1276 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1277 cpm.payload.cpm_containers.value.array.push_back(container);
-
1278 } else {
-
1279 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1280 }
-
1281}
-
1282
-
1283} // namespace etsi_its_cpm_ts_msgs::access
+

Definition at line 693 of file cpm_ts_setters.h.

+
728 {
+
729
+ +
731
+
741inline void setItsPduHeader(CollectivePerceptionMessage& cpm, const uint32_t station_id,
+
742 const uint8_t protocol_version = 0) {
+
743 setItsPduHeader(cpm.header, MessageId::CPM, station_id, protocol_version);
+
744}
+
745
+
757inline void setReferenceTime(
+
758 CollectivePerceptionMessage& cpm, const uint64_t unix_nanosecs,
+
759 const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second) {
+
760 TimestampIts t_its;
+
761 setTimestampITS(t_its, unix_nanosecs, n_leap_seconds);
+
762 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX, "TimestampIts");
+
763 cpm.payload.management_container.reference_time = t_its;
+
764}
+
765
+
777inline void setReferencePosition(CollectivePerceptionMessage& cpm, const double latitude, const double longitude,
+
778 const double altitude = AltitudeValue::UNAVAILABLE) {
+
779 setReferencePosition(cpm.payload.management_container.reference_position, latitude, longitude, altitude);
+
780}
+
781
+
794inline void setFromUTMPosition(CollectivePerceptionMessage& cpm, const gm::PointStamped& utm_position, const int& zone,
+
795 const bool& northp) {
+
796 setFromUTMPosition(cpm.payload.management_container.reference_position, utm_position, zone, northp);
+
797}
+
798
+
807inline void setIdOfPerceivedObject(PerceivedObject& object, const uint16_t id) {
+
808 object.object_id.value = id;
+
809 object.object_id_is_present = true;
+
810}
+
811
+
823inline void setMeasurementDeltaTimeOfPerceivedObject(PerceivedObject& object, const int16_t delta_time = 0) {
+
824 if (delta_time < DeltaTimeMilliSecondSigned::MIN || delta_time > DeltaTimeMilliSecondSigned::MAX) {
+
825 throw std::invalid_argument("MeasurementDeltaTime out of range");
+
826 } else {
+
827 object.measurement_delta_time.value = delta_time;
+
828 }
+
829}
+
830
+
844inline void setCartesianCoordinateWithConfidence(CartesianCoordinateWithConfidence& coordinate, const int32_t value,
+
845 const uint16_t confidence = CoordinateConfidence::UNAVAILABLE) {
+
846 // limit value range
+
847 if (value < CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE) {
+
848 coordinate.value.value = CartesianCoordinateLarge::NEGATIVE_OUT_OF_RANGE;
+
849 } else if (value > CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE) {
+
850 coordinate.value.value = CartesianCoordinateLarge::POSITIVE_OUT_OF_RANGE;
+
851 } else {
+
852 coordinate.value.value = value;
+
853 }
+
854
+
855 // limit confidence range
+
856 if (confidence > CoordinateConfidence::MAX || confidence < CoordinateConfidence::MIN) {
+
857 coordinate.confidence.value = CoordinateConfidence::OUT_OF_RANGE;
+
858 } else {
+
859 coordinate.confidence.value = confidence;
+
860 }
+
861}
+
862
+
874inline void setPositionOfPerceivedObject(PerceivedObject& object, const gm::Point& point,
+
875 const uint16_t x_confidence = CoordinateConfidence::UNAVAILABLE,
+
876 const uint16_t y_confidence = CoordinateConfidence::UNAVAILABLE,
+
877 const uint16_t z_confidence = CoordinateConfidence::UNAVAILABLE) {
+
878 setCartesianCoordinateWithConfidence(object.position.x_coordinate, point.x * 100, x_confidence * 100);
+
879 setCartesianCoordinateWithConfidence(object.position.y_coordinate, point.y * 100, y_confidence * 100);
+
880 if (point.z != 0.0) {
+
881 setCartesianCoordinateWithConfidence(object.position.z_coordinate, point.z * 100, z_confidence * 100);
+
882 object.position.z_coordinate_is_present = true;
+
883 }
+
884}
+
885
+
901inline void setUTMPositionOfPerceivedObject(CollectivePerceptionMessage& cpm, PerceivedObject& object,
+
902 const gm::PointStamped& utm_position,
+
903 const uint16_t x_confidence = CoordinateConfidence::UNAVAILABLE,
+
904 const uint16_t y_confidence = CoordinateConfidence::UNAVAILABLE,
+
905 const uint16_t z_confidence = CoordinateConfidence::UNAVAILABLE) {
+
906 gm::PointStamped reference_position = getUTMPosition(cpm);
+
907 if (utm_position.header.frame_id != reference_position.header.frame_id) {
+
908 throw std::invalid_argument("UTM-Position frame_id (" + utm_position.header.frame_id +
+
909 ") does not match the reference position frame_id (" + reference_position.header.frame_id +
+
910 ")");
+
911 }
+
912 setCartesianCoordinateWithConfidence(object.position.x_coordinate,
+
913 (utm_position.point.x - reference_position.point.x) * 100, x_confidence);
+
914 setCartesianCoordinateWithConfidence(object.position.y_coordinate,
+
915 (utm_position.point.y - reference_position.point.y) * 100, y_confidence);
+
916 if (utm_position.point.z != 0.0) {
+
917 setCartesianCoordinateWithConfidence(object.position.z_coordinate,
+
918 (utm_position.point.z - reference_position.point.z) * 100, z_confidence);
+
919 object.position.z_coordinate_is_present = true;
+
920 }
+
921}
+
922
+
934inline void setVelocityComponent(VelocityComponent& velocity, const int16_t value,
+
935 const uint8_t confidence = SpeedConfidence::UNAVAILABLE) {
+
936 // limit value range
+
937 if (value < VelocityComponentValue::NEGATIVE_OUT_OF_RANGE) {
+
938 velocity.value.value = VelocityComponentValue::NEGATIVE_OUT_OF_RANGE;
+
939 } else if (value > VelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
+
940 velocity.value.value = VelocityComponentValue::POSITIVE_OUT_OF_RANGE;
+
941 } else {
+
942 velocity.value.value = value;
+
943 }
+
944
+
945 // limit confidence range
+
946 if (confidence > SpeedConfidence::MAX || confidence < SpeedConfidence::MIN) {
+
947 velocity.confidence.value = SpeedConfidence::OUT_OF_RANGE;
+
948 } else {
+
949 velocity.confidence.value = confidence;
+
950 }
+
951}
+
952
+
965inline void setVelocityOfPerceivedObject(PerceivedObject& object, const gm::Vector3& cartesian_velocity,
+
966 const uint8_t x_confidence = SpeedConfidence::UNAVAILABLE,
+
967 const uint8_t y_confidence = SpeedConfidence::UNAVAILABLE,
+
968 const uint8_t z_confidence = SpeedConfidence::UNAVAILABLE) {
+
969 object.velocity.choice = Velocity3dWithConfidence::CHOICE_CARTESIAN_VELOCITY;
+
970 setVelocityComponent(object.velocity.cartesian_velocity.x_velocity, cartesian_velocity.x * 100, x_confidence * 100);
+
971 setVelocityComponent(object.velocity.cartesian_velocity.y_velocity, cartesian_velocity.y * 100, y_confidence * 100);
+
972 if (cartesian_velocity.z != 0.0) {
+
973 setVelocityComponent(object.velocity.cartesian_velocity.z_velocity, cartesian_velocity.z * 100, z_confidence * 100);
+
974 object.velocity.cartesian_velocity.z_velocity_is_present = true;
+
975 }
+
976 object.velocity_is_present = true;
+
977}
+
978
+
990inline void setAccelerationComponent(AccelerationComponent& acceleration, const int16_t value,
+
991 const uint8_t confidence = AccelerationConfidence::UNAVAILABLE) {
+
992 // limit value range
+
993 if (value < AccelerationValue::NEGATIVE_OUT_OF_RANGE) {
+
994 acceleration.value.value = AccelerationValue::NEGATIVE_OUT_OF_RANGE;
+
995 } else if (value > AccelerationValue::POSITIVE_OUT_OF_RANGE) {
+
996 acceleration.value.value = AccelerationValue::POSITIVE_OUT_OF_RANGE;
+
997 } else {
+
998 acceleration.value.value = value;
+
999 }
+
1000
+
1001 // limit confidence range
+
1002 if (confidence > AccelerationConfidence::MAX || confidence < AccelerationConfidence::MIN) {
+
1003 acceleration.confidence.value = AccelerationConfidence::OUT_OF_RANGE;
+
1004 } else {
+
1005 acceleration.confidence.value = confidence;
+
1006 }
+
1007}
+
1008
+
1021inline void setAccelerationOfPerceivedObject(PerceivedObject& object, const gm::Vector3& cartesian_acceleration,
+
1022 const uint8_t x_confidence = AccelerationConfidence::UNAVAILABLE,
+
1023 const uint8_t y_confidence = AccelerationConfidence::UNAVAILABLE,
+
1024 const uint8_t z_confidence = AccelerationConfidence::UNAVAILABLE) {
+
1025 object.acceleration.choice = Acceleration3dWithConfidence::CHOICE_CARTESIAN_ACCELERATION;
+
1026 setAccelerationComponent(object.acceleration.cartesian_acceleration.x_acceleration, cartesian_acceleration.x * 10,
+
1027 x_confidence * 10);
+
1028 setAccelerationComponent(object.acceleration.cartesian_acceleration.y_acceleration, cartesian_acceleration.y * 10,
+
1029 y_confidence * 10);
+
1030 if (cartesian_acceleration.z != 0.0) {
+
1031 setAccelerationComponent(object.acceleration.cartesian_acceleration.z_acceleration, cartesian_acceleration.z * 10,
+
1032 z_confidence * 10);
+
1033 object.acceleration.cartesian_acceleration.z_acceleration_is_present = true;
+
1034 }
+
1035 object.acceleration_is_present = true;
+
1036}
+
1037
+
1048inline void setYawOfPerceivedObject(PerceivedObject& object, const double yaw,
+
1049 const uint8_t confidence = AngleConfidence::UNAVAILABLE) {
+
1050 // wrap angle to range [0, 360]
+
1051 double yaw_in_degrees = yaw * 180 / M_PI + 180; // TODO: check if this is correct
+
1052 while (yaw_in_degrees > 360.0) yaw_in_degrees -= 360.0;
+
1053 while (yaw_in_degrees < 0) yaw_in_degrees += 360.0;
+
1054 object.angles.z_angle.value.value = yaw_in_degrees * 10;
+
1055
+
1056 if (confidence > AngleConfidence::MAX || confidence < AngleConfidence::MIN) {
+
1057 object.angles.z_angle.confidence.value = AngleConfidence::OUT_OF_RANGE;
+
1058 } else {
+
1059 object.angles.z_angle.confidence.value = confidence;
+
1060 }
+
1061 object.angles_is_present = true;
+
1062}
+
1063
+
1075inline void setYawRateOfPerceivedObject(PerceivedObject& object, const double yaw_rate,
+
1076 const uint8_t confidence = AngularSpeedConfidence::UNAVAILABLE) {
+
1077 int16_t yaw_rate_in_degrees = yaw_rate * 180 / M_PI;
+
1078 if (yaw_rate_in_degrees != CartesianAngularVelocityComponentValue::UNAVAILABLE) {
+
1079 // limit value range
+
1080 if (yaw_rate_in_degrees < CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE) {
+
1081 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::NEGATIVE_OUTOF_RANGE;
+
1082 } else if (yaw_rate_in_degrees > CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE) {
+
1083 yaw_rate_in_degrees = CartesianAngularVelocityComponentValue::POSITIVE_OUT_OF_RANGE;
+
1084 }
+
1085 }
+
1086 object.z_angular_velocity.value.value = yaw_rate_in_degrees;
+
1087 object.z_angular_velocity.confidence.value = confidence;
+
1088 object.z_angular_velocity_is_present = true;
+
1089}
+
1090
+
1105inline void setObjectDimension(ObjectDimension& dimension, const uint16_t value,
+
1106 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
+
1107 // limit value range
+
1108 if (value < ObjectDimensionValue::MIN || value > ObjectDimensionValue::MAX) {
+
1109 dimension.value.value = ObjectDimensionValue::OUT_OF_RANGE;
+
1110 } else {
+
1111 dimension.value.value = value;
+
1112 }
+
1113
+
1114 // limit confidence range
+
1115 if (confidence > ObjectDimensionConfidence::MAX || confidence < ObjectDimensionConfidence::MIN) {
+
1116 dimension.confidence.value = ObjectDimensionConfidence::OUT_OF_RANGE;
+
1117 } else {
+
1118 dimension.confidence.value = confidence;
+
1119 }
+
1120}
+
1121
+
1132inline void setXDimensionOfPerceivedObject(PerceivedObject& object, const double value,
+
1133 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
+
1134 setObjectDimension(object.object_dimension_x, (uint16_t)(value * 10), confidence * 10);
+
1135 object.object_dimension_x_is_present = true;
+
1136}
+
1137
+
1148inline void setYDimensionOfPerceivedObject(PerceivedObject& object, const double value,
+
1149 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
+
1150 setObjectDimension(object.object_dimension_y, (uint16_t)(value * 10), confidence * 10);
+
1151 object.object_dimension_y_is_present = true;
+
1152}
+
1153
+
1164inline void setZDimensionOfPerceivedObject(PerceivedObject& object, const double value,
+
1165 const uint8_t confidence = ObjectDimensionConfidence::UNAVAILABLE) {
+
1166 setObjectDimension(object.object_dimension_z, (uint16_t)(value * 10), confidence * 10);
+
1167 object.object_dimension_z_is_present = true;
+
1168}
+
1169
+
1181inline void setDimensionsOfPerceivedObject(PerceivedObject& object, const gm::Vector3& dimensions,
+
1182 const uint8_t x_confidence = ObjectDimensionConfidence::UNAVAILABLE,
+
1183 const uint8_t y_confidence = ObjectDimensionConfidence::UNAVAILABLE,
+
1184 const uint8_t z_confidence = ObjectDimensionConfidence::UNAVAILABLE) {
+
1185 setXDimensionOfPerceivedObject(object, dimensions.x, x_confidence);
+
1186 setYDimensionOfPerceivedObject(object, dimensions.y, y_confidence);
+
1187 setZDimensionOfPerceivedObject(object, dimensions.z, z_confidence);
+
1188}
+
1189
+
1199inline void initPerceivedObject(PerceivedObject& object, const gm::Point& point, const int16_t delta_time = 0) {
+
1200 setPositionOfPerceivedObject(object, point);
+
1201 setMeasurementDeltaTimeOfPerceivedObject(object, delta_time);
+
1202}
+
1203
+
1216inline void initPerceivedObjectWithUTMPosition(CollectivePerceptionMessage& cpm, PerceivedObject& object,
+
1217 const gm::PointStamped& point, const int16_t delta_time = 0) {
+
1218 setUTMPositionOfPerceivedObject(cpm, object, point);
+
1219 setMeasurementDeltaTimeOfPerceivedObject(object, delta_time);
+
1220}
+
1221
+
1231inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
+
1232 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1233 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1234}
+
1235
+
1249inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1250 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1251 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1252 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1253 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1254 } else {
+
1255 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1256 }
+
1257}
+
1258
+
1271inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1272 // check for maximum number of containers
+
1273 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1274 cpm.payload.cpm_containers.value.array.push_back(container);
+
1275 } else {
+
1276 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1277 }
+
1278}
+
1279
+
1280} // 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.
void setFromUTMPosition(CAM &cam, const gm::PointStamped &utm_position, const int &zone, const bool &northp)
Set the ReferencePosition of a CAM from a given UTM-Position.
void setReferencePosition(CAM &cam, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
Set the ReferencePosition for a CAM.
@@ -625,9 +623,9 @@

void setVelocityComponent(VelocityComponent &velocity, const int16_t value, const uint8_t confidence=SpeedConfidence::UNAVAILABLE)
Sets the value and confidence of a VelocityComponent.

void initPerceivedObjectContainer(WrappedCpmContainer &container, const uint8_t n_objects=0)
Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects.
void setYDimensionOfPerceivedObject(PerceivedObject &object, const double value, const uint8_t confidence=ObjectDimensionConfidence::UNAVAILABLE)
Sets the y-dimension of a perceived object.
-
void addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
+
void addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
void setObjectDimension(ObjectDimension &dimension, const uint16_t value, const uint8_t confidence=ObjectDimensionConfidence::UNAVAILABLE)
Sets the object dimension with the given value and confidence.
-
void addContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
+
void addContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
void setIdOfPerceivedObject(PerceivedObject &object, const uint16_t id)
Set the ID of a PerceivedObject.
void setReferenceTime(CollectivePerceptionMessage &cpm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Sets the reference time in a CPM.
void setYawOfPerceivedObject(PerceivedObject &object, const double yaw, const uint8_t confidence=AngleConfidence::UNAVAILABLE)
Sets the yaw angle of a perceived object.
@@ -975,32 +973,30 @@

1170}

1171
1181inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1182 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1183 container.container_data.choice = container.container_id;
-
1184 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1185}
-
1186
-
1200inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1201 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1202 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1203 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1204 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1205 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1206 } else {
-
1207 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1208 }
-
1209}
-
1210
-
1223inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1224 // check for maximum number of containers
-
1225 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1226 cpm.payload.cpm_containers.value.array.push_back(container);
-
1227 } else {
-
1228 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1229 }
-
1230}
-
1231
-
1232} // namespace etsi_its_cpm_ts_msgs::access
+
1182 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1183 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1184}
+
1185
+
1199inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1200 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1201 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1202 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1203 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1204 } else {
+
1205 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1206 }
+
1207}
+
1208
+
1221inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1222 // check for maximum number of containers
+
1223 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1224 cpm.payload.cpm_containers.value.array.push_back(container);
+
1225 } else {
+
1226 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1227 }
+
1228}
+
1229
+
1230} // namespace etsi_its_cpm_ts_msgs::access
@@ -1032,7 +1028,7 @@

Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects.

-

This function sets the container ID to PERCEIVED_OBJECT_CONTAINER and initializes the number of perceived objects in the container to the specified value.

+

This function sets the container ID to CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER and initializes the number of perceived objects in the container to the specified value.

Parameters
@@ -1293,32 +1289,30 @@

1202}
1203
1213inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1214 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1215 container.container_data.choice = container.container_id;
-
1216 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1217}
-
1218
-
1232inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1233 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1234 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1235 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1236 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1237 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1238 } else {
-
1239 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1240 }
-
1241}
-
1242
-
1255inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1256 // check for maximum number of containers
-
1257 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1258 cpm.payload.cpm_containers.value.array.push_back(container);
-
1259 } else {
-
1260 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1261 }
-
1262}
-
1263
-
1264} // namespace etsi_its_cpm_ts_msgs::access
+
1214 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1215 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1216}
+
1217
+
1231inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1232 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1233 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1234 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1235 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1236 } else {
+
1237 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1238 }
+
1239}
+
1240
+
1253inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1254 // check for maximum number of containers
+
1255 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1256 cpm.payload.cpm_containers.value.array.push_back(container);
+
1257 } else {
+
1258 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1259 }
+
1260}
+
1261
+
1262} // namespace etsi_its_cpm_ts_msgs::access
@@ -1623,32 +1617,30 @@

1187}
1188
1198inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1199 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1200 container.container_data.choice = container.container_id;
-
1201 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1202}
-
1203
-
1217inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1218 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1219 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1220 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1221 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1222 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1223 } else {
-
1224 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1225 }
-
1226}
-
1227
-
1240inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1241 // check for maximum number of containers
-
1242 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1243 cpm.payload.cpm_containers.value.array.push_back(container);
-
1244 } else {
-
1245 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1246 }
-
1247}
-
1248
-
1249} // namespace etsi_its_cpm_ts_msgs::access
+
1199 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1200 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1201}
+
1202
+
1216inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1217 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1218 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1219 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1220 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1221 } else {
+
1222 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1223 }
+
1224}
+
1225
+
1238inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1239 // check for maximum number of containers
+
1240 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1241 cpm.payload.cpm_containers.value.array.push_back(container);
+
1242 } else {
+
1243 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1244 }
+
1245}
+
1246
+
1247} // namespace etsi_its_cpm_ts_msgs::access
@@ -2270,32 +2262,30 @@

1152}
1153
1163inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1164 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1165 container.container_data.choice = container.container_id;
-
1166 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1167}
-
1168
-
1182inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1183 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1184 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1185 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1186 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1187 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1188 } else {
-
1189 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1190 }
-
1191}
-
1192
-
1205inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1206 // check for maximum number of containers
-
1207 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1208 cpm.payload.cpm_containers.value.array.push_back(container);
-
1209 } else {
-
1210 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1211 }
-
1212}
-
1213
-
1214} // namespace etsi_its_cpm_ts_msgs::access
+
1164 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1165 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1166}
+
1167
+
1181inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1182 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1183 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1184 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1185 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1186 } else {
+
1187 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1188 }
+
1189}
+
1190
+
1203inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1204 // check for maximum number of containers
+
1205 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1206 cpm.payload.cpm_containers.value.array.push_back(container);
+
1207 } else {
+
1208 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1209 }
+
1210}
+
1211
+
1212} // namespace etsi_its_cpm_ts_msgs::access
@@ -2911,13 +2901,14 @@

Definition at line 549 of file cpm_ts_setters.h.

-
558 {
-
559 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
560 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
561 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
562 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
563 container.container_data.perceived_object_container.perceived_objects.array.size();
-
564 } else {
+
557 {
+
558 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
559 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
560 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
561 container.container_data_perceived_object_container.perceived_objects.array.size();
+
562 } else {
+
563 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
564 }
@@ -3622,7 +3613,9 @@

Definition at line 576 of file cpm_ts_setters.h.

- +
579 {
+
580 // check for maximum number of containers
+
@@ -4028,32 +4021,30 @@

1119}
1120
1130inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1131 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1132 container.container_data.choice = container.container_id;
-
1133 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1134}
-
1135
-
1149inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1150 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1151 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1152 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1153 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1154 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1155 } else {
-
1156 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1157 }
-
1158}
-
1159
-
1172inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1173 // check for maximum number of containers
-
1174 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1175 cpm.payload.cpm_containers.value.array.push_back(container);
-
1176 } else {
-
1177 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1178 }
-
1179}
-
1180
-
1181} // namespace etsi_its_cpm_ts_msgs::access
+
1131 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1132 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1133}
+
1134
+
1148inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1149 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1150 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1151 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1152 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1153 } else {
+
1154 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1155 }
+
1156}
+
1157
+
1170inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1171 // check for maximum number of containers
+
1172 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1173 cpm.payload.cpm_containers.value.array.push_back(container);
+
1174 } else {
+
1175 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1176 }
+
1177}
+
1178
+
1179} // namespace etsi_its_cpm_ts_msgs::access
@@ -4352,32 +4343,30 @@

1135}
1136
1146inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
1147 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
1148 container.container_data.choice = container.container_id;
-
1149 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
1150}
-
1151
-
1165inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
1166 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
1167 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
1168 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
1169 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
1170 container.container_data.perceived_object_container.perceived_objects.array.size();
-
1171 } else {
-
1172 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
1173 }
-
1174}
-
1175
-
1188inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
1189 // check for maximum number of containers
-
1190 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
1191 cpm.payload.cpm_containers.value.array.push_back(container);
-
1192 } else {
-
1193 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
1194 }
-
1195}
-
1196
-
1197} // namespace etsi_its_cpm_ts_msgs::access
+
1147 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
1148 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
1149}
+
1150
+
1164inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
1165 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
1166 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
1167 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
1168 container.container_data_perceived_object_container.perceived_objects.array.size();
+
1169 } else {
+
1170 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
1171 }
+
1172}
+
1173
+
1186inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
1187 // check for maximum number of containers
+
1188 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
1189 cpm.payload.cpm_containers.value.array.push_back(container);
+
1190 } else {
+
1191 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
1192 }
+
1193}
+
1194
+
1195} // namespace etsi_its_cpm_ts_msgs::access
diff --git a/cpm__ts__setters_8h_source.html b/cpm__ts__setters_8h_source.html index 90d8b73c..e6dc519d 100644 --- a/cpm__ts__setters_8h_source.html +++ b/cpm__ts__setters_8h_source.html @@ -389,32 +389,30 @@
528}
529
539inline void initPerceivedObjectContainer(WrappedCpmContainer& container, const uint8_t n_objects = 0) {
-
540 container.container_id.value = CpmContainerId::PERCEIVED_OBJECT_CONTAINER;
-
541 container.container_data.choice = container.container_id;
-
542 container.container_data.perceived_object_container.number_of_perceived_objects.value = n_objects;
-
543}
-
544
-
558inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
-
559 if (container.container_id.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER &&
-
560 container.container_data.choice.value == CpmContainerId::PERCEIVED_OBJECT_CONTAINER) {
-
561 container.container_data.perceived_object_container.perceived_objects.array.push_back(perceived_object);
-
562 container.container_data.perceived_object_container.number_of_perceived_objects.value =
-
563 container.container_data.perceived_object_container.perceived_objects.array.size();
-
564 } else {
-
565 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
-
566 }
-
567}
-
568
-
581inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
-
582 // check for maximum number of containers
-
583 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
-
584 cpm.payload.cpm_containers.value.array.push_back(container);
-
585 } else {
-
586 throw std::invalid_argument("Maximum number of CPM-Containers reached");
-
587 }
-
588}
-
589
-
590} // namespace etsi_its_cpm_ts_msgs::access
+
540 container.container_id.value = WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER;
+
541 container.container_data_perceived_object_container.number_of_perceived_objects.value = n_objects;
+
542}
+
543
+
557inline void addPerceivedObjectToContainer(WrappedCpmContainer& container, const PerceivedObject& perceived_object) {
+
558 if (container.container_id.value == WrappedCpmContainer::CHOICE_CONTAINER_DATA_PERCEIVED_OBJECT_CONTAINER) {
+
559 container.container_data_perceived_object_container.perceived_objects.array.push_back(perceived_object);
+
560 container.container_data_perceived_object_container.number_of_perceived_objects.value =
+
561 container.container_data_perceived_object_container.perceived_objects.array.size();
+
562 } else {
+
563 throw std::invalid_argument("Container is not a PerceivedObjectContainer");
+
564 }
+
565}
+
566
+
579inline void addContainerToCPM(CollectivePerceptionMessage& cpm, const WrappedCpmContainer& container) {
+
580 // check for maximum number of containers
+
581 if (cpm.payload.cpm_containers.value.array.size() < WrappedCpmContainers::MAX_SIZE) {
+
582 cpm.payload.cpm_containers.value.array.push_back(container);
+
583 } else {
+
584 throw std::invalid_argument("Maximum number of CPM-Containers reached");
+
585 }
+
586}
+
587
+
588} // namespace etsi_its_cpm_ts_msgs::access
void setTimestampITS(TimestampIts &timestamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Set the TimestampITS object.
Definition cam_setters.h:83
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.
Definition cam_setters.h:66
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.
@@ -426,9 +424,9 @@
void setVelocityComponent(VelocityComponent &velocity, const int16_t value, const uint8_t confidence=SpeedConfidence::UNAVAILABLE)
Sets the value and confidence of a VelocityComponent.
void initPerceivedObjectContainer(WrappedCpmContainer &container, const uint8_t n_objects=0)
Initializes a WrappedCpmContainer as a PerceivedObjectContainer with the given number of objects.
void setYDimensionOfPerceivedObject(PerceivedObject &object, const double value, const uint8_t confidence=ObjectDimensionConfidence::UNAVAILABLE)
Sets the y-dimension of a perceived object.
-
void addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
+
void addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)
Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.
void setObjectDimension(ObjectDimension &dimension, const uint16_t value, const uint8_t confidence=ObjectDimensionConfidence::UNAVAILABLE)
Sets the object dimension with the given value and confidence.
-
void addContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
+
void addContainerToCPM(CollectivePerceptionMessage &cpm, const WrappedCpmContainer &container)
Adds a container to the Collective Perception Message (CPM).
void setIdOfPerceivedObject(PerceivedObject &object, const uint16_t id)
Set the ID of a PerceivedObject.
void setReferenceTime(CollectivePerceptionMessage &cpm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Sets the reference time in a CPM.
void setYawOfPerceivedObject(PerceivedObject &object, const double yaw, const uint8_t confidence=AngleConfidence::UNAVAILABLE)
Sets the yaw angle of a perceived object.

containerA reference to the WrappedCpmContainer to be initialized as a PerceivedObjectContainer.