etsi_its_messages v3.1.0
 
Loading...
Searching...
No Matches
denm_getters.h File Reference

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

#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
#include <etsi_its_msgs_utils/impl/cdd/cdd_v1-3-1_getters.h>

Go to the source code of this file.

Functions

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.
 
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.
 
double etsi_its_denm_msgs::access::getSpeedConfidence (const Speed &speed)
 Get the Speed Confidence.
 
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.
 
template<typename Heading>
double etsi_its_denm_msgs::access::getHeadingCDD (const Heading &heading)
 Get the Heading value.
 
template<typename Heading>
double etsi_its_denm_msgs::access::getHeadingConfidenceCDD (const Heading &heading)
 Get the Heading value.
 
template<typename SemiAxisLength>
double etsi_its_denm_msgs::access::getSemiAxis (const SemiAxisLength &semi_axis_length)
 Get the Semi Axis object.
 
template<typename PosConfidenceEllipse>
std::tuple< double, double, double > etsi_its_denm_msgs::access::getPosConfidenceEllipse (const PosConfidenceEllipse &position_confidence_ellipse)
 Extract major axis length, minor axis length and orientation from the given position confidence ellipse.
 
std::array< double, 4 > etsi_its_denm_msgs::access::CovMatrixFromConfidenceEllipse (double semi_major, double semi_minor, double major_orientation, const double object_heading)
 Convert the confidence ellipse to a covariance matrix.
 
std::array< double, 4 > etsi_its_denm_msgs::access::WGSCovMatrixFromConfidenceEllipse (double semi_major, double semi_minor, double major_orientation)
 Convert the confidence ellipse to a covariance matrix.
 
template<typename PosConfidenceEllipse>
std::array< double, 4 > etsi_its_denm_msgs::access::getPosConfidenceEllipse (const PosConfidenceEllipse &position_confidence_ellipse, const double object_heading)
 Get the covariance matrix of the position confidence ellipse.
 
template<typename PosConfidenceEllipse>
std::array< double, 4 > etsi_its_denm_msgs::access::getWGSPosConfidenceEllipse (const PosConfidenceEllipse &position_confidence_ellipse)
 Get the covariance matrix of the position confidence ellipse.
 
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 DENM &denm)
 Get the Heading object.
 
double etsi_its_denm_msgs::access::getHeadingConfidence (const DENM &denm)
 Get the Heading confidence.
 
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.
 
double etsi_its_denm_msgs::access::getSpeedConfidence (const DENM &denm)
 Get the Speed Confidence.
 
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

◆ CovMatrixFromConfidenceEllipse()

std::array< double, 4 > etsi_its_denm_msgs::access::CovMatrixFromConfidenceEllipse ( double semi_major,
double semi_minor,
double major_orientation,
const double object_heading )
inline

Convert the confidence ellipse to a covariance matrix.

Note that the major_orientation is given in degrees, while the object_heading is given in radians!

Parameters
semi_majorSemi major axis length in meters
semi_minorSemi minor axis length in meters
major_orientationOrientation of the major axis in degrees, relative to WGS84
object_headingobject heading in radians, relative to WGS84
Returns
std::array<double, 4> The covariance matrix in vehicle coordinates (x = longitudinal, y = lateral)

Definition at line 182 of file denm_getters.h.

183 {
184 return getSpeedConfidence(
185 denm.denm.location.event_speed);
186}
187
196inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
197 return getUTMPosition(denm.denm.management.event_position, zone, northp);
198}
199
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.
double getSpeedConfidence(const Speed &speed)
Get the Speed Confidence.

◆ 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 71 of file denm_getters.h.

◆ 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 300 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 43 of file denm_getters.h.

45 { return getStationID(denm.header); }
46
53inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
54
61inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
62

◆ 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 425 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 443 of file denm_getters.h.

◆ 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 743 of file denm_getters.h.

787inline uint32_t getStationID(const DENM& denm) { return getStationID(denm.header); }
788
795inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
796
803inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
804
811inline uint8_t getStationType(const DENM& denm) { return denm.denm.management.station_type.value; }
812
819inline double getLatitude(const DENM& denm) { return getLatitude(denm.denm.management.event_position.latitude); }
820
827inline double getLongitude(const DENM& denm) { return getLongitude(denm.denm.management.event_position.longitude); }
828
835inline double getAltitude(const DENM& denm) { return getAltitude(denm.denm.management.event_position.altitude); }
836
843inline double getHeading(const DENM& denm) {
844 if (denm.denm.location_is_present) {
845 if (denm.denm.location.event_position_heading_is_present) {
846 return getHeadingCDD(denm.denm.location.event_position_heading);
847 } else {
848 throw std::invalid_argument("Heading is not present!");
849 }
850 } else {
851 throw std::invalid_argument("LocationContainer is not present!");
852 }
853}
854
861inline double getHeadingConfidence(const DENM& denm) {
862 if (denm.denm.location_is_present) {
863 if (denm.denm.location.event_position_heading_is_present) {
864 return getHeadingConfidenceCDD(denm.denm.location.event_position_heading);
865 } else {
866 throw std::invalid_argument("Heading is not present!");
867 }
868 } else {
869 throw std::invalid_argument("LocationContainer is not present!");
870 }
871}
872
879inline bool getIsHeadingPresent(const DENM& denm) {
880 if (denm.denm.location_is_present) {
881 return denm.denm.location.event_position_heading_is_present;
882 } else {
883 throw std::invalid_argument("LocationContainer is not present!");
884 }
885}
886
893inline double getSpeed(const DENM& denm) {
894 if (denm.denm.location_is_present) {
895 if (denm.denm.location.event_speed_is_present) {
896 return getSpeed(denm.denm.location.event_speed);
897 } else {
898 throw std::invalid_argument("Speed is not present!");
899 }
900 } else {
901 throw std::invalid_argument("LocationContainer is not present!");
902 }
903}
904
911inline bool getIsSpeedPresent(const DENM& denm) {
912 if (denm.denm.location_is_present) {
913 return denm.denm.location.event_speed_is_present;
914 } else {
915 throw std::invalid_argument("LocationContainer is not present!");
916 }
917}
918
925inline double getSpeedConfidence(const DENM& denm) {
926 return getSpeedConfidence(
927 denm.denm.location.event_speed);
928}
929
938inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
939 return getUTMPosition(denm.denm.management.event_position, zone, northp);
940}
941
948inline gm::PointStamped getUTMPosition(const DENM& denm) {
949 int zone;
950 bool northp;
951 return getUTMPosition(denm.denm.management.event_position, zone, northp);
952}
953
960inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cause_code.value; }
961
968inline uint8_t getSubCauseCode(const DENM& denm) { return denm.denm.situation.event_type.sub_cause_code.value; }
969
978inline std::string getCauseCodeType(const DENM& denm) {
979 if (denm.denm.situation_is_present) {
980 int cause_code = getCauseCode(denm);
981 std::string cause_code_type = "undefined";
982
983 if (cause_code == CauseCodeType().TRAFFIC_CONDITION)
984 cause_code_type = "traffic condition";
985 else if (cause_code == CauseCodeType().ACCIDENT)
986 cause_code_type = "accident";
987 else if (cause_code == CauseCodeType().ROADWORKS)
988 cause_code_type = "roadworks";
989 else if (cause_code == CauseCodeType().IMPASSABILITY)
990 cause_code_type = "impassibility";
991 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION)
992 cause_code_type = "adverse weather condition - adhesion";
993 else if (cause_code == CauseCodeType().AQUAPLANNNING)
994 cause_code_type = "aquaplanning";
995 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION)
996 cause_code_type = "hazardous location - surface condition";
997 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD)
998 cause_code_type = "hazardous location - obstacle on the road";
999 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD)
1000 cause_code_type = "hazardous location - animal on the road";
1001 else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD)
1002 cause_code_type = "human presence on the road";
1003 else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING)
1004 cause_code_type = "wrong way driving";
1005 else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS)
1006 cause_code_type = "rescue and recovery in progress";
1007 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION)
1008 cause_code_type = "adverse weather condition - extreme weather condition";
1009 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY)
1010 cause_code_type = "adverse weather condition - visibility";
1011 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION)
1012 cause_code_type = "adverse weather condition - precipitation";
1013 else if (cause_code == CauseCodeType().SLOW_VEHICLE)
1014 cause_code_type = "slow vehicle";
1015 else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE)
1016 cause_code_type = "dangerous end of queue";
1017 else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN)
1018 cause_code_type = "vehicle breakdown";
1019 else if (cause_code == CauseCodeType().POST_CRASH)
1020 cause_code_type = "post crash";
1021 else if (cause_code == CauseCodeType().HUMAN_PROBLEM)
1022 cause_code_type = "human problem";
1023 else if (cause_code == CauseCodeType().STATIONARY_VEHICLE)
1024 cause_code_type = "stationary vehicle";
1025 else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING)
1026 cause_code_type = "emergency vehicle approaching";
1027 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE)
1028 cause_code_type = "hazardous location - dangerous curve";
1029 else if (cause_code == CauseCodeType().COLLISION_RISK)
1030 cause_code_type = "collision risk";
1031 else if (cause_code == CauseCodeType().SIGNAL_VIOLATION)
1032 cause_code_type = "signal violation";
1033 else if (cause_code == CauseCodeType().DANGEROUS_SITUATION)
1034 cause_code_type = "dangerous situation";
1035
1036 return cause_code_type;
1037 } else {
1038 throw std::invalid_argument("SituationContainer is not present!");
1039 }
1040}
1041
1050inline std::string getSubCauseCodeType(const DENM& denm) {
1051 if (denm.denm.situation_is_present) {
1052 int cause_code = getCauseCode(denm);
1053 int sub_cause_code = getSubCauseCode(denm);
1054 std::string sub_cause_code_type = "undefined";
1055 if (cause_code == CauseCodeType().TRAFFIC_CONDITION) {
1056 if (sub_cause_code == 0)
1057 sub_cause_code_type = "unavailable";
1058 else if (sub_cause_code == 1)
1059 sub_cause_code_type = "not defined";
1060 else if (sub_cause_code == 2)
1061 sub_cause_code_type = "traffic jam slowly increasing";
1062 else if (sub_cause_code == 3)
1063 sub_cause_code_type = "traffic jam increasing";
1064 else if (sub_cause_code == 4)
1065 sub_cause_code_type = "traffic jam strongly increasing";
1066 else if (sub_cause_code == 5)
1067 sub_cause_code_type = "traffic stationary";
1068 else if (sub_cause_code == 6)
1069 sub_cause_code_type = "traffic jam slightly decreasing";
1070 else if (sub_cause_code == 7)
1071 sub_cause_code_type = "traffic jam decreasing";
1072 else if (sub_cause_code == 8)
1073 sub_cause_code_type = "traffic jam strongly decreasing";
1074 } else if (cause_code == CauseCodeType().ACCIDENT) {
1075 if (sub_cause_code == 0)
1076 sub_cause_code_type = "unavailable";
1077 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
1078 sub_cause_code_type = "not defined";
1079 else if (sub_cause_code == 8)
1080 sub_cause_code_type = "assistance requested (e-Call)";
1081 } else if (cause_code == CauseCodeType().ROADWORKS) {
1082 if (sub_cause_code == 0)
1083 sub_cause_code_type = "unavailable";
1084 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1085 sub_cause_code_type = "not defined";
1086 else if (sub_cause_code == 4)
1087 sub_cause_code_type = "short-term stationary roadworks";
1088 else if (sub_cause_code == 5)
1089 sub_cause_code_type = "street cleaning";
1090 else if (sub_cause_code == 6)
1091 sub_cause_code_type = "winter service";
1092 } else if (cause_code == CauseCodeType().IMPASSABILITY)
1093 sub_cause_code_type = "not defined";
1094 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION) {
1095 if (sub_cause_code == 0)
1096 sub_cause_code_type = "unavailable";
1097 else if (sub_cause_code >= 1 && sub_cause_code <= 10)
1098 sub_cause_code_type = "not defined";
1099 } else if (cause_code == CauseCodeType().AQUAPLANNNING)
1100 sub_cause_code_type = "not defined";
1101 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION) {
1102 if (sub_cause_code == 0)
1103 sub_cause_code_type = "unavailable";
1104 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
1105 sub_cause_code_type = "not defined";
1106 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
1107 if (sub_cause_code == 0)
1108 sub_cause_code_type = "unavailable";
1109 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
1110 sub_cause_code_type = "not defined";
1111 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD) {
1112 if (sub_cause_code == 0)
1113 sub_cause_code_type = "unavailable";
1114 else if (sub_cause_code >= 1 && sub_cause_code <= 4)
1115 sub_cause_code_type = "not defined";
1116 } else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD) {
1117 if (sub_cause_code == 0)
1118 sub_cause_code_type = "unavailable";
1119 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1120 sub_cause_code_type = "not defined";
1121 } else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING) {
1122 if (sub_cause_code == 0)
1123 sub_cause_code_type = "unavailable";
1124 else if (sub_cause_code == 1)
1125 sub_cause_code_type = "vehicle driving in wrong lane";
1126 else if (sub_cause_code == 2)
1127 sub_cause_code_type = "vehicle driving in wrong driving direction";
1128 } else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS) {
1129 if (sub_cause_code == 0)
1130 sub_cause_code_type = "unavailable";
1131 else if (sub_cause_code >= 1 && sub_cause_code <= 5)
1132 sub_cause_code_type = "not defined";
1133 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION) {
1134 if (sub_cause_code == 0)
1135 sub_cause_code_type = "unavailable";
1136 else if (sub_cause_code >= 1 && sub_cause_code <= 6)
1137 sub_cause_code_type = "not defined";
1138 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY) {
1139 if (sub_cause_code == 0)
1140 sub_cause_code_type = "unavailable";
1141 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1142 sub_cause_code_type = "not defined";
1143 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION) {
1144 if (sub_cause_code == 0)
1145 sub_cause_code_type = "unavailable";
1146 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1147 sub_cause_code_type = "not defined";
1148 } else if (cause_code == CauseCodeType().SLOW_VEHICLE) {
1149 if (sub_cause_code == 0)
1150 sub_cause_code_type = "unavailable";
1151 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1152 sub_cause_code_type = "not defined";
1153 } else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE) {
1154 if (sub_cause_code == 0)
1155 sub_cause_code_type = "unavailable";
1156 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1157 sub_cause_code_type = "not defined";
1158 } else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN) {
1159 if (sub_cause_code == 0)
1160 sub_cause_code_type = "unavailable";
1161 else if (sub_cause_code == 1)
1162 sub_cause_code_type = "lack of fuel";
1163 else if (sub_cause_code == 2)
1164 sub_cause_code_type = "lack of battery";
1165 else if (sub_cause_code == 3)
1166 sub_cause_code_type = "engine problem";
1167 else if (sub_cause_code == 4)
1168 sub_cause_code_type = "transmission problem";
1169 else if (sub_cause_code == 5)
1170 sub_cause_code_type = "engine cooling problem";
1171 else if (sub_cause_code == 6)
1172 sub_cause_code_type = "braking system problem";
1173 else if (sub_cause_code == 7)
1174 sub_cause_code_type = "steering problem";
1175 else if (sub_cause_code == 8)
1176 sub_cause_code_type = "tyre puncture";
1177 } else if (cause_code == CauseCodeType().POST_CRASH) {
1178 if (sub_cause_code == 0)
1179 sub_cause_code_type = "unavailable";
1180 else if (sub_cause_code == 1)
1181 sub_cause_code_type = "accident without e-Call triggered";
1182 else if (sub_cause_code == 2)
1183 sub_cause_code_type = "accident with e-Call manually triggered";
1184 else if (sub_cause_code == 3)
1185 sub_cause_code_type = "accident with e-Call automatical triggered";
1186 else if (sub_cause_code == 4)
1187 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
1188 } else if (cause_code == CauseCodeType().HUMAN_PROBLEM) {
1189 if (sub_cause_code == 0)
1190 sub_cause_code_type = "unavailable";
1191 else if (sub_cause_code == 1)
1192 sub_cause_code_type = "glycaemia problem";
1193 else if (sub_cause_code == 2)
1194 sub_cause_code_type = "heart problem";
1195 } else if (cause_code == CauseCodeType().STATIONARY_VEHICLE) {
1196 if (sub_cause_code == 0)
1197 sub_cause_code_type = "unavailable";
1198 else if (sub_cause_code == 1)
1199 sub_cause_code_type = "human problem";
1200 else if (sub_cause_code == 2)
1201 sub_cause_code_type = "vehicle breakdown";
1202 else if (sub_cause_code == 3)
1203 sub_cause_code_type = "post crash";
1204 else if (sub_cause_code == 4)
1205 sub_cause_code_type = "public transport stop";
1206 else if (sub_cause_code == 5)
1207 sub_cause_code_type = "carrying dangerous goods";
1208 } else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING) {
1209 if (sub_cause_code == 0)
1210 sub_cause_code_type = "unavailable";
1211 else if (sub_cause_code == 1)
1212 sub_cause_code_type = "emergency vehicle approaching";
1213 else if (sub_cause_code == 2)
1214 sub_cause_code_type = "prioritized vehicle approaching";
1215 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE) {
1216 if (sub_cause_code == 0)
1217 sub_cause_code_type = "unavailable";
1218 else if (sub_cause_code == 1)
1219 sub_cause_code_type = "dangerous left turn curve";
1220 else if (sub_cause_code == 2)
1221 sub_cause_code_type = "dangerous right turn curve";
1222 else if (sub_cause_code == 3)
1223 sub_cause_code_type = "multiple curves starting with unknown turning direction";
1224 else if (sub_cause_code == 4)
1225 sub_cause_code_type = "multiple curves starting with left turn";
1226 else if (sub_cause_code == 5)
1227 sub_cause_code_type = "multiple curves starting with right turn";
1228 } else if (cause_code == CauseCodeType().COLLISION_RISK) {
1229 if (sub_cause_code == 0)
1230 sub_cause_code_type = "unavailable";
1231 else if (sub_cause_code == 1)
1232 sub_cause_code_type = "longitudinal collision risk";
1233 else if (sub_cause_code == 2)
1234 sub_cause_code_type = "crossing collision risk";
1235 else if (sub_cause_code == 3)
1236 sub_cause_code_type = "lateral collision risk";
1237 else if (sub_cause_code == 4)
1238 sub_cause_code_type = "collision risk involving vulnerable road user";
1239 } else if (cause_code == CauseCodeType().SIGNAL_VIOLATION) {
1240 if (sub_cause_code == 0)
1241 sub_cause_code_type = "unavailable";
1242 else if (sub_cause_code == 1)
1243 sub_cause_code_type = "stop sign violation";
1244 else if (sub_cause_code == 2)
1245 sub_cause_code_type = "traffic light violation";
1246 else if (sub_cause_code == 3)
1247 sub_cause_code_type = "turning regulation violation";
1248 } else if (cause_code == CauseCodeType().DANGEROUS_SITUATION) {
1249 if (sub_cause_code == 0)
1250 sub_cause_code_type = "unavailable";
1251 else if (sub_cause_code == 1)
1252 sub_cause_code_type = "emergency electronic break lights";
1253 else if (sub_cause_code == 2)
1254 sub_cause_code_type = "pre-crash system activated";
1255 else if (sub_cause_code == 3)
1256 sub_cause_code_type = "ESP (electronic stability program) activated";
1257 else if (sub_cause_code == 4)
1258 sub_cause_code_type = "ABS (anti-lock breaking system) activated";
1259 else if (sub_cause_code == 5)
1260 sub_cause_code_type = "AEB (automatic emergency breaking) activated";
1261 else if (sub_cause_code == 6)
1262 sub_cause_code_type = "break warning activated";
1263 else if (sub_cause_code == 7)
1264 sub_cause_code_type = "collision risk warning activated";
1265 }
1266 return sub_cause_code_type;
1267 } else {
1268 throw std::invalid_argument("SituationContainer is not present!");
1269 }
1270}
1271
1278inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
1279 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
1280}
1281
1288inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
1289 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
1290}
1291
1292} // namespace etsi_its_denm_msgs::access
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
std::vector< bool > getLightBarSirenInUse(const LightBarSirenInUse &light_bar_siren_in_use)
Get the Lightbar Siren In Use in form of bool vector.
std::vector< bool > getDrivingLaneStatus(const DrivingLaneStatus &driving_lane_status)
Get the Driving Lane Status in form of bool vector.
double getHeading(const DENM &denm)
Get the Heading object.
std::string getCauseCodeType(const DENM &denm)
Get the Cause Code Type object.
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.
gm::PointStamped getUTMPosition(const T &reference_position, int &zone, bool &northp)
Get the UTM Position defined by the given ReferencePosition.
double getHeadingConfidence(const DENM &denm)
Get the Heading confidence.
double getHeadingCDD(const Heading &heading)
Get the Heading value.
double getLongitude(const Longitude &longitude)
Get the Longitude value.
double getHeadingConfidenceCDD(const Heading &heading)
Get the Heading value.
uint8_t getStationType(const DENM &denm)
Get the stationType 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.
double getLatitude(const Latitude &latitude)
Get the Latitude value.
uint8_t getCauseCode(const DENM &denm)
Get the Cause Code object.
double getAltitude(const Altitude &altitude)
Get the Altitude value.
bool getIsHeadingPresent(const DENM &denm)
Get the IsHeadingPresent object.
double getSpeed(const Speed &speed)
Get the vehicle speed.

◆ getHeading()

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

Get the Heading object.

Parameters
denmDENM to get the Heading-Value from
Returns
heading value in degree as decimal number

Definition at line 308 of file denm_getters.h.

308 {
309 if (denm.denm.situation_is_present) {
310 int cause_code = getCauseCode(denm);
311 int sub_cause_code = getSubCauseCode(denm);
312 std::string sub_cause_code_type = "undefined";
313 if (cause_code == CauseCodeType().TRAFFIC_CONDITION) {
314 if (sub_cause_code == 0)
315 sub_cause_code_type = "unavailable";
316 else if (sub_cause_code == 1)
317 sub_cause_code_type = "not defined";
318 else if (sub_cause_code == 2)

◆ getHeadingCDD()

template<typename Heading>
double etsi_its_denm_msgs::access::getHeadingCDD ( 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 132 of file denm_getters.h.

◆ getHeadingConfidence()

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

Get the Heading confidence.

Parameters
denmDENM to get the Heading-Value from
Returns
standard deviation of heading in degrees as decimal number

Definition at line 326 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 <= 7)
336 sub_cause_code_type = "not defined";

◆ getHeadingConfidenceCDD()

template<typename Heading>
double etsi_its_denm_msgs::access::getHeadingConfidenceCDD ( 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 standard deviation from
Returns
Heading standard deviation in degree as decimal number

Definition at line 143 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 344 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 376 of file denm_getters.h.

379 {
380 if (sub_cause_code == 0)
381 sub_cause_code_type = "unavailable";
382 else if (sub_cause_code == 1)

◆ 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 284 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 55 of file denm_getters.h.

◆ 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 753 of file denm_getters.h.

786 {
787
788#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
790
797inline uint32_t getStationID(const DENM& denm) { return getStationID(denm.header); }
798
805inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
806
813inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
814
821inline uint8_t getStationType(const DENM& denm) { return denm.denm.management.station_type.value; }
822
829inline double getLatitude(const DENM& denm) { return getLatitude(denm.denm.management.event_position.latitude); }
830
837inline double getLongitude(const DENM& denm) { return getLongitude(denm.denm.management.event_position.longitude); }
838
845inline double getAltitude(const DENM& denm) { return getAltitude(denm.denm.management.event_position.altitude); }
846
853inline double getHeading(const DENM& denm) {
854 if (denm.denm.location_is_present) {
855 if (denm.denm.location.event_position_heading_is_present) {
856 return getHeadingCDD(denm.denm.location.event_position_heading);
857 } else {
858 throw std::invalid_argument("Heading is not present!");
859 }
860 } else {
861 throw std::invalid_argument("LocationContainer is not present!");
862 }
863}
864
871inline double getHeadingConfidence(const DENM& denm) {
872 if (denm.denm.location_is_present) {
873 if (denm.denm.location.event_position_heading_is_present) {
874 return getHeadingConfidenceCDD(denm.denm.location.event_position_heading);
875 } else {
876 throw std::invalid_argument("Heading is not present!");
877 }
878 } else {
879 throw std::invalid_argument("LocationContainer is not present!");
880 }
881}
882
889inline bool getIsHeadingPresent(const DENM& denm) {
890 if (denm.denm.location_is_present) {
891 return denm.denm.location.event_position_heading_is_present;
892 } else {
893 throw std::invalid_argument("LocationContainer is not present!");
894 }
895}
896
903inline double getSpeed(const DENM& denm) {
904 if (denm.denm.location_is_present) {
905 if (denm.denm.location.event_speed_is_present) {
906 return getSpeed(denm.denm.location.event_speed);
907 } else {
908 throw std::invalid_argument("Speed is not present!");
909 }
910 } else {
911 throw std::invalid_argument("LocationContainer is not present!");
912 }
913}
914
921inline bool getIsSpeedPresent(const DENM& denm) {
922 if (denm.denm.location_is_present) {
923 return denm.denm.location.event_speed_is_present;
924 } else {
925 throw std::invalid_argument("LocationContainer is not present!");
926 }
927}
928
935inline double getSpeedConfidence(const DENM& denm) {
936 return getSpeedConfidence(
937 denm.denm.location.event_speed);
938}
939
948inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
949 return getUTMPosition(denm.denm.management.event_position, zone, northp);
950}
951
958inline gm::PointStamped getUTMPosition(const DENM& denm) {
959 int zone;
960 bool northp;
961 return getUTMPosition(denm.denm.management.event_position, zone, northp);
962}
963
970inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cause_code.value; }
971
978inline uint8_t getSubCauseCode(const DENM& denm) { return denm.denm.situation.event_type.sub_cause_code.value; }
979
988inline std::string getCauseCodeType(const DENM& denm) {
989 if (denm.denm.situation_is_present) {
990 int cause_code = getCauseCode(denm);
991 std::string cause_code_type = "undefined";
992
993 if (cause_code == CauseCodeType().TRAFFIC_CONDITION)
994 cause_code_type = "traffic condition";
995 else if (cause_code == CauseCodeType().ACCIDENT)
996 cause_code_type = "accident";
997 else if (cause_code == CauseCodeType().ROADWORKS)
998 cause_code_type = "roadworks";
999 else if (cause_code == CauseCodeType().IMPASSABILITY)
1000 cause_code_type = "impassibility";
1001 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION)
1002 cause_code_type = "adverse weather condition - adhesion";
1003 else if (cause_code == CauseCodeType().AQUAPLANNNING)
1004 cause_code_type = "aquaplanning";
1005 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION)
1006 cause_code_type = "hazardous location - surface condition";
1007 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD)
1008 cause_code_type = "hazardous location - obstacle on the road";
1009 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD)
1010 cause_code_type = "hazardous location - animal on the road";
1011 else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD)
1012 cause_code_type = "human presence on the road";
1013 else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING)
1014 cause_code_type = "wrong way driving";
1015 else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS)
1016 cause_code_type = "rescue and recovery in progress";
1017 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION)
1018 cause_code_type = "adverse weather condition - extreme weather condition";
1019 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY)
1020 cause_code_type = "adverse weather condition - visibility";
1021 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION)
1022 cause_code_type = "adverse weather condition - precipitation";
1023 else if (cause_code == CauseCodeType().SLOW_VEHICLE)
1024 cause_code_type = "slow vehicle";
1025 else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE)
1026 cause_code_type = "dangerous end of queue";
1027 else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN)
1028 cause_code_type = "vehicle breakdown";
1029 else if (cause_code == CauseCodeType().POST_CRASH)
1030 cause_code_type = "post crash";
1031 else if (cause_code == CauseCodeType().HUMAN_PROBLEM)
1032 cause_code_type = "human problem";
1033 else if (cause_code == CauseCodeType().STATIONARY_VEHICLE)
1034 cause_code_type = "stationary vehicle";
1035 else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING)
1036 cause_code_type = "emergency vehicle approaching";
1037 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE)
1038 cause_code_type = "hazardous location - dangerous curve";
1039 else if (cause_code == CauseCodeType().COLLISION_RISK)
1040 cause_code_type = "collision risk";
1041 else if (cause_code == CauseCodeType().SIGNAL_VIOLATION)
1042 cause_code_type = "signal violation";
1043 else if (cause_code == CauseCodeType().DANGEROUS_SITUATION)
1044 cause_code_type = "dangerous situation";
1045
1046 return cause_code_type;
1047 } else {
1048 throw std::invalid_argument("SituationContainer is not present!");
1049 }
1050}
1051
1060inline std::string getSubCauseCodeType(const DENM& denm) {
1061 if (denm.denm.situation_is_present) {
1062 int cause_code = getCauseCode(denm);
1063 int sub_cause_code = getSubCauseCode(denm);
1064 std::string sub_cause_code_type = "undefined";
1065 if (cause_code == CauseCodeType().TRAFFIC_CONDITION) {
1066 if (sub_cause_code == 0)
1067 sub_cause_code_type = "unavailable";
1068 else if (sub_cause_code == 1)
1069 sub_cause_code_type = "not defined";
1070 else if (sub_cause_code == 2)
1071 sub_cause_code_type = "traffic jam slowly increasing";
1072 else if (sub_cause_code == 3)
1073 sub_cause_code_type = "traffic jam increasing";
1074 else if (sub_cause_code == 4)
1075 sub_cause_code_type = "traffic jam strongly increasing";
1076 else if (sub_cause_code == 5)
1077 sub_cause_code_type = "traffic stationary";
1078 else if (sub_cause_code == 6)
1079 sub_cause_code_type = "traffic jam slightly decreasing";
1080 else if (sub_cause_code == 7)
1081 sub_cause_code_type = "traffic jam decreasing";
1082 else if (sub_cause_code == 8)
1083 sub_cause_code_type = "traffic jam strongly decreasing";
1084 } else if (cause_code == CauseCodeType().ACCIDENT) {
1085 if (sub_cause_code == 0)
1086 sub_cause_code_type = "unavailable";
1087 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
1088 sub_cause_code_type = "not defined";
1089 else if (sub_cause_code == 8)
1090 sub_cause_code_type = "assistance requested (e-Call)";
1091 } else if (cause_code == CauseCodeType().ROADWORKS) {
1092 if (sub_cause_code == 0)
1093 sub_cause_code_type = "unavailable";
1094 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1095 sub_cause_code_type = "not defined";
1096 else if (sub_cause_code == 4)
1097 sub_cause_code_type = "short-term stationary roadworks";
1098 else if (sub_cause_code == 5)
1099 sub_cause_code_type = "street cleaning";
1100 else if (sub_cause_code == 6)
1101 sub_cause_code_type = "winter service";
1102 } else if (cause_code == CauseCodeType().IMPASSABILITY)
1103 sub_cause_code_type = "not defined";
1104 else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_ADHESION) {
1105 if (sub_cause_code == 0)
1106 sub_cause_code_type = "unavailable";
1107 else if (sub_cause_code >= 1 && sub_cause_code <= 10)
1108 sub_cause_code_type = "not defined";
1109 } else if (cause_code == CauseCodeType().AQUAPLANNNING)
1110 sub_cause_code_type = "not defined";
1111 else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_SURFACE_CONDITION) {
1112 if (sub_cause_code == 0)
1113 sub_cause_code_type = "unavailable";
1114 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
1115 sub_cause_code_type = "not defined";
1116 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
1117 if (sub_cause_code == 0)
1118 sub_cause_code_type = "unavailable";
1119 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
1120 sub_cause_code_type = "not defined";
1121 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD) {
1122 if (sub_cause_code == 0)
1123 sub_cause_code_type = "unavailable";
1124 else if (sub_cause_code >= 1 && sub_cause_code <= 4)
1125 sub_cause_code_type = "not defined";
1126 } else if (cause_code == CauseCodeType().HUMAN_PRESENCE_ON_THE_ROAD) {
1127 if (sub_cause_code == 0)
1128 sub_cause_code_type = "unavailable";
1129 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1130 sub_cause_code_type = "not defined";
1131 } else if (cause_code == CauseCodeType().WRONG_WAY_DRIVING) {
1132 if (sub_cause_code == 0)
1133 sub_cause_code_type = "unavailable";
1134 else if (sub_cause_code == 1)
1135 sub_cause_code_type = "vehicle driving in wrong lane";
1136 else if (sub_cause_code == 2)
1137 sub_cause_code_type = "vehicle driving in wrong driving direction";
1138 } else if (cause_code == CauseCodeType().RESCUE_AND_RECOVERY_WORK_IN_PROGRESS) {
1139 if (sub_cause_code == 0)
1140 sub_cause_code_type = "unavailable";
1141 else if (sub_cause_code >= 1 && sub_cause_code <= 5)
1142 sub_cause_code_type = "not defined";
1143 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION) {
1144 if (sub_cause_code == 0)
1145 sub_cause_code_type = "unavailable";
1146 else if (sub_cause_code >= 1 && sub_cause_code <= 6)
1147 sub_cause_code_type = "not defined";
1148 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_VISIBILITY) {
1149 if (sub_cause_code == 0)
1150 sub_cause_code_type = "unavailable";
1151 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1152 sub_cause_code_type = "not defined";
1153 } else if (cause_code == CauseCodeType().ADVERSE_WEATHER_CONDITION_PRECIPITATION) {
1154 if (sub_cause_code == 0)
1155 sub_cause_code_type = "unavailable";
1156 else if (sub_cause_code >= 1 && sub_cause_code <= 3)
1157 sub_cause_code_type = "not defined";
1158 } else if (cause_code == CauseCodeType().SLOW_VEHICLE) {
1159 if (sub_cause_code == 0)
1160 sub_cause_code_type = "unavailable";
1161 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1162 sub_cause_code_type = "not defined";
1163 } else if (cause_code == CauseCodeType().DANGEROUS_END_OF_QUEUE) {
1164 if (sub_cause_code == 0)
1165 sub_cause_code_type = "unavailable";
1166 else if (sub_cause_code >= 1 && sub_cause_code <= 8)
1167 sub_cause_code_type = "not defined";
1168 } else if (cause_code == CauseCodeType().VEHICLE_BREAKDOWN) {
1169 if (sub_cause_code == 0)
1170 sub_cause_code_type = "unavailable";
1171 else if (sub_cause_code == 1)
1172 sub_cause_code_type = "lack of fuel";
1173 else if (sub_cause_code == 2)
1174 sub_cause_code_type = "lack of battery";
1175 else if (sub_cause_code == 3)
1176 sub_cause_code_type = "engine problem";
1177 else if (sub_cause_code == 4)
1178 sub_cause_code_type = "transmission problem";
1179 else if (sub_cause_code == 5)
1180 sub_cause_code_type = "engine cooling problem";
1181 else if (sub_cause_code == 6)
1182 sub_cause_code_type = "braking system problem";
1183 else if (sub_cause_code == 7)
1184 sub_cause_code_type = "steering problem";
1185 else if (sub_cause_code == 8)
1186 sub_cause_code_type = "tyre puncture";
1187 } else if (cause_code == CauseCodeType().POST_CRASH) {
1188 if (sub_cause_code == 0)
1189 sub_cause_code_type = "unavailable";
1190 else if (sub_cause_code == 1)
1191 sub_cause_code_type = "accident without e-Call triggered";
1192 else if (sub_cause_code == 2)
1193 sub_cause_code_type = "accident with e-Call manually triggered";
1194 else if (sub_cause_code == 3)
1195 sub_cause_code_type = "accident with e-Call automatical triggered";
1196 else if (sub_cause_code == 4)
1197 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
1198 } else if (cause_code == CauseCodeType().HUMAN_PROBLEM) {
1199 if (sub_cause_code == 0)
1200 sub_cause_code_type = "unavailable";
1201 else if (sub_cause_code == 1)
1202 sub_cause_code_type = "glycaemia problem";
1203 else if (sub_cause_code == 2)
1204 sub_cause_code_type = "heart problem";
1205 } else if (cause_code == CauseCodeType().STATIONARY_VEHICLE) {
1206 if (sub_cause_code == 0)
1207 sub_cause_code_type = "unavailable";
1208 else if (sub_cause_code == 1)
1209 sub_cause_code_type = "human problem";
1210 else if (sub_cause_code == 2)
1211 sub_cause_code_type = "vehicle breakdown";
1212 else if (sub_cause_code == 3)
1213 sub_cause_code_type = "post crash";
1214 else if (sub_cause_code == 4)
1215 sub_cause_code_type = "public transport stop";
1216 else if (sub_cause_code == 5)
1217 sub_cause_code_type = "carrying dangerous goods";
1218 } else if (cause_code == CauseCodeType().EMERGENCY_VEHICLE_APPROACHING) {
1219 if (sub_cause_code == 0)
1220 sub_cause_code_type = "unavailable";
1221 else if (sub_cause_code == 1)
1222 sub_cause_code_type = "emergency vehicle approaching";
1223 else if (sub_cause_code == 2)
1224 sub_cause_code_type = "prioritized vehicle approaching";
1225 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_DANGEROUS_CURVE) {
1226 if (sub_cause_code == 0)
1227 sub_cause_code_type = "unavailable";
1228 else if (sub_cause_code == 1)
1229 sub_cause_code_type = "dangerous left turn curve";
1230 else if (sub_cause_code == 2)
1231 sub_cause_code_type = "dangerous right turn curve";
1232 else if (sub_cause_code == 3)
1233 sub_cause_code_type = "multiple curves starting with unknown turning direction";
1234 else if (sub_cause_code == 4)
1235 sub_cause_code_type = "multiple curves starting with left turn";
1236 else if (sub_cause_code == 5)
1237 sub_cause_code_type = "multiple curves starting with right turn";
1238 } else if (cause_code == CauseCodeType().COLLISION_RISK) {
1239 if (sub_cause_code == 0)
1240 sub_cause_code_type = "unavailable";
1241 else if (sub_cause_code == 1)
1242 sub_cause_code_type = "longitudinal collision risk";
1243 else if (sub_cause_code == 2)
1244 sub_cause_code_type = "crossing collision risk";
1245 else if (sub_cause_code == 3)
1246 sub_cause_code_type = "lateral collision risk";
1247 else if (sub_cause_code == 4)
1248 sub_cause_code_type = "collision risk involving vulnerable road user";
1249 } else if (cause_code == CauseCodeType().SIGNAL_VIOLATION) {
1250 if (sub_cause_code == 0)
1251 sub_cause_code_type = "unavailable";
1252 else if (sub_cause_code == 1)
1253 sub_cause_code_type = "stop sign violation";
1254 else if (sub_cause_code == 2)
1255 sub_cause_code_type = "traffic light violation";
1256 else if (sub_cause_code == 3)
1257 sub_cause_code_type = "turning regulation violation";
1258 } else if (cause_code == CauseCodeType().DANGEROUS_SITUATION) {
1259 if (sub_cause_code == 0)
1260 sub_cause_code_type = "unavailable";
1261 else if (sub_cause_code == 1)
1262 sub_cause_code_type = "emergency electronic break lights";
1263 else if (sub_cause_code == 2)
1264 sub_cause_code_type = "pre-crash system activated";
1265 else if (sub_cause_code == 3)
1266 sub_cause_code_type = "ESP (electronic stability program) activated";
1267 else if (sub_cause_code == 4)
1268 sub_cause_code_type = "ABS (anti-lock breaking system) activated";
1269 else if (sub_cause_code == 5)
1270 sub_cause_code_type = "AEB (automatic emergency breaking) activated";
1271 else if (sub_cause_code == 6)
1272 sub_cause_code_type = "break warning activated";
1273 else if (sub_cause_code == 7)
1274 sub_cause_code_type = "collision risk warning activated";
1275 }
1276 return sub_cause_code_type;
1277 } else {
1278 throw std::invalid_argument("SituationContainer is not present!");
1279 }
1280}
1281
1288inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
1289 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
1290}
1291
1298inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
1299 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
1300}
1301
1302} // 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 292 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 63 of file denm_getters.h.

◆ getPosConfidenceEllipse() [1/2]

template<typename PosConfidenceEllipse>
std::tuple< double, double, double > etsi_its_denm_msgs::access::getPosConfidenceEllipse ( const PosConfidenceEllipse & position_confidence_ellipse)
inline

Extract major axis length, minor axis length and orientation from the given position confidence ellipse.

Parameters
position_confidence_ellipseThe position confidence ellipse to extract the values from
Returns
std::tuple<double, double, double> major axis length in meters, minor axis length in meters, and orientation in degrees

Definition at line 163 of file denm_getters.h.

169 {

◆ getPosConfidenceEllipse() [2/2]

template<typename PosConfidenceEllipse>
std::array< double, 4 > etsi_its_denm_msgs::access::getPosConfidenceEllipse ( const PosConfidenceEllipse & position_confidence_ellipse,
const double object_heading )
inline

Get the covariance matrix of the position confidence ellipse.

Parameters
position_confidence_ellipseThe position confidence ellipse to get the covariance matrix from
object_headingThe object heading in radians
Returns
std::array<double, 4> The covariance matrix of the position confidence ellipse in vehicle coordinates (x = longitudinal, y = lateral)

Definition at line 224 of file denm_getters.h.

226 { return denm.denm.situation.event_type.sub_cause_code.value; }
227

◆ 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 260 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 268 of file denm_getters.h.

◆ getSemiAxis()

template<typename SemiAxisLength>
double etsi_its_denm_msgs::access::getSemiAxis ( const SemiAxisLength & semi_axis_length)
inline

Get the Semi Axis object.

Parameters
semi_axis_lengthThe SemiAxisLength object to get the semi axis from
Returns
double the semi axis length in meters

Definition at line 152 of file denm_getters.h.

152 {
153 if (denm.denm.location.event_speed_is_present) {
154 return getSpeed(denm.denm.location.event_speed);

◆ 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 358 of file denm_getters.h.

359 {
360 if (sub_cause_code == 0)
361 sub_cause_code_type = "unavailable";
362 else if (sub_cause_code >= 1 && sub_cause_code <= 9)
363 sub_cause_code_type = "not defined";
364 } else if (cause_code == CauseCodeType().HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD) {
365 if (sub_cause_code == 0)
366 sub_cause_code_type = "unavailable";
367 else if (sub_cause_code >= 1 && sub_cause_code <= 7)
368 sub_cause_code_type = "not defined";

◆ 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 79 of file denm_getters.h.

◆ getSpeedConfidence() [1/2]

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

Get the Speed Confidence.

Parameters
denmDENM to get the Speed Confidence from
Returns
double standard deviation of the speed in m/s as decimal number

Definition at line 390 of file denm_getters.h.

391 {
392 if (sub_cause_code == 0)
393 sub_cause_code_type = "unavailable";

◆ getSpeedConfidence() [2/2]

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

Get the Speed Confidence.

Parameters
speedto get the SpeedConfidence from
Returns
double speed standard deviation in m/s as decimal number

Definition at line 87 of file denm_getters.h.

◆ 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 252 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 47 of file denm_getters.h.

◆ 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 276 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 433 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 515 of file denm_getters.h.

525 {
526 throw std::invalid_argument("SituationContainer is not present!");
527 }
528}
529
536inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
537 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
538}
539
546inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
547 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
548}
549
550} // namespace etsi_its_denm_msgs::access
std::vector< bool > getDrivingLaneStatus(const DrivingLaneStatus &driving_lane_status)
Get the Driving Lane Status in form of bool vector.

◆ 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 413 of file denm_getters.h.

416 {
417 if (sub_cause_code == 0)

◆ 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 403 of file denm_getters.h.

◆ 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 103 of file denm_getters.h.

103 {
104 return getHeadingCDD(denm.denm.location.event_position_heading);
105 } else {
106 throw std::invalid_argument("Heading is not present!");
107 }
108 } else {
109 throw std::invalid_argument("LocationContainer is not present!");
110 }
111}
112
119inline double getHeadingConfidence(const DENM& denm) {
120 if (denm.denm.location_is_present) {
121 if (denm.denm.location.event_position_heading_is_present) {

◆ getWGSPosConfidenceEllipse()

template<typename PosConfidenceEllipse>
std::array< double, 4 > etsi_its_denm_msgs::access::getWGSPosConfidenceEllipse ( const PosConfidenceEllipse & position_confidence_ellipse)
inline

Get the covariance matrix of the position confidence ellipse.

Parameters
position_confidence_ellipseThe position confidence ellipse to get the covariance matrix from
object_headingThe object heading in radians
Returns
std::array<double, 4> The covariance matrix of the position confidence ellipse in WGS coordinates (x = North, y = East)

Definition at line 237 of file denm_getters.h.

237 {
238 int cause_code = getCauseCode(denm);
239 std::string cause_code_type = "undefined";
240

◆ WGSCovMatrixFromConfidenceEllipse()

std::array< double, 4 > etsi_its_denm_msgs::access::WGSCovMatrixFromConfidenceEllipse ( double semi_major,
double semi_minor,
double major_orientation )
inline

Convert the confidence ellipse to a covariance matrix.

Note that the major_orientation is given in degrees, while the object_heading is given in radians!

Parameters
semi_majorSemi major axis length in meters
semi_minorSemi minor axis length in meters
major_orientationOrientation of the major axis in degrees, relative to WGS84
Returns
std::array<double, 4> The covariance matrix in WGS coordinates (x = North, y = East)

Definition at line 211 of file denm_getters.h.