etsi_its_messages 1.0.0
Loading...
Searching...
No Matches
denm_getters.h File Reference

Getter functions for the ETSI ITS DENM (EN) More...

Go to the source code of this file.

Functions

uint32_t etsi_its_denm_msgs::access::getStationID (const ItsPduHeader &header)
 Get the StationID of ItsPduHeader.
 
double etsi_its_denm_msgs::access::getLatitude (const Latitude &latitude)
 Get the Latitude value.
 
double etsi_its_denm_msgs::access::getLongitude (const Longitude &longitude)
 Get the Longitude value.
 
double etsi_its_denm_msgs::access::getAltitude (const Altitude &altitude)
 Get the Altitude value.
 
double etsi_its_denm_msgs::access::getSpeed (const Speed &speed)
 Get the vehicle speed.
 
std::vector< bool > etsi_its_denm_msgs::access::getBitString (const std::vector< uint8_t > &buffer, const int bits_unused)
 Get a Bit String in form of bool vector.
 
template<typename T >
gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition (const T &reference_position, int &zone, bool &northp)
 Get the UTM Position defined by the given ReferencePosition.
 
uint32_t etsi_its_denm_msgs::access::getStationID (const DENM &denm)
 Get the Station ID object.
 
TimestampIts etsi_its_denm_msgs::access::getReferenceTime (const DENM &denm)
 Get the Reference Time object.
 
uint64_t etsi_its_denm_msgs::access::getReferenceTimeValue (const DENM &denm)
 Get the ReferenceTime-Value.
 
uint8_t etsi_its_denm_msgs::access::getStationType (const DENM &denm)
 Get the stationType object.
 
double etsi_its_denm_msgs::access::getLatitude (const DENM &denm)
 Get the Latitude value of DENM.
 
double etsi_its_denm_msgs::access::getLongitude (const DENM &denm)
 Get the Longitude value of DENM.
 
double etsi_its_denm_msgs::access::getAltitude (const DENM &denm)
 Get the Altitude value of DENM.
 
double etsi_its_denm_msgs::access::getHeading (const Heading &heading)
 Get the Heading value.
 
double etsi_its_denm_msgs::access::getHeading (const DENM &denm)
 Get the Heading object.
 
bool etsi_its_denm_msgs::access::getIsHeadingPresent (const DENM &denm)
 Get the IsHeadingPresent object.
 
double etsi_its_denm_msgs::access::getSpeed (const DENM &denm)
 Get the vehicle speed.
 
bool etsi_its_denm_msgs::access::getIsSpeedPresent (const DENM &denm)
 Get the IsSpeedPresent object.
 
gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition (const DENM &denm, int &zone, bool &northp)
 
gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition (const DENM &denm)
 
uint8_t etsi_its_denm_msgs::access::getCauseCode (const DENM &denm)
 Get the Cause Code object.
 
uint8_t etsi_its_denm_msgs::access::getSubCauseCode (const DENM &denm)
 Get the Sub Cause Code object.
 
std::string etsi_its_denm_msgs::access::getCauseCodeType (const DENM &denm)
 Get the Cause Code Type object.
 
std::string etsi_its_denm_msgs::access::getSubCauseCodeType (const DENM &denm)
 Get the Sub Cause Code Type object.
 
std::vector< bool > etsi_its_denm_msgs::access::getDrivingLaneStatus (const DrivingLaneStatus &driving_lane_status)
 Get the Driving Lane Status in form of bool vector.
 
std::vector< bool > etsi_its_denm_msgs::access::getLightBarSirenInUse (const LightBarSirenInUse &light_bar_siren_in_use)
 Get the Lightbar Siren In Use in form of bool vector.
 

Detailed Description

Getter functions for the ETSI ITS DENM (EN)

Definition in file denm_getters.h.

Function Documentation

◆ getAltitude() [1/2]

double etsi_its_denm_msgs::access::getAltitude ( const Altitude & altitude)
inline

Get the Altitude value.

Parameters
altitudeto get the Altitude value from
Returns
Altitude value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 68 of file denm_getters.h.

68{ return denm.denm.management.station_type.value; }

◆ getAltitude() [2/2]

double etsi_its_denm_msgs::access::getAltitude ( const DENM & denm)
inline

Get the Altitude value of DENM.

Parameters
denmDENM to get the Altitude value from
Returns
Altitude value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 199 of file denm_getters.h.

◆ getBitString()

std::vector< bool > etsi_its_denm_msgs::access::getBitString ( const std::vector< uint8_t > & buffer,
const int bits_unused )
inline

Get a Bit String in form of bool vector.

Parameters
bufferas uint8_t vector
bits_unusednumber of bits to ignore at the end of the bit string
Returns
std::vector<bool>

Definition at line 85 of file denm_getters.h.

92 { return getAltitude(denm.denm.management.event_position.altitude); }
93
102inline double getHeading(const Heading& heading) { return ((double)heading.heading_value.value) * 1e-1; }
103
double getHeading(const Heading &heading)
Get the Heading value.
double getAltitude(const CAM &cam)
Get the Altitude value of CAM.

◆ getCauseCode()

uint8_t etsi_its_denm_msgs::access::getCauseCode ( const DENM & denm)
inline

Get the Cause Code object.

Parameters
denmDENM to get the causeCode value from
Returns
causeCode value

Definition at line 305 of file denm_getters.h.

◆ getCauseCodeType()

std::string etsi_its_denm_msgs::access::getCauseCodeType ( const DENM & denm)
inline

Get the Cause Code Type object.

https://www.etsi.org/deliver/etsi_en/302600_302699/30263703/01.02.01_30/en_30263703v010201v.pdf

Parameters
denmDENM to get the causeCodeType value from
Returns
causeCodeType value

Definition at line 323 of file denm_getters.h.

332 {
333 if (sub_cause_code == 0)
334 sub_cause_code_type = "unavailable";
335 else if (sub_cause_code >= 1 && sub_cause_code <= 10)
336 sub_cause_code_type = "not defined";
337 } else if (cause_code == CauseCodeType().AQUAPLANNNING)
338 sub_cause_code_type = "not defined";
339 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION) {
340 if (sub_cause_code == 0)
341 sub_cause_code_type = "unavailable";
342 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
343 sub_cause_code_type = "not defined";
344 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
345 if (sub_cause_code == 0)
346 sub_cause_code_type = "unavailable";
347 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
348 sub_cause_code_type = "not defined";
349 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD) {
350 if (sub_cause_code == 0)
351 sub_cause_code_type = "unavailable";
352 else if (sub_cause_code >= 1 && sub_cause_code <= 4)
353 sub_cause_code_type = "not defined";
354 } else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD) {
355 if (sub_cause_code == 0)
356 sub_cause_code_type = "unavailable";
357 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
358 sub_cause_code_type = "not defined";
359 } else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING) {
360 if (sub_cause_code == 0)
361 sub_cause_code_type = "unavailable";
362 else if (sub_cause_code == 1)
363 sub_cause_code_type = "vehicle driving in wrong lane";
364 else if (sub_cause_code == 2)
365 sub_cause_code_type = "vehicle driving in wrong driving direction";
366 } else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS) {
367 if (sub_cause_code == 0)
368 sub_cause_code_type = "unavailable";
369 else if (sub_cause_code >= 1 && sub_cause_code <= 5)
370 sub_cause_code_type = "not defined";
371 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION) {
372 if (sub_cause_code == 0)
373 sub_cause_code_type = "unavailable";
374 else if (sub_cause_code >= 1 && sub_cause_code <= 6)
375 sub_cause_code_type = "not defined";
376 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY) {
377 if (sub_cause_code == 0)
378 sub_cause_code_type = "unavailable";
379 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
380 sub_cause_code_type = "not defined";
381 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION) {
382 if (sub_cause_code == 0)
383 sub_cause_code_type = "unavailable";
384 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
385 sub_cause_code_type = "not defined";

◆ getDrivingLaneStatus()

std::vector< bool > etsi_its_denm_msgs::access::getDrivingLaneStatus ( const DrivingLaneStatus & driving_lane_status)
inline

Get the Driving Lane Status in form of bool vector.

Parameters
driving_lane_status
Returns
std::vector<bool>

Definition at line 623 of file denm_getters.h.

656 {
657
659
666inline uint32_t getStationID(const DENM& denm) { return getStationID(denm.header); }
667
674inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
675
682inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
683
690inline uint8_t getStationType(const DENM& denm) { return denm.denm.management.station_type.value; }
691
698inline double getLatitude(const DENM& denm) { return getLatitude(denm.denm.management.event_position.latitude); }
699
706inline double getLongitude(const DENM& denm) { return getLongitude(denm.denm.management.event_position.longitude); }
707
714inline double getAltitude(const DENM& denm) { return getAltitude(denm.denm.management.event_position.altitude); }
715
724inline double getHeading(const Heading& heading) { return ((double)heading.heading_value.value) * 1e-1; }
725
732inline double getHeading(const DENM& denm) {
733 if (denm.denm.location_is_present) {
734 if (denm.denm.location.event_position_heading_is_present) {
735 return getHeading(denm.denm.location.event_position_heading);
736 } else {
737 throw std::invalid_argument("Heading is not present!");
738 }
739 } else {
740 throw std::invalid_argument("LocationContainer is not present!");
741 }
742}
743
750inline bool getIsHeadingPresent(const DENM& denm) {
751 if (denm.denm.location_is_present) {
752 return denm.denm.location.event_position_heading_is_present;
753 } else {
754 throw std::invalid_argument("LocationContainer is not present!");
755 }
756}
757
764inline double getSpeed(const DENM& denm) {
765 if (denm.denm.location_is_present) {
766 if (denm.denm.location.event_speed_is_present) {
767 return getSpeed(denm.denm.location.event_speed);
768 } else {
769 throw std::invalid_argument("Speed is not present!");
770 }
771 } else {
772 throw std::invalid_argument("LocationContainer is not present!");
773 }
774}
775
782inline bool getIsSpeedPresent(const DENM& denm) {
783 if (denm.denm.location_is_present) {
784 return denm.denm.location.event_speed_is_present;
785 } else {
786 throw std::invalid_argument("LocationContainer is not present!");
787 }
788}
789
798inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
799 return getUTMPosition(denm.denm.management.event_position, zone, northp);
800}
801
808inline gm::PointStamped getUTMPosition(const DENM& denm) {
809 int zone;
810 bool northp;
811 return getUTMPosition(denm.denm.management.event_position, zone, northp);
812}
813
820inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cause_code.value; }
821
828inline uint8_t getSubCauseCode(const DENM& denm) { return denm.denm.situation.event_type.sub_cause_code.value; }
829
838inline std::string getCauseCodeType(const DENM& denm) {
839 if (denm.denm.situation_is_present) {
840 int cause_code = getCauseCode(denm);
841 std::string cause_code_type = "undefined";
842
843 if (cause_code == CauseCodeType().TRAFFIC_CONDITION)
844 cause_code_type = "traffic condition";
845 else if (cause_code == CauseCodeType().ACCIDENT)
846 cause_code_type = "accident";
847 else if (cause_code == CauseCodeType().ROADWORKS)
848 cause_code_type = "roadworks";
849 else if (cause_code == CauseCodeType().IMPASSABILITY)
850 cause_code_type = "impassibility";
851 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION)
852 cause_code_type = "adverse weather condition - adhesion";
853 else if (cause_code == CauseCodeType().AQUAPLANNNING)
854 cause_code_type = "aquaplanning";
855 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION)
856 cause_code_type = "hazardous location - surface condition";
857 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD)
858 cause_code_type = "hazardous location - obstacle on the road";
859 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD)
860 cause_code_type = "hazardous location - animal on the road";
861 else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD)
862 cause_code_type = "human presence on the road";
863 else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING)
864 cause_code_type = "wrong way driving";
865 else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS)
866 cause_code_type = "rescue and recovery in progress";
867 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION)
868 cause_code_type = "adverse weather condition - extreme weather condition";
869 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY)
870 cause_code_type = "adverse weather condition - visibility";
871 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION)
872 cause_code_type = "adverse weather condition - precipitation";
873 else if (cause_code == CauseCodeType().SLOW_VEHICLE)
874 cause_code_type = "slow vehicle";
875 else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE)
876 cause_code_type = "dangerous end of queue";
877 else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN)
878 cause_code_type = "vehicle breakdown";
879 else if (cause_code == CauseCodeType().POST_CRASH)
880 cause_code_type = "post crash";
881 else if (cause_code == CauseCodeType().HUMAN_PROBLEM)
882 cause_code_type = "human problem";
883 else if (cause_code == CauseCodeType().STATIONARY_VEHICLE)
884 cause_code_type = "stationary vehicle";
885 else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING)
886 cause_code_type = "emergency vehicle approaching";
887 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE)
888 cause_code_type = "hazardous location - dangerous curve";
889 else if (cause_code == CauseCodeType().COLLISION_RISK)
890 cause_code_type = "collision risk";
891 else if (cause_code == CauseCodeType().SIGNAL_VIOLATION)
892 cause_code_type = "signal violation";
893 else if (cause_code == CauseCodeType().DANGEROUS_SITUATION)
894 cause_code_type = "dangerous situation";
895
896 return cause_code_type;
897 } else {
898 throw std::invalid_argument("SituationContainer is not present!");
899 }
900}
901
910inline std::string getSubCauseCodeType(const DENM& denm) {
911 if (denm.denm.situation_is_present) {
912 int cause_code = getCauseCode(denm);
913 int sub_cause_code = getSubCauseCode(denm);
914 std::string sub_cause_code_type = "undefined";
915 if (cause_code == CauseCodeType().TRAFFIC_CONDITION) {
916 if (sub_cause_code == 0)
917 sub_cause_code_type = "unavailable";
918 else if (sub_cause_code == 1)
919 sub_cause_code_type = "not defined";
920 else if (sub_cause_code == 2)
921 sub_cause_code_type = "traffic jam slowly increasing";
922 else if (sub_cause_code == 3)
923 sub_cause_code_type = "traffic jam increasing";
924 else if (sub_cause_code == 4)
925 sub_cause_code_type = "traffic jam strongly increasing";
926 else if (sub_cause_code == 5)
927 sub_cause_code_type = "traffic stationary";
928 else if (sub_cause_code == 6)
929 sub_cause_code_type = "traffic jam slightly decreasing";
930 else if (sub_cause_code == 7)
931 sub_cause_code_type = "traffic jam decreasing";
932 else if (sub_cause_code == 8)
933 sub_cause_code_type = "traffic jam strongly decreasing";
934 } else if (cause_code == CauseCodeType().ACCIDENT) {
935 if (sub_cause_code == 0)
936 sub_cause_code_type = "unavailable";
937 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
938 sub_cause_code_type = "not defined";
939 else if (sub_cause_code == 8)
940 sub_cause_code_type = "assistance requested (e-Call)";
941 } else if (cause_code == CauseCodeType().ROADWORKS) {
942 if (sub_cause_code == 0)
943 sub_cause_code_type = "unavailable";
944 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
945 sub_cause_code_type = "not defined";
946 else if (sub_cause_code == 4)
947 sub_cause_code_type = "short-term stationary roadworks";
948 else if (sub_cause_code == 5)
949 sub_cause_code_type = "street cleaning";
950 else if (sub_cause_code == 6)
951 sub_cause_code_type = "winter service";
952 } else if (cause_code == CauseCodeType().IMPASSABILITY)
953 sub_cause_code_type = "not defined";
954 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION) {
955 if (sub_cause_code == 0)
956 sub_cause_code_type = "unavailable";
957 else if (sub_cause_code >= 1 && sub_cause_code <= 10)
958 sub_cause_code_type = "not defined";
959 } else if (cause_code == CauseCodeType().AQUAPLANNNING)
960 sub_cause_code_type = "not defined";
961 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION) {
962 if (sub_cause_code == 0)
963 sub_cause_code_type = "unavailable";
964 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
965 sub_cause_code_type = "not defined";
966 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
967 if (sub_cause_code == 0)
968 sub_cause_code_type = "unavailable";
969 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
970 sub_cause_code_type = "not defined";
971 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD) {
972 if (sub_cause_code == 0)
973 sub_cause_code_type = "unavailable";
974 else if (sub_cause_code >= 1 && sub_cause_code <= 4)
975 sub_cause_code_type = "not defined";
976 } else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD) {
977 if (sub_cause_code == 0)
978 sub_cause_code_type = "unavailable";
979 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
980 sub_cause_code_type = "not defined";
981 } else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING) {
982 if (sub_cause_code == 0)
983 sub_cause_code_type = "unavailable";
984 else if (sub_cause_code == 1)
985 sub_cause_code_type = "vehicle driving in wrong lane";
986 else if (sub_cause_code == 2)
987 sub_cause_code_type = "vehicle driving in wrong driving direction";
988 } else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS) {
989 if (sub_cause_code == 0)
990 sub_cause_code_type = "unavailable";
991 else if (sub_cause_code >= 1 && sub_cause_code <= 5)
992 sub_cause_code_type = "not defined";
993 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION) {
994 if (sub_cause_code == 0)
995 sub_cause_code_type = "unavailable";
996 else if (sub_cause_code >= 1 && sub_cause_code <= 6)
997 sub_cause_code_type = "not defined";
998 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY) {
999 if (sub_cause_code == 0)
1000 sub_cause_code_type = "unavailable";
1001 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1002 sub_cause_code_type = "not defined";
1003 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION) {
1004 if (sub_cause_code == 0)
1005 sub_cause_code_type = "unavailable";
1006 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1007 sub_cause_code_type = "not defined";
1008 } else if (cause_code == CauseCodeType().SLOW_VEHICLE) {
1009 if (sub_cause_code == 0)
1010 sub_cause_code_type = "unavailable";
1011 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1012 sub_cause_code_type = "not defined";
1013 } else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE) {
1014 if (sub_cause_code == 0)
1015 sub_cause_code_type = "unavailable";
1016 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1017 sub_cause_code_type = "not defined";
1018 } else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN) {
1019 if (sub_cause_code == 0)
1020 sub_cause_code_type = "unavailable";
1021 else if (sub_cause_code == 1)
1022 sub_cause_code_type = "lack of fuel";
1023 else if (sub_cause_code == 2)
1024 sub_cause_code_type = "lack of battery";
1025 else if (sub_cause_code == 3)
1026 sub_cause_code_type = "engine problem";
1027 else if (sub_cause_code == 4)
1028 sub_cause_code_type = "transmission problem";
1029 else if (sub_cause_code == 5)
1030 sub_cause_code_type = "engine cooling problem";
1031 else if (sub_cause_code == 6)
1032 sub_cause_code_type = "braking system problem";
1033 else if (sub_cause_code == 7)
1034 sub_cause_code_type = "steering problem";
1035 else if (sub_cause_code == 8)
1036 sub_cause_code_type = "tyre puncture";
1037 } else if (cause_code == CauseCodeType().POST_CRASH) {
1038 if (sub_cause_code == 0)
1039 sub_cause_code_type = "unavailable";
1040 else if (sub_cause_code == 1)
1041 sub_cause_code_type = "accident without e-Call triggered";
1042 else if (sub_cause_code == 2)
1043 sub_cause_code_type = "accident with e-Call manually triggered";
1044 else if (sub_cause_code == 3)
1045 sub_cause_code_type = "accident with e-Call automatical triggered";
1046 else if (sub_cause_code == 4)
1047 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
1048 } else if (cause_code == CauseCodeType().HUMAN_PROBLEM) {
1049 if (sub_cause_code == 0)
1050 sub_cause_code_type = "unavailable";
1051 else if (sub_cause_code == 1)
1052 sub_cause_code_type = "glycaemia problem";
1053 else if (sub_cause_code == 2)
1054 sub_cause_code_type = "heart problem";
1055 } else if (cause_code == CauseCodeType().STATIONARY_VEHICLE) {
1056 if (sub_cause_code == 0)
1057 sub_cause_code_type = "unavailable";
1058 else if (sub_cause_code == 1)
1059 sub_cause_code_type = "human problem";
1060 else if (sub_cause_code == 2)
1061 sub_cause_code_type = "vehicle breakdown";
1062 else if (sub_cause_code == 3)
1063 sub_cause_code_type = "post crash";
1064 else if (sub_cause_code == 4)
1065 sub_cause_code_type = "public transport stop";
1066 else if (sub_cause_code == 5)
1067 sub_cause_code_type = "carrying dangerous goods";
1068 } else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING) {
1069 if (sub_cause_code == 0)
1070 sub_cause_code_type = "unavailable";
1071 else if (sub_cause_code == 1)
1072 sub_cause_code_type = "emergency vehicle approaching";
1073 else if (sub_cause_code == 2)
1074 sub_cause_code_type = "prioritized vehicle approaching";
1075 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE) {
1076 if (sub_cause_code == 0)
1077 sub_cause_code_type = "unavailable";
1078 else if (sub_cause_code == 1)
1079 sub_cause_code_type = "dangerous left turn curve";
1080 else if (sub_cause_code == 2)
1081 sub_cause_code_type = "dangerous right turn curve";
1082 else if (sub_cause_code == 3)
1083 sub_cause_code_type = "multiple curves starting with unknown turning direction";
1084 else if (sub_cause_code == 4)
1085 sub_cause_code_type = "multiple curves starting with left turn";
1086 else if (sub_cause_code == 5)
1087 sub_cause_code_type = "multiple curves starting with right turn";
1088 } else if (cause_code == CauseCodeType().COLLISION_RISK) {
1089 if (sub_cause_code == 0)
1090 sub_cause_code_type = "unavailable";
1091 else if (sub_cause_code == 1)
1092 sub_cause_code_type = "longitudinal collision risk";
1093 else if (sub_cause_code == 2)
1094 sub_cause_code_type = "crossing collision risk";
1095 else if (sub_cause_code == 3)
1096 sub_cause_code_type = "lateral collision risk";
1097 else if (sub_cause_code == 4)
1098 sub_cause_code_type = "collision risk involving vulnerable road user";
1099 } else if (cause_code == CauseCodeType().SIGNAL_VIOLATION) {
1100 if (sub_cause_code == 0)
1101 sub_cause_code_type = "unavailable";
1102 else if (sub_cause_code == 1)
1103 sub_cause_code_type = "stop sign violation";
1104 else if (sub_cause_code == 2)
1105 sub_cause_code_type = "traffic light violation";
1106 else if (sub_cause_code == 3)
1107 sub_cause_code_type = "turning regulation violation";
1108 } else if (cause_code == CauseCodeType().DANGEROUS_SITUATION) {
1109 if (sub_cause_code == 0)
1110 sub_cause_code_type = "unavailable";
1111 else if (sub_cause_code == 1)
1112 sub_cause_code_type = "emergency electronic break lights";
1113 else if (sub_cause_code == 2)
1114 sub_cause_code_type = "pre-crash system activated";
1115 else if (sub_cause_code == 3)
1116 sub_cause_code_type = "ESP (electronic stability program) activated";
1117 else if (sub_cause_code == 4)
1118 sub_cause_code_type = "ABS (anti-lock breaking system) activated";
1119 else if (sub_cause_code == 5)
1120 sub_cause_code_type = "AEB (automatic emergency breaking) activated";
1121 else if (sub_cause_code == 6)
1122 sub_cause_code_type = "break warning activated";
1123 else if (sub_cause_code == 7)
1124 sub_cause_code_type = "collision risk warning activated";
1125 }
1126 return sub_cause_code_type;
1127 } else {
1128 throw std::invalid_argument("SituationContainer is not present!");
1129 }
1130}
1131
1138inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
1139 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
1140}
1141
1148inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
1149 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
1150}
1151
1152} // namespace etsi_its_denm_msgs::access
double getLongitude(const CAM &cam)
Get the Longitude value of CAM.
std::vector< bool > getLightBarSirenInUse(const LightBarSirenInUse &light_bar_siren_in_use)
Get the Lightbar Siren In Use in form of bool vector.
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.
uint8_t getStationType(const CAM &cam)
Get the stationType object.
uint32_t getStationID(const CAM &cam)
Get the Station ID object.
double getLatitude(const CAM &cam)
Get the Latitude value of CAM.
double getSpeed(const CAM &cam)
Get the vehicle speed.
std::vector< bool > getDrivingLaneStatus(const DrivingLaneStatus &driving_lane_status)
Get the Driving Lane Status in form of bool vector.
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
uint64_t getReferenceTimeValue(const CollectivePerceptionMessage &cpm)
Get the ReferenceTime-Value.
TimestampIts getReferenceTime(const CollectivePerceptionMessage &cpm)
Get the Reference Time object.
std::string getCauseCodeType(const DENM &denm)
Get the Cause Code Type object.
uint8_t getSubCauseCode(const DENM &denm)
Get the Sub Cause Code object.
bool getIsSpeedPresent(const DENM &denm)
Get the IsSpeedPresent object.
std::string getSubCauseCodeType(const DENM &denm)
Get the Sub Cause Code Type object.
uint8_t getCauseCode(const DENM &denm)
Get the Cause Code object.
bool getIsHeadingPresent(const DENM &denm)
Get the IsHeadingPresent object.

◆ getHeading() [1/2]

double etsi_its_denm_msgs::access::getHeading ( const DENM & denm)
inline

Get the Heading object.

Parameters
denmDENM to get the Heading-Value from
Returns
getHeading value

Definition at line 217 of file denm_getters.h.

217 {
218 int cause_code = getCauseCode(denm);
219 std::string cause_code_type = "undefined";
220
221 if (cause_code == CauseCodeType().TRAFFIC_CONDITION)
222 cause_code_type = "traffic condition";
223 else if (cause_code == CauseCodeType().ACCIDENT)
224 cause_code_type = "accident";
225 else if (cause_code == CauseCodeType().ROADWORKS)
226 cause_code_type = "roadworks";
227 else if (cause_code == CauseCodeType().IMPASSABILITY)

◆ getHeading() [2/2]

double etsi_its_denm_msgs::access::getHeading ( const Heading & heading)
inline

Get the Heading value.

0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West

Parameters
headingto get the Heading value from
Returns
Heading value in degree as decimal number

Definition at line 209 of file denm_getters.h.

◆ getIsHeadingPresent()

bool etsi_its_denm_msgs::access::getIsHeadingPresent ( const DENM & denm)
inline

Get the IsHeadingPresent object.

Parameters
denmDENM to get the IsHeadingPresent-Value from
Returns
IsHeadingPresent-Value (true or false)

Definition at line 235 of file denm_getters.h.

◆ getIsSpeedPresent()

bool etsi_its_denm_msgs::access::getIsSpeedPresent ( const DENM & denm)
inline

Get the IsSpeedPresent object.

Parameters
denmDENM to get the IsSpeedPresent-Value from
Returns
IsSpeedPresent-Value (true or false)

Definition at line 267 of file denm_getters.h.

◆ getLatitude() [1/2]

double etsi_its_denm_msgs::access::getLatitude ( const DENM & denm)
inline

Get the Latitude value of DENM.

Parameters
denmDENM to get the Latitude value from
Returns
Latitude value in degree as decimal number

Definition at line 183 of file denm_getters.h.

◆ getLatitude() [2/2]

double etsi_its_denm_msgs::access::getLatitude ( const Latitude & latitude)
inline

Get the Latitude value.

Parameters
latitudeto get the Latitude value from
Returns
Latitude value in degree as decimal number

Definition at line 52 of file denm_getters.h.

52{ return denm.denm.management.reference_time; }

◆ getLightBarSirenInUse()

std::vector< bool > etsi_its_denm_msgs::access::getLightBarSirenInUse ( const LightBarSirenInUse & light_bar_siren_in_use)
inline

Get the Lightbar Siren In Use in form of bool vector.

Parameters
light_bar_siren_in_use
Returns
std::vector<bool>

Definition at line 633 of file denm_getters.h.

666 {
667
669
676inline uint32_t getStationID(const DENM& denm) { return getStationID(denm.header); }
677
684inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
685
692inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
693
700inline uint8_t getStationType(const DENM& denm) { return denm.denm.management.station_type.value; }
701
708inline double getLatitude(const DENM& denm) { return getLatitude(denm.denm.management.event_position.latitude); }
709
716inline double getLongitude(const DENM& denm) { return getLongitude(denm.denm.management.event_position.longitude); }
717
724inline double getAltitude(const DENM& denm) { return getAltitude(denm.denm.management.event_position.altitude); }
725
734inline double getHeading(const Heading& heading) { return ((double)heading.heading_value.value) * 1e-1; }
735
742inline double getHeading(const DENM& denm) {
743 if (denm.denm.location_is_present) {
744 if (denm.denm.location.event_position_heading_is_present) {
745 return getHeading(denm.denm.location.event_position_heading);
746 } else {
747 throw std::invalid_argument("Heading is not present!");
748 }
749 } else {
750 throw std::invalid_argument("LocationContainer is not present!");
751 }
752}
753
760inline bool getIsHeadingPresent(const DENM& denm) {
761 if (denm.denm.location_is_present) {
762 return denm.denm.location.event_position_heading_is_present;
763 } else {
764 throw std::invalid_argument("LocationContainer is not present!");
765 }
766}
767
774inline double getSpeed(const DENM& denm) {
775 if (denm.denm.location_is_present) {
776 if (denm.denm.location.event_speed_is_present) {
777 return getSpeed(denm.denm.location.event_speed);
778 } else {
779 throw std::invalid_argument("Speed is not present!");
780 }
781 } else {
782 throw std::invalid_argument("LocationContainer is not present!");
783 }
784}
785
792inline bool getIsSpeedPresent(const DENM& denm) {
793 if (denm.denm.location_is_present) {
794 return denm.denm.location.event_speed_is_present;
795 } else {
796 throw std::invalid_argument("LocationContainer is not present!");
797 }
798}
799
808inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
809 return getUTMPosition(denm.denm.management.event_position, zone, northp);
810}
811
818inline gm::PointStamped getUTMPosition(const DENM& denm) {
819 int zone;
820 bool northp;
821 return getUTMPosition(denm.denm.management.event_position, zone, northp);
822}
823
830inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cause_code.value; }
831
838inline uint8_t getSubCauseCode(const DENM& denm) { return denm.denm.situation.event_type.sub_cause_code.value; }
839
848inline std::string getCauseCodeType(const DENM& denm) {
849 if (denm.denm.situation_is_present) {
850 int cause_code = getCauseCode(denm);
851 std::string cause_code_type = "undefined";
852
853 if (cause_code == CauseCodeType().TRAFFIC_CONDITION)
854 cause_code_type = "traffic condition";
855 else if (cause_code == CauseCodeType().ACCIDENT)
856 cause_code_type = "accident";
857 else if (cause_code == CauseCodeType().ROADWORKS)
858 cause_code_type = "roadworks";
859 else if (cause_code == CauseCodeType().IMPASSABILITY)
860 cause_code_type = "impassibility";
861 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION)
862 cause_code_type = "adverse weather condition - adhesion";
863 else if (cause_code == CauseCodeType().AQUAPLANNNING)
864 cause_code_type = "aquaplanning";
865 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION)
866 cause_code_type = "hazardous location - surface condition";
867 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD)
868 cause_code_type = "hazardous location - obstacle on the road";
869 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD)
870 cause_code_type = "hazardous location - animal on the road";
871 else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD)
872 cause_code_type = "human presence on the road";
873 else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING)
874 cause_code_type = "wrong way driving";
875 else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS)
876 cause_code_type = "rescue and recovery in progress";
877 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION)
878 cause_code_type = "adverse weather condition - extreme weather condition";
879 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY)
880 cause_code_type = "adverse weather condition - visibility";
881 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION)
882 cause_code_type = "adverse weather condition - precipitation";
883 else if (cause_code == CauseCodeType().SLOW_VEHICLE)
884 cause_code_type = "slow vehicle";
885 else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE)
886 cause_code_type = "dangerous end of queue";
887 else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN)
888 cause_code_type = "vehicle breakdown";
889 else if (cause_code == CauseCodeType().POST_CRASH)
890 cause_code_type = "post crash";
891 else if (cause_code == CauseCodeType().HUMAN_PROBLEM)
892 cause_code_type = "human problem";
893 else if (cause_code == CauseCodeType().STATIONARY_VEHICLE)
894 cause_code_type = "stationary vehicle";
895 else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING)
896 cause_code_type = "emergency vehicle approaching";
897 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE)
898 cause_code_type = "hazardous location - dangerous curve";
899 else if (cause_code == CauseCodeType().COLLISION_RISK)
900 cause_code_type = "collision risk";
901 else if (cause_code == CauseCodeType().SIGNAL_VIOLATION)
902 cause_code_type = "signal violation";
903 else if (cause_code == CauseCodeType().DANGEROUS_SITUATION)
904 cause_code_type = "dangerous situation";
905
906 return cause_code_type;
907 } else {
908 throw std::invalid_argument("SituationContainer is not present!");
909 }
910}
911
920inline std::string getSubCauseCodeType(const DENM& denm) {
921 if (denm.denm.situation_is_present) {
922 int cause_code = getCauseCode(denm);
923 int sub_cause_code = getSubCauseCode(denm);
924 std::string sub_cause_code_type = "undefined";
925 if (cause_code == CauseCodeType().TRAFFIC_CONDITION) {
926 if (sub_cause_code == 0)
927 sub_cause_code_type = "unavailable";
928 else if (sub_cause_code == 1)
929 sub_cause_code_type = "not defined";
930 else if (sub_cause_code == 2)
931 sub_cause_code_type = "traffic jam slowly increasing";
932 else if (sub_cause_code == 3)
933 sub_cause_code_type = "traffic jam increasing";
934 else if (sub_cause_code == 4)
935 sub_cause_code_type = "traffic jam strongly increasing";
936 else if (sub_cause_code == 5)
937 sub_cause_code_type = "traffic stationary";
938 else if (sub_cause_code == 6)
939 sub_cause_code_type = "traffic jam slightly decreasing";
940 else if (sub_cause_code == 7)
941 sub_cause_code_type = "traffic jam decreasing";
942 else if (sub_cause_code == 8)
943 sub_cause_code_type = "traffic jam strongly decreasing";
944 } else if (cause_code == CauseCodeType().ACCIDENT) {
945 if (sub_cause_code == 0)
946 sub_cause_code_type = "unavailable";
947 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
948 sub_cause_code_type = "not defined";
949 else if (sub_cause_code == 8)
950 sub_cause_code_type = "assistance requested (e-Call)";
951 } else if (cause_code == CauseCodeType().ROADWORKS) {
952 if (sub_cause_code == 0)
953 sub_cause_code_type = "unavailable";
954 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
955 sub_cause_code_type = "not defined";
956 else if (sub_cause_code == 4)
957 sub_cause_code_type = "short-term stationary roadworks";
958 else if (sub_cause_code == 5)
959 sub_cause_code_type = "street cleaning";
960 else if (sub_cause_code == 6)
961 sub_cause_code_type = "winter service";
962 } else if (cause_code == CauseCodeType().IMPASSABILITY)
963 sub_cause_code_type = "not defined";
964 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION) {
965 if (sub_cause_code == 0)
966 sub_cause_code_type = "unavailable";
967 else if (sub_cause_code >= 1 && sub_cause_code <= 10)
968 sub_cause_code_type = "not defined";
969 } else if (cause_code == CauseCodeType().AQUAPLANNNING)
970 sub_cause_code_type = "not defined";
971 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION) {
972 if (sub_cause_code == 0)
973 sub_cause_code_type = "unavailable";
974 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
975 sub_cause_code_type = "not defined";
976 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
977 if (sub_cause_code == 0)
978 sub_cause_code_type = "unavailable";
979 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
980 sub_cause_code_type = "not defined";
981 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD) {
982 if (sub_cause_code == 0)
983 sub_cause_code_type = "unavailable";
984 else if (sub_cause_code >= 1 && sub_cause_code <= 4)
985 sub_cause_code_type = "not defined";
986 } else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD) {
987 if (sub_cause_code == 0)
988 sub_cause_code_type = "unavailable";
989 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
990 sub_cause_code_type = "not defined";
991 } else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING) {
992 if (sub_cause_code == 0)
993 sub_cause_code_type = "unavailable";
994 else if (sub_cause_code == 1)
995 sub_cause_code_type = "vehicle driving in wrong lane";
996 else if (sub_cause_code == 2)
997 sub_cause_code_type = "vehicle driving in wrong driving direction";
998 } else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS) {
999 if (sub_cause_code == 0)
1000 sub_cause_code_type = "unavailable";
1001 else if (sub_cause_code >= 1 && sub_cause_code <= 5)
1002 sub_cause_code_type = "not defined";
1003 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION) {
1004 if (sub_cause_code == 0)
1005 sub_cause_code_type = "unavailable";
1006 else if (sub_cause_code >= 1 && sub_cause_code <= 6)
1007 sub_cause_code_type = "not defined";
1008 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY) {
1009 if (sub_cause_code == 0)
1010 sub_cause_code_type = "unavailable";
1011 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1012 sub_cause_code_type = "not defined";
1013 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION) {
1014 if (sub_cause_code == 0)
1015 sub_cause_code_type = "unavailable";
1016 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1017 sub_cause_code_type = "not defined";
1018 } else if (cause_code == CauseCodeType().SLOW_VEHICLE) {
1019 if (sub_cause_code == 0)
1020 sub_cause_code_type = "unavailable";
1021 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1022 sub_cause_code_type = "not defined";
1023 } else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE) {
1024 if (sub_cause_code == 0)
1025 sub_cause_code_type = "unavailable";
1026 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1027 sub_cause_code_type = "not defined";
1028 } else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN) {
1029 if (sub_cause_code == 0)
1030 sub_cause_code_type = "unavailable";
1031 else if (sub_cause_code == 1)
1032 sub_cause_code_type = "lack of fuel";
1033 else if (sub_cause_code == 2)
1034 sub_cause_code_type = "lack of battery";
1035 else if (sub_cause_code == 3)
1036 sub_cause_code_type = "engine problem";
1037 else if (sub_cause_code == 4)
1038 sub_cause_code_type = "transmission problem";
1039 else if (sub_cause_code == 5)
1040 sub_cause_code_type = "engine cooling problem";
1041 else if (sub_cause_code == 6)
1042 sub_cause_code_type = "braking system problem";
1043 else if (sub_cause_code == 7)
1044 sub_cause_code_type = "steering problem";
1045 else if (sub_cause_code == 8)
1046 sub_cause_code_type = "tyre puncture";
1047 } else if (cause_code == CauseCodeType().POST_CRASH) {
1048 if (sub_cause_code == 0)
1049 sub_cause_code_type = "unavailable";
1050 else if (sub_cause_code == 1)
1051 sub_cause_code_type = "accident without e-Call triggered";
1052 else if (sub_cause_code == 2)
1053 sub_cause_code_type = "accident with e-Call manually triggered";
1054 else if (sub_cause_code == 3)
1055 sub_cause_code_type = "accident with e-Call automatical triggered";
1056 else if (sub_cause_code == 4)
1057 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
1058 } else if (cause_code == CauseCodeType().HUMAN_PROBLEM) {
1059 if (sub_cause_code == 0)
1060 sub_cause_code_type = "unavailable";
1061 else if (sub_cause_code == 1)
1062 sub_cause_code_type = "glycaemia problem";
1063 else if (sub_cause_code == 2)
1064 sub_cause_code_type = "heart problem";
1065 } else if (cause_code == CauseCodeType().STATIONARY_VEHICLE) {
1066 if (sub_cause_code == 0)
1067 sub_cause_code_type = "unavailable";
1068 else if (sub_cause_code == 1)
1069 sub_cause_code_type = "human problem";
1070 else if (sub_cause_code == 2)
1071 sub_cause_code_type = "vehicle breakdown";
1072 else if (sub_cause_code == 3)
1073 sub_cause_code_type = "post crash";
1074 else if (sub_cause_code == 4)
1075 sub_cause_code_type = "public transport stop";
1076 else if (sub_cause_code == 5)
1077 sub_cause_code_type = "carrying dangerous goods";
1078 } else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING) {
1079 if (sub_cause_code == 0)
1080 sub_cause_code_type = "unavailable";
1081 else if (sub_cause_code == 1)
1082 sub_cause_code_type = "emergency vehicle approaching";
1083 else if (sub_cause_code == 2)
1084 sub_cause_code_type = "prioritized vehicle approaching";
1085 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE) {
1086 if (sub_cause_code == 0)
1087 sub_cause_code_type = "unavailable";
1088 else if (sub_cause_code == 1)
1089 sub_cause_code_type = "dangerous left turn curve";
1090 else if (sub_cause_code == 2)
1091 sub_cause_code_type = "dangerous right turn curve";
1092 else if (sub_cause_code == 3)
1093 sub_cause_code_type = "multiple curves starting with unknown turning direction";
1094 else if (sub_cause_code == 4)
1095 sub_cause_code_type = "multiple curves starting with left turn";
1096 else if (sub_cause_code == 5)
1097 sub_cause_code_type = "multiple curves starting with right turn";
1098 } else if (cause_code == CauseCodeType().COLLISION_RISK) {
1099 if (sub_cause_code == 0)
1100 sub_cause_code_type = "unavailable";
1101 else if (sub_cause_code == 1)
1102 sub_cause_code_type = "longitudinal collision risk";
1103 else if (sub_cause_code == 2)
1104 sub_cause_code_type = "crossing collision risk";
1105 else if (sub_cause_code == 3)
1106 sub_cause_code_type = "lateral collision risk";
1107 else if (sub_cause_code == 4)
1108 sub_cause_code_type = "collision risk involving vulnerable road user";
1109 } else if (cause_code == CauseCodeType().SIGNAL_VIOLATION) {
1110 if (sub_cause_code == 0)
1111 sub_cause_code_type = "unavailable";
1112 else if (sub_cause_code == 1)
1113 sub_cause_code_type = "stop sign violation";
1114 else if (sub_cause_code == 2)
1115 sub_cause_code_type = "traffic light violation";
1116 else if (sub_cause_code == 3)
1117 sub_cause_code_type = "turning regulation violation";
1118 } else if (cause_code == CauseCodeType().DANGEROUS_SITUATION) {
1119 if (sub_cause_code == 0)
1120 sub_cause_code_type = "unavailable";
1121 else if (sub_cause_code == 1)
1122 sub_cause_code_type = "emergency electronic break lights";
1123 else if (sub_cause_code == 2)
1124 sub_cause_code_type = "pre-crash system activated";
1125 else if (sub_cause_code == 3)
1126 sub_cause_code_type = "ESP (electronic stability program) activated";
1127 else if (sub_cause_code == 4)
1128 sub_cause_code_type = "ABS (anti-lock breaking system) activated";
1129 else if (sub_cause_code == 5)
1130 sub_cause_code_type = "AEB (automatic emergency breaking) activated";
1131 else if (sub_cause_code == 6)
1132 sub_cause_code_type = "break warning activated";
1133 else if (sub_cause_code == 7)
1134 sub_cause_code_type = "collision risk warning activated";
1135 }
1136 return sub_cause_code_type;
1137 } else {
1138 throw std::invalid_argument("SituationContainer is not present!");
1139 }
1140}
1141
1148inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
1149 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
1150}
1151
1158inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
1159 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
1160}
1161
1162} // namespace etsi_its_denm_msgs::access

◆ getLongitude() [1/2]

double etsi_its_denm_msgs::access::getLongitude ( const DENM & denm)
inline

Get the Longitude value of DENM.

Parameters
denmDENM to get the Longitude value from
Returns
Longitude value in degree as decimal number

Definition at line 191 of file denm_getters.h.

◆ getLongitude() [2/2]

double etsi_its_denm_msgs::access::getLongitude ( const Longitude & longitude)
inline

Get the Longitude value.

Parameters
longitudeto get the Longitude value from
Returns
Longitude value in degree as decimal number

Definition at line 60 of file denm_getters.h.

60{ return getReferenceTime(denm).value; }

◆ getReferenceTime()

TimestampIts etsi_its_denm_msgs::access::getReferenceTime ( const DENM & denm)
inline

Get the Reference Time object.

Parameters
denmDENM to get the ReferenceTime-Value from
Returns
TimestampIts

Definition at line 159 of file denm_getters.h.

◆ getReferenceTimeValue()

uint64_t etsi_its_denm_msgs::access::getReferenceTimeValue ( const DENM & denm)
inline

Get the ReferenceTime-Value.

Parameters
denmDENM to get the ReferenceTime-Value from
Returns
uint64_t the ReferenceTime-Value

Definition at line 167 of file denm_getters.h.

◆ getSpeed() [1/2]

double etsi_its_denm_msgs::access::getSpeed ( const DENM & denm)
inline

Get the vehicle speed.

Parameters
denmDENM to get the speed value from
Returns
speed value in m/s as decimal number

Definition at line 249 of file denm_getters.h.

◆ getSpeed() [2/2]

double etsi_its_denm_msgs::access::getSpeed ( const Speed & speed)
inline

Get the vehicle speed.

Parameters
speedto get the speed value from
Returns
speed value in m/s as decimal number

Definition at line 76 of file denm_getters.h.

76{ return getLatitude(denm.denm.management.event_position.latitude); }

◆ getStationID() [1/2]

uint32_t etsi_its_denm_msgs::access::getStationID ( const DENM & denm)
inline

Get the Station ID object.

Parameters
denmDENM to get the StationID value from
Returns
stationID value

Definition at line 151 of file denm_getters.h.

◆ getStationID() [2/2]

uint32_t etsi_its_denm_msgs::access::getStationID ( const ItsPduHeader & header)
inline

Get the StationID of ItsPduHeader.

Parameters
headerItsPduHeader to get the StationID value from
Returns
stationID value

Definition at line 44 of file denm_getters.h.

44{ return getStationID(denm.header); }

◆ getStationType()

uint8_t etsi_its_denm_msgs::access::getStationType ( const DENM & denm)
inline

Get the stationType object.

Parameters
denmDENM to get the stationType value from
Returns
stationType value

Definition at line 175 of file denm_getters.h.

◆ getSubCauseCode()

uint8_t etsi_its_denm_msgs::access::getSubCauseCode ( const DENM & denm)
inline

Get the Sub Cause Code object.

Parameters
denmDENM to get the subCauseCode value from
Returns
subCauseCode value

Definition at line 313 of file denm_getters.h.

◆ getSubCauseCodeType()

std::string etsi_its_denm_msgs::access::getSubCauseCodeType ( const DENM & denm)
inline

Get the Sub Cause Code Type object.

https://www.etsi.org/deliver/etsi_en/302600_302699/30263703/01.02.01_30/en_30263703v010201v.pdf

Parameters
denmDENM to get the subCauseCodeType value from
Returns
causeCodeType value

Definition at line 395 of file denm_getters.h.

396 {
397 if (sub_cause_code == 0)
398 sub_cause_code_type = "unavailable";
399 else if (sub_cause_code == 1)
400 sub_cause_code_type = "lack of fuel";
401 else if (sub_cause_code == 2)
402 sub_cause_code_type = "lack of battery";
403 else if (sub_cause_code == 3)
404 sub_cause_code_type = "engine problem";
405 else if (sub_cause_code == 4)
406 sub_cause_code_type = "transmission problem";
407 else if (sub_cause_code == 5)
408 sub_cause_code_type = "engine cooling problem";
409 else if (sub_cause_code == 6)
410 sub_cause_code_type = "braking system problem";
411 else if (sub_cause_code == 7)
412 sub_cause_code_type = "steering problem";
413 else if (sub_cause_code == 8)
414 sub_cause_code_type = "tyre puncture";
415 } else if (cause_code == CauseCodeType().POST_CRASH) {
416 if (sub_cause_code == 0)
417 sub_cause_code_type = "unavailable";
418 else if (sub_cause_code == 1)
419 sub_cause_code_type = "accident without e-Call triggered";
420 else if (sub_cause_code == 2)
421 sub_cause_code_type = "accident with e-Call manually triggered";
422 else if (sub_cause_code == 3)
423 sub_cause_code_type = "accident with e-Call automatical triggered";
424 else if (sub_cause_code == 4)
425 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
426 } else if (cause_code == CauseCodeType().HUMAN_PROBLEM) {
427 if (sub_cause_code == 0)
428 sub_cause_code_type = "unavailable";
429 else if (sub_cause_code == 1)
430 sub_cause_code_type = "glycaemia problem";
431 else if (sub_cause_code == 2)
432 sub_cause_code_type = "heart problem";
433 } else if (cause_code == CauseCodeType().STATIONARY_VEHICLE) {
434 if (sub_cause_code == 0)
435 sub_cause_code_type = "unavailable";
436 else if (sub_cause_code == 1)
437 sub_cause_code_type = "human problem";
438 else if (sub_cause_code == 2)
439 sub_cause_code_type = "vehicle breakdown";
440 else if (sub_cause_code == 3)
441 sub_cause_code_type = "post crash";
442 else if (sub_cause_code == 4)
443 sub_cause_code_type = "public transport stop";
444 else if (sub_cause_code == 5)
445 sub_cause_code_type = "carrying dangerous goods";
446 } else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING) {
447 if (sub_cause_code == 0)
448 sub_cause_code_type = "unavailable";
449 else if (sub_cause_code == 1)
450 sub_cause_code_type = "emergency vehicle approaching";
451 else if (sub_cause_code == 2)
452 sub_cause_code_type = "prioritized vehicle approaching";
453 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE) {
454 if (sub_cause_code == 0)
455 sub_cause_code_type = "unavailable";
456 else if (sub_cause_code == 1)
457 sub_cause_code_type = "dangerous left turn curve";
458 else if (sub_cause_code == 2)
459 sub_cause_code_type = "dangerous right turn curve";
460 else if (sub_cause_code == 3)
461 sub_cause_code_type = "multiple curves starting with unknown turning direction";
462 else if (sub_cause_code == 4)
463 sub_cause_code_type = "multiple curves starting with left turn";
464 else if (sub_cause_code == 5)
465 sub_cause_code_type = "multiple curves starting with right turn";
466 } else if (cause_code == CauseCodeType().COLLISION_RISK) {
467 if (sub_cause_code == 0)
468 sub_cause_code_type = "unavailable";
469 else if (sub_cause_code == 1)
470 sub_cause_code_type = "longitudinal collision risk";
471 else if (sub_cause_code == 2)
472 sub_cause_code_type = "crossing collision risk";
473 else if (sub_cause_code == 3)
474 sub_cause_code_type = "lateral collision risk";
475 else if (sub_cause_code == 4)
476 sub_cause_code_type = "collision risk involving vulnerable road user";
477 } else if (cause_code == CauseCodeType().SIGNAL_VIOLATION) {
478 if (sub_cause_code == 0)
479 sub_cause_code_type = "unavailable";
480 else if (sub_cause_code == 1)
481 sub_cause_code_type = "stop sign violation";
482 else if (sub_cause_code == 2)
483 sub_cause_code_type = "traffic light violation";
484 else if (sub_cause_code == 3)
485 sub_cause_code_type = "turning regulation violation";
486 } else if (cause_code == CauseCodeType().DANGEROUS_SITUATION) {
487 if (sub_cause_code == 0)
488 sub_cause_code_type = "unavailable";
489 else if (sub_cause_code == 1)
490 sub_cause_code_type = "emergency electronic break lights";
491 else if (sub_cause_code == 2)
492 sub_cause_code_type = "pre-crash system activated";
493 else if (sub_cause_code == 3)
494 sub_cause_code_type = "ESP (electronic stability program) activated";
495 else if (sub_cause_code == 4)
496 sub_cause_code_type = "ABS (anti-lock breaking system) activated";
497 else if (sub_cause_code == 5)
498 sub_cause_code_type = "AEB (automatic emergency breaking) activated";
499 else if (sub_cause_code == 6)
500 sub_cause_code_type = "break warning activated";
501 else if (sub_cause_code == 7)
502 sub_cause_code_type = "collision risk warning activated";
503 }
504 return sub_cause_code_type;
505 } else {
506 throw std::invalid_argument("SituationContainer is not present!");
507 }
508}
509
516inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
517 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
518}
519
526inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
527 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
528}
529
530} // namespace etsi_its_denm_msgs::access

◆ getUTMPosition() [1/3]

gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition ( const DENM & denm)
inline
Parameters
denmDENM to get the UTM Position from
Returns
gm::PointStamped geometry_msgs::PointStamped of the given position

Definition at line 293 of file denm_getters.h.

293 {
294 if (sub_cause_code == 0)
295 sub_cause_code_type = "unavailable";
296 else if (sub_cause_code == 1)
297 sub_cause_code_type = "not defined";

◆ getUTMPosition() [2/3]

gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition ( const DENM & denm,
int & zone,
bool & northp )
inline
Parameters
denmDENM to get the UTM Position from
zonethe UTM zone (zero means UPS)
northphemisphere (true means north, false means south)
Returns
gm::PointStamped geometry_msgs::PointStamped of the given position

Definition at line 283 of file denm_getters.h.

283 ://www.etsi.org/deliver/etsi_en/302600_302699/30263703/01.02.01_30/en_30263703v010201v.pdf
284 *
285 * @param denm DENM to get the subCauseCodeType value from

◆ getUTMPosition() [3/3]

template<typename T >
gm::PointStamped etsi_its_denm_msgs::access::getUTMPosition ( const T & reference_position,
int & zone,
bool & northp )
inline

Get the UTM Position defined by the given ReferencePosition.

The position is transformed into UTM by using GeographicLib::UTMUPS The altitude value is directly used as z-Coordinate

Parameters
[in]reference_positionReferencePosition or ReferencePositionWithConfidence to get the UTM Position from
[out]zonethe UTM zone (zero means UPS)
[out]northphemisphere (true means north, false means south)
Returns
gm::PointStamped geometry_msgs::PointStamped of the given position

Definition at line 121 of file denm_getters.h.

128 {
129 if (denm.denm.location_is_present) {
130 return denm.denm.location.event_position_heading_is_present;
131 } else {
132 throw std::invalid_argument("LocationContainer is not present!");
133 }
134}
135