etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_ts_getters.h
Go to the documentation of this file.
1/*
2=============================================================================
3MIT License
4
5Copyright (c) 2023-2025 Institute for Automotive Engineering (ika), RWTH Aachen University
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24=============================================================================
25*/
26
31
32#pragma once
33
34namespace etsi_its_denm_ts_msgs::access {
35
37
39
43 * @param denm DENM to get the WGS Heading-Value from
44 * @return heading value in degree as decimal number
45 */
46inline double getWGSHeading(const DENM& denm) {
47 if (denm.denm.location_is_present) {
48 if (denm.denm.location.event_position_heading_is_present) {
49 return getWGSHeadingCDD(denm.denm.location.event_position_heading);
50 } else {
51 throw std::invalid_argument("Wgs84Angle is not present!");
52 }
53 } else {
54 throw std::invalid_argument("LocationContainer is not present!");
55 }
56}
57
64inline double getWGSHeadingConfidence(const DENM& denm) {
65 if (denm.denm.location_is_present) {
66 if (denm.denm.location.event_position_heading_is_present) {
67 return getWGSHeadingConfidenceCDD(denm.denm.location.event_position_heading);
68 } else {
69 throw std::invalid_argument("Wgs84Angle is not present!");
70 }
71 } else {
72 throw std::invalid_argument("LocationContainer is not present!");
73 }
74}
77
82inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cc_and_scc.choice; }
90inline uint8_t getSubCauseCode(const DENM& denm) {
91 int cause_code = getCauseCode(denm);
92 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1)
93 return denm.denm.situation.event_type.cc_and_scc.traffic_condition1.value;
94 else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2)
95 return denm.denm.situation.event_type.cc_and_scc.accident2.value;
96 else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3)
97 return denm.denm.situation.event_type.cc_and_scc.roadworks3.value;
98 else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5)
99 return denm.denm.situation.event_type.cc_and_scc.impassability5.value;
100 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6)
101 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_adhesion6.value;
102 else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
103 return denm.denm.situation.event_type.cc_and_scc.aquaplaning7.value;
104 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9)
105 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_surface_condition9.value;
106 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10)
107 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_obstacle_on_the_road10.value;
108 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11)
109 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_animal_on_the_road11.value;
110 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12)
111 return denm.denm.situation.event_type.cc_and_scc.human_presence_on_the_road12.value;
112 else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14)
113 return denm.denm.situation.event_type.cc_and_scc.wrong_way_driving14.value;
114 else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15)
115 return denm.denm.situation.event_type.cc_and_scc.rescue_and_recovery_work_in_progress15.value;
116 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17)
117 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_extreme_weather_condition17.value;
118 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18)
119 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_visibility18.value;
120 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19)
121 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_precipitation19.value;
122 else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
123 return denm.denm.situation.event_type.cc_and_scc.violence20.value;
124 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26)
125 return denm.denm.situation.event_type.cc_and_scc.slow_vehicle26.value;
126 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27)
127 return denm.denm.situation.event_type.cc_and_scc.dangerous_end_of_queue27.value;
128 else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
129 return denm.denm.situation.event_type.cc_and_scc.public_transport_vehicle_approaching28.value;
130 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91)
131 return denm.denm.situation.event_type.cc_and_scc.vehicle_breakdown91.value;
132 else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92)
133 return denm.denm.situation.event_type.cc_and_scc.post_crash92.value;
134 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93)
135 return denm.denm.situation.event_type.cc_and_scc.human_problem93.value;
136 else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94)
137 return denm.denm.situation.event_type.cc_and_scc.stationary_vehicle94.value;
138 else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95)
139 return denm.denm.situation.event_type.cc_and_scc.emergency_vehicle_approaching95.value;
140 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96)
141 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_dangerous_curve96.value;
142 else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97)
143 return denm.denm.situation.event_type.cc_and_scc.collision_risk97.value;
144 else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98)
145 return denm.denm.situation.event_type.cc_and_scc.signal_violation98.value;
146 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99)
147 return denm.denm.situation.event_type.cc_and_scc.dangerous_situation99.value;
148 else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100)
149 return denm.denm.situation.event_type.cc_and_scc.railway_level_crossing100.value;
150 return denm.denm.situation.event_type.cc_and_scc.reserved0.value;
151}
152
158 * @param denm DENM to get the causeCodeType value from
159 * @return causeCodeType value
160 */
161inline std::string getCauseCodeType(const DENM& denm) {
162 if (denm.denm.situation_is_present) {
163 int cause_code = getCauseCode(denm);
164 std::string cause_code_type = "undefined";
165
166 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1)
167 cause_code_type = "traffic condition";
168 else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2)
169 cause_code_type = "accident";
170 else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3)
171 cause_code_type = "roadworks";
172 else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5)
173 cause_code_type = "impassability";
174 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6)
175 cause_code_type = "adverse weather condition - adhesion";
176 else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
177 cause_code_type = "aquaplaning";
178 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9)
179 cause_code_type = "hazardous location - surface condition";
180 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10)
181 cause_code_type = "hazardous location - obstacle on the road";
182 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11)
183 cause_code_type = "hazardous location - animal on the road";
184 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12)
185 cause_code_type = "human presence on the road";
186 else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14)
187 cause_code_type = "wrong way driving";
188 else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15)
189 cause_code_type = "rescue and recovery in progress";
190 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17)
191 cause_code_type = "adverse weather condition - extreme weather condition";
192 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18)
193 cause_code_type = "adverse weather condition - visibility";
194 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19)
195 cause_code_type = "adverse weather condition - precipitation";
196 else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
197 cause_code_type = "violence";
198 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26)
199 cause_code_type = "slow vehicle";
200 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27)
201 cause_code_type = "dangerous end of queue";
202 else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
203 cause_code_type = "public transport vehicle approaching";
204 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91)
205 cause_code_type = "vehicle breakdown";
206 else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92)
207 cause_code_type = "post crash";
208 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93)
209 cause_code_type = "human problem";
210 else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94)
211 cause_code_type = "stationary vehicle";
212 else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95)
213 cause_code_type = "emergency vehicle approaching";
214 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96)
215 cause_code_type = "hazardous location - dangerous curve";
216 else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97)
217 cause_code_type = "collision risk";
218 else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98)
219 cause_code_type = "signal violation";
220 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99)
221 cause_code_type = "dangerous situation";
222 else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100)
223 cause_code_type = "railway level crossing";
224
225 return cause_code_type;
226 } else {
227 throw std::invalid_argument("SituationContainer is not present!");
228 }
229}
230
232
239inline std::string getSubCauseCodeType(const DENM& denm) {
240 if (denm.denm.situation_is_present) {
241 int cause_code = getCauseCode(denm);
242 int sub_cause_code = getSubCauseCode(denm);
243 std::string sub_cause_code_type = "undefined";
244 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1) {
245 if (sub_cause_code == TrafficConditionSubCauseCode().UNAVAILABLE)
246 sub_cause_code_type = "unavailable";
247 else if (sub_cause_code == TrafficConditionSubCauseCode().INCREASED_VOLUME_OF_TRAFFIC)
248 sub_cause_code_type = "increased volume of traffic";
249 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_SLOWLY_INCREASING)
250 sub_cause_code_type = "traffic jam slowly increasing";
251 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_INCREASING)
252 sub_cause_code_type = "traffic jam increasing";
253 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STRONGLY_INCREASING)
254 sub_cause_code_type = "traffic jam strongly increasing";
255 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM)
256 sub_cause_code_type = "traffic jam";
257 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_SLIGHTLY_DECREASING)
258 sub_cause_code_type = "traffic jam slightly decreasing";
259 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_DECREASING)
260 sub_cause_code_type = "traffic jam decreasing";
261 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STRONGLY_DECREASING)
262 sub_cause_code_type = "traffic jam strongly decreasing";
263 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STABLE)
264 sub_cause_code_type = "traffic jam stable";
265 } else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2) {
266 if (sub_cause_code == AccidentSubCauseCode().UNAVAILABLE)
267 sub_cause_code_type = "unavailable";
268 else if (sub_cause_code == AccidentSubCauseCode().MULTI_VEHICLE_ACCIDENT)
269 sub_cause_code_type = "multi-vehicle accident";
270 else if (sub_cause_code == AccidentSubCauseCode().HEAVY_ACCIDENT)
271 sub_cause_code_type = "heavy accident";
272 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_LORRY)
273 sub_cause_code_type = "accident involving lorry";
274 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_BUS)
275 sub_cause_code_type = "accident involving bus";
276 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_HAZARDOUS_MATERIALS)
277 sub_cause_code_type = "accident involving hazardous materials";
278 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_ON_OPPOSITE_LANE)
279 sub_cause_code_type = "accident on opposite lane";
280 else if (sub_cause_code == AccidentSubCauseCode().UNSECURED_ACCIDENT)
281 sub_cause_code_type = "unsecured accident";
282 else if (sub_cause_code == AccidentSubCauseCode().ASSISTANCE_REQUESTED)
283 sub_cause_code_type = "assistance requested (e-Call)";
284 } else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3) {
285 if (sub_cause_code == RoadworksSubCauseCode().UNAVAILABLE)
286 sub_cause_code_type = "unavailable";
287 else if (sub_cause_code == RoadworksSubCauseCode().MAJOR_ROADWORKS)
288 sub_cause_code_type = "major roadworks";
289 else if (sub_cause_code == RoadworksSubCauseCode().ROAD_MARKING_WORK)
290 sub_cause_code_type = "road marking work";
291 else if (sub_cause_code == RoadworksSubCauseCode().SLOW_MOVING_ROAD_MAINTENANCE)
292 sub_cause_code_type = "slow moving road maintenance";
293 else if (sub_cause_code == RoadworksSubCauseCode().SHORT_TERM_STATIONARY_ROADWORKS)
294 sub_cause_code_type = "short-term stationary roadworks";
295 else if (sub_cause_code == RoadworksSubCauseCode().STREET_CLEANING)
296 sub_cause_code_type = "street cleaning";
297 else if (sub_cause_code == RoadworksSubCauseCode().WINTER_SERVICE)
298 sub_cause_code_type = "winter service";
299 } else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5) {
300 if (sub_cause_code == ImpassabilitySubCauseCode().UNAVAILABLE)
301 sub_cause_code_type = "unavailable";
302 else if (sub_cause_code == ImpassabilitySubCauseCode().FLOODING)
303 sub_cause_code_type = "flooding";
304 else if (sub_cause_code == ImpassabilitySubCauseCode().DANGER_OF_AVALANCHES)
305 sub_cause_code_type = "danger of avalanches";
306 else if (sub_cause_code == ImpassabilitySubCauseCode().BLASTING_OF_AVALANCHES)
307 sub_cause_code_type = "blasting of avalanches";
308 else if (sub_cause_code == ImpassabilitySubCauseCode().LANDSLIPS)
309 sub_cause_code_type = "landslips";
310 else if (sub_cause_code == ImpassabilitySubCauseCode().CHEMICAL_SPILLAGE)
311 sub_cause_code_type = "chemical spillage";
312 else if (sub_cause_code == ImpassabilitySubCauseCode().WINTER_CLOSURE)
313 sub_cause_code_type = "winter closure";
314 else if (sub_cause_code == ImpassabilitySubCauseCode().SINKHOLE)
315 sub_cause_code_type = "sinkhole";
316 else if (sub_cause_code == ImpassabilitySubCauseCode().EARTHQUAKE_DAMAGE)
317 sub_cause_code_type = "earthquake damage";
318 else if (sub_cause_code == ImpassabilitySubCauseCode().FALLEN_TREES)
319 sub_cause_code_type = "fallen trees";
320 else if (sub_cause_code == ImpassabilitySubCauseCode().ROCKFALLS)
321 sub_cause_code_type = "rockfalls";
322 else if (sub_cause_code == ImpassabilitySubCauseCode().SEWER_OVERFLOW)
323 sub_cause_code_type = "sewer overflow";
324 else if (sub_cause_code == ImpassabilitySubCauseCode().STORM_DAMAGE)
325 sub_cause_code_type = "storm damage";
326 else if (sub_cause_code == ImpassabilitySubCauseCode().SUBSIDENCE)
327 sub_cause_code_type = "subsidence";
328 else if (sub_cause_code == ImpassabilitySubCauseCode().BURST_PIPE)
329 sub_cause_code_type = "burst pipe";
330 else if (sub_cause_code == ImpassabilitySubCauseCode().BURST_WATER_MAIN)
331 sub_cause_code_type = "burst water main";
332 else if (sub_cause_code == ImpassabilitySubCauseCode().FALLEN_POWER_CABLES)
333 sub_cause_code_type = "fallen power cables";
334 else if (sub_cause_code == ImpassabilitySubCauseCode().SNOW_DRIFTS)
335 sub_cause_code_type = "snow drifts";
336 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6) {
337 if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().UNAVAILABLE)
338 sub_cause_code_type = "unavailable";
339 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().HEAVY_FROST_ON_ROAD)
340 sub_cause_code_type = "heavy frost on road";
341 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().FUEL_ON_ROAD)
342 sub_cause_code_type = "fuel on road";
343 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().MUD_ON_ROAD)
344 sub_cause_code_type = "mud on road";
345 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().SNOW_ON_ROAD)
346 sub_cause_code_type = "snow on road";
347 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().ICE_ON_ROAD)
348 sub_cause_code_type = "ice on road";
349 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().BLACK_ICE_ON_ROAD)
350 sub_cause_code_type = "black ice on road";
351 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().OIL_ON_ROAD)
352 sub_cause_code_type = "oil on road";
353 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().LOOSE_CHIPPINGS)
354 sub_cause_code_type = "loose chippings";
355 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().INSTANT_BLACK_ICE)
356 sub_cause_code_type = "instant black ice";
357 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().ROADS_SALTED)
358 sub_cause_code_type = "roads salted";
359 } else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
360 sub_cause_code_type = "not defined";
361 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9) {
362 if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().UNAVAILABLE)
363 sub_cause_code_type = "unavailable";
364 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().ROCKFALLS)
365 sub_cause_code_type = "rockfalls";
366 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().EARTHQUAKE_DAMAGE)
367 sub_cause_code_type = "earthquake damage";
368 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SEWER_COLLAPSE)
369 sub_cause_code_type = "sewer collapse";
370 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SUBSIDENCE)
371 sub_cause_code_type = "subsidence";
372 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SNOW_DRIFTS)
373 sub_cause_code_type = "snow drifts";
374 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().STORM_DAMAGE)
375 sub_cause_code_type = "storm damage";
376 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().BURST_PIPE)
377 sub_cause_code_type = "burst pipe";
378 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().VOLCANO_ERUPTION)
379 sub_cause_code_type = "volcano eruption";
380 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().FALLING_ICE)
381 sub_cause_code_type = "falling ice";
382 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().FIRE)
383 sub_cause_code_type = "fire";
384 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10) {
385 if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().UNAVAILABLE)
386 sub_cause_code_type = "unavailable";
387 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().SHED_LOAD)
388 sub_cause_code_type = "shed load";
389 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().PARTS_OF_VEHICLES)
390 sub_cause_code_type = "parts of vehicles";
391 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().PARTS_OF_TYRES)
392 sub_cause_code_type = "parts of tyres";
393 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().BIG_OBJECTS)
394 sub_cause_code_type = "big objects";
395 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().FALLEN_TREES)
396 sub_cause_code_type = "fallen trees";
397 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().HUB_CAPS)
398 sub_cause_code_type = "hub caps";
399 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().WAITING_VEHICLES)
400 sub_cause_code_type = "waiting vehicles";
401 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11) {
402 if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().UNAVAILABLE)
403 sub_cause_code_type = "unavailable";
404 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS)
405 sub_cause_code_type = "wild animals";
406 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().HERD_OF_ANIMALS)
407 sub_cause_code_type = "herd of animals";
408 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().SMALL_ANIMALS)
409 sub_cause_code_type = "small animals";
410 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().LARGE_ANIMALS)
411 sub_cause_code_type = "large animals";
412 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS_SMALL)
413 sub_cause_code_type = "wild animals small";
414 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS_LARGE)
415 sub_cause_code_type = "wild animals large";
416 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS)
417 sub_cause_code_type = "domestic animals";
418 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS_SMALL)
419 sub_cause_code_type = "domestic animals small";
420 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS_LARGE)
421 sub_cause_code_type = "domestic animals large";
422 } else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12) {
423 if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().UNAVAILABLE)
424 sub_cause_code_type = "unavailable";
425 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().CHILDREN_ON_ROADWAY)
426 sub_cause_code_type = "children on roadway";
427 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().CYCLIST_ON_ROADWAY)
428 sub_cause_code_type = "cyclist on roadway";
429 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLIST_ON_ROADWAY)
430 sub_cause_code_type = "motorcyclist on roadway";
431 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PEDESTRIAN)
432 sub_cause_code_type = "pedestrian";
433 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ORDINARY_PEDESTRIAN)
434 sub_cause_code_type = "ordinary pedestrian";
435 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ROAD_WORKER)
436 sub_cause_code_type = "road worker";
437 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().FIRST_RESPONDER)
438 sub_cause_code_type = "first responder";
439 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().LIGHT_VRU_VEHICLE)
440 sub_cause_code_type = "light VRU vehicle";
441 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().BICYCLIST)
442 sub_cause_code_type = "bicyclist";
443 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().WHEELCHAIR_USER)
444 sub_cause_code_type = "wheelchair user";
445 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().HORSE_AND_RIDER)
446 sub_cause_code_type = "horse and rider";
447 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ROLLERSKATER)
448 sub_cause_code_type = "rollerskater";
449 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().E_SCOOTER)
450 sub_cause_code_type = "e-scooter";
451 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PERSONAL_TRANSPORTER)
452 sub_cause_code_type = "personal transporter";
453 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PEDELEC)
454 sub_cause_code_type = "pedelec";
455 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().SPEED_PEDELEC)
456 sub_cause_code_type = "speed pedelec";
457 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PTW)
458 sub_cause_code_type = "PTW";
459 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOPED)
460 sub_cause_code_type = "moped";
461 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE)
462 sub_cause_code_type = "motorcycle";
463 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE_AND_SIDECAR_RIGHT)
464 sub_cause_code_type = "motorcycle and sidecar right";
465 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE_AND_SIDECAR_LEFT)
466 sub_cause_code_type = "motorcycle and sidecar left";
467 } else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14) {
468 if (sub_cause_code == WrongWayDrivingSubCauseCode().UNAVAILABLE)
469 sub_cause_code_type = "unavailable";
470 else if (sub_cause_code == WrongWayDrivingSubCauseCode().WRONG_LANE)
471 sub_cause_code_type = "vehicle driving in wrong lane";
472 else if (sub_cause_code == WrongWayDrivingSubCauseCode().WRONG_DIRECTION)
473 sub_cause_code_type = "vehicle driving in wrong driving direction";
474 } else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15) {
475 if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().UNAVAILABLE)
476 sub_cause_code_type = "unavailable";
477 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().EMERGENCY_VEHICLES)
478 sub_cause_code_type = "emergency vehicles";
479 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().RESCUE_HELICOPTER_LANDING)
480 sub_cause_code_type = "rescue helicopter landing";
481 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().POLICE_ACTIVITY_ONGOING)
482 sub_cause_code_type = "police activity ongoing";
483 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().MEDICAL_EMERGENCY_ONGOING)
484 sub_cause_code_type = "medical emergency ongoing";
485 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().CHILD_ABDUCTION_IN_PROGRESS)
486 sub_cause_code_type = "child abduction in progress";
487 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().PRIORITIZED_VEHICLE)
488 sub_cause_code_type = "prioritized vehicle";
489 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().RESCUE_AND_RECOVERY_VEHICLE)
490 sub_cause_code_type = "rescue and recovery vehicle";
491 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17) {
492 if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().UNAVAILABLE)
493 sub_cause_code_type = "unavailable";
494 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().STRONG_WINDS)
495 sub_cause_code_type = "strong winds";
496 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().DAMAGING_HAIL)
497 sub_cause_code_type = "damaging hail";
498 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().HURRICANE)
499 sub_cause_code_type = "hurricane";
500 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().THUNDERSTORM)
501 sub_cause_code_type = "thunderstorm";
502 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().TORNADO)
503 sub_cause_code_type = "tornado";
504 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().BLIZZARD)
505 sub_cause_code_type = "blizzard";
506 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18) {
507 if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().UNAVAILABLE)
508 sub_cause_code_type = "unavailable";
509 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().FOG)
510 sub_cause_code_type = "fog";
511 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SMOKE)
512 sub_cause_code_type = "smoke";
513 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_SNOWFALL)
514 sub_cause_code_type = "heavy snowfall";
515 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_RAIN)
516 sub_cause_code_type = "heavy rain";
517 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_HAIL)
518 sub_cause_code_type = "heavy hail";
519 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().LOW_SUN_GLARE)
520 sub_cause_code_type = "low sun glare";
521 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SANDSTORMS)
522 sub_cause_code_type = "sandstorms";
523 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SWARMS_OF_INSECTS)
524 sub_cause_code_type = "swarms of insects";
525 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19) {
526 if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().UNAVAILABLE)
527 sub_cause_code_type = "unavailable";
528 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().HEAVY_RAIN)
529 sub_cause_code_type = "heavy rain";
530 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().HEAVY_SNOWFALL)
531 sub_cause_code_type = "heavy snowfall";
532 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().SOFT_HAIL)
533 sub_cause_code_type = "soft hail";
534 } else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
535 sub_cause_code_type = "not defined";
536 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26) {
537 if (sub_cause_code == SlowVehicleSubCauseCode().UNAVAILABLE)
538 sub_cause_code_type = "unavailable";
539 else if (sub_cause_code == SlowVehicleSubCauseCode().MAINTENANCE_VEHICLE)
540 sub_cause_code_type = "maintenance vehicle";
541 else if (sub_cause_code == SlowVehicleSubCauseCode().VEHICLES_SLOWING_TO_LOOK_AT_ACCIDENT)
542 sub_cause_code_type = "vehicles slowing to look at accident";
543 else if (sub_cause_code == SlowVehicleSubCauseCode().ABNORMAL_LOAD)
544 sub_cause_code_type = "abnormal load";
545 else if (sub_cause_code == SlowVehicleSubCauseCode().ABNORMAL_WIDE_LOAD)
546 sub_cause_code_type = "abnormal wide load";
547 else if (sub_cause_code == SlowVehicleSubCauseCode().CONVOY)
548 sub_cause_code_type = "convoy";
549 else if (sub_cause_code == SlowVehicleSubCauseCode().SNOWPLOUGH)
550 sub_cause_code_type = "snowplough";
551 else if (sub_cause_code == SlowVehicleSubCauseCode().DEICING)
552 sub_cause_code_type = "deicing";
553 else if (sub_cause_code == SlowVehicleSubCauseCode().SALTING_VEHICLES)
554 sub_cause_code_type = "salting vehicles";
555 } else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27) {
556 if (sub_cause_code == DangerousEndOfQueueSubCauseCode().UNAVAILABLE)
557 sub_cause_code_type = "unavailable";
558 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().SUDDEN_END_OF_QUEUE)
559 sub_cause_code_type = "sudden end of queue";
560 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_OVER_HILL)
561 sub_cause_code_type = "queue over hill";
562 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_AROUND_BEND)
563 sub_cause_code_type = "queue around bend";
564 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_IN_TUNNEL)
565 sub_cause_code_type = "queue in tunnel";
566 } else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
567 sub_cause_code_type = "not defined";
568 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91) {
569 if (sub_cause_code == VehicleBreakdownSubCauseCode().UNAVAILABLE)
570 sub_cause_code_type = "unavailable";
571 else if (sub_cause_code == VehicleBreakdownSubCauseCode().LACK_OF_FUEL)
572 sub_cause_code_type = "lack of fuel";
573 else if (sub_cause_code == VehicleBreakdownSubCauseCode().LACK_OF_BATTERY_POWER)
574 sub_cause_code_type = "lack of battery power";
575 else if (sub_cause_code == VehicleBreakdownSubCauseCode().ENGINE_PROBLEM)
576 sub_cause_code_type = "engine problem";
577 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TRANSMISSION_PROBLEM)
578 sub_cause_code_type = "transmission problem";
579 else if (sub_cause_code == VehicleBreakdownSubCauseCode().ENGINE_COOLING_PROBLEM)
580 sub_cause_code_type = "engine cooling problem";
581 else if (sub_cause_code == VehicleBreakdownSubCauseCode().BRAKING_SYSTEM_PROBLEM)
582 sub_cause_code_type = "braking system problem";
583 else if (sub_cause_code == VehicleBreakdownSubCauseCode().STEERING_PROBLEM)
584 sub_cause_code_type = "steering problem";
585 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TYRE_PUNCTURE)
586 sub_cause_code_type = "tyre puncture";
587 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TYRE_PRESSURE_PROBLEM)
588 sub_cause_code_type = "tyre pressure problem";
589 else if (sub_cause_code == VehicleBreakdownSubCauseCode().VEHICLE_ON_FIRE)
590 sub_cause_code_type = "vehicle on fire";
591 } else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92) {
592 if (sub_cause_code == PostCrashSubCauseCode().UNAVAILABLE)
593 sub_cause_code_type = "unavailable";
594 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITHOUT_E_CALL_TRIGGERED)
595 sub_cause_code_type = "accident without e-Call triggered";
596 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_MANUALLY_TRIGGERED)
597 sub_cause_code_type = "accident with e-Call manually triggered";
598 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_AUTOMATICALLY_TRIGGERED)
599 sub_cause_code_type = "accident with e-Call automatically triggered";
600 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_TRIGGERED_WITHOUT_ACCESS_TO_CELLULAR_NETWORK)
601 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
602 } else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93) {
603 if (sub_cause_code == HumanProblemSubCauseCode().UNAVAILABLE)
604 sub_cause_code_type = "unavailable";
605 else if (sub_cause_code == HumanProblemSubCauseCode().GLYCEMIA_PROBLEM)
606 sub_cause_code_type = "glycemia problem";
607 else if (sub_cause_code == HumanProblemSubCauseCode().HEART_PROBLEM)
608 sub_cause_code_type = "heart problem";
609 } else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94) {
610 if (sub_cause_code == StationaryVehicleSubCauseCode().UNAVAILABLE)
611 sub_cause_code_type = "unavailable";
612 else if (sub_cause_code == StationaryVehicleSubCauseCode().HUMAN_PROBLEM)
613 sub_cause_code_type = "human problem";
614 else if (sub_cause_code == StationaryVehicleSubCauseCode().VEHICLE_BREAKDOWN)
615 sub_cause_code_type = "vehicle breakdown";
616 else if (sub_cause_code == StationaryVehicleSubCauseCode().POST_CRASH)
617 sub_cause_code_type = "post crash";
618 else if (sub_cause_code == StationaryVehicleSubCauseCode().PUBLIC_TRANSPORT_STOP)
619 sub_cause_code_type = "public transport stop";
620 else if (sub_cause_code == StationaryVehicleSubCauseCode().CARRYING_DANGEROUS_GOODS)
621 sub_cause_code_type = "carrying dangerous goods";
622 else if (sub_cause_code == StationaryVehicleSubCauseCode().VEHICLE_ON_FIRE)
623 sub_cause_code_type = "vehicle on fire";
624 } else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95) {
625 if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().UNAVAILABLE)
626 sub_cause_code_type = "unavailable";
627 else if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().EMERGENCY_VEHICLE_APPROACHING)
628 sub_cause_code_type = "emergency vehicle approaching";
629 else if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().PRIORITIZED_VEHICLE_APPROACHING)
630 sub_cause_code_type = "prioritized vehicle approaching";
631 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96) {
632 if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().UNAVAILABLE)
633 sub_cause_code_type = "unavailable";
634 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().DANGEROUS_LEFT_TURN_CURVE)
635 sub_cause_code_type = "dangerous left turn curve";
636 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().DANGEROUS_RIGHT_TURN_CURVE)
637 sub_cause_code_type = "dangerous right turn curve";
638 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_UNKNOWN_TURNING_DIRECTION)
639 sub_cause_code_type = "multiple curves starting with unknown turning direction";
640 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_LEFT_TURN)
641 sub_cause_code_type = "multiple curves starting with left turn";
642 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_RIGHT_TURN)
643 sub_cause_code_type = "multiple curves starting with right turn";
644 } else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97) {
645 if (sub_cause_code == CollisionRiskSubCauseCode().UNAVAILABLE)
646 sub_cause_code_type = "unavailable";
647 else if (sub_cause_code == CollisionRiskSubCauseCode().LONGITUDINAL_COLLISION_RISK)
648 sub_cause_code_type = "longitudinal collision risk";
649 else if (sub_cause_code == CollisionRiskSubCauseCode().CROSSING_COLLISION_RISK)
650 sub_cause_code_type = "crossing collision risk";
651 else if (sub_cause_code == CollisionRiskSubCauseCode().LATERAL_COLLISION_RISK)
652 sub_cause_code_type = "lateral collision risk";
653 else if (sub_cause_code == CollisionRiskSubCauseCode().VULNERABLE_ROAD_USER)
654 sub_cause_code_type = "collision risk involving vulnerable road user";
655 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_PEDESTRIAN)
656 sub_cause_code_type = "collision risk involving pedestrian";
657 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_CYCLIST)
658 sub_cause_code_type = "collision risk involving cyclist";
659 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_MOTOR_VEHICLE)
660 sub_cause_code_type = "collision risk involving motor vehicle";
661 } else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98) {
662 if (sub_cause_code == SignalViolationSubCauseCode().UNAVAILABLE)
663 sub_cause_code_type = "unavailable";
664 else if (sub_cause_code == SignalViolationSubCauseCode().STOP_SIGN_VIOLATION)
665 sub_cause_code_type = "stop sign violation";
666 else if (sub_cause_code == SignalViolationSubCauseCode().TRAFFIC_LIGHT_VIOLATION)
667 sub_cause_code_type = "traffic light violation";
668 else if (sub_cause_code == SignalViolationSubCauseCode().TURNING_REGULATION_VIOLATION)
669 sub_cause_code_type = "turning regulation violation";
670 } else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99) {
671 if (sub_cause_code == DangerousSituationSubCauseCode().UNAVAILABLE)
672 sub_cause_code_type = "unavailable";
673 else if (sub_cause_code == DangerousSituationSubCauseCode().EMERGENCY_ELECTRONIC_BRAKE_ENGAGED)
674 sub_cause_code_type = "emergency electronic brake engaged";
675 else if (sub_cause_code == DangerousSituationSubCauseCode().PRE_CRASH_SYSTEM_ENGAGED)
676 sub_cause_code_type = "pre-crash system engaged";
677 else if (sub_cause_code == DangerousSituationSubCauseCode().ESP_ENGAGED)
678 sub_cause_code_type = "ESP (electronic stability program) engaged";
679 else if (sub_cause_code == DangerousSituationSubCauseCode().ABS_ENGAGED)
680 sub_cause_code_type = "ABS (anti-lock braking system) engaged";
681 else if (sub_cause_code == DangerousSituationSubCauseCode().EB_ENGAGED)
682 sub_cause_code_type = "AEB (automatic emergency braking) engaged";
683 else if (sub_cause_code == DangerousSituationSubCauseCode().BRAKE_WARNING_ENGAGED)
684 sub_cause_code_type = "brake warning engaged";
685 else if (sub_cause_code == DangerousSituationSubCauseCode().COLLISION_RISK_WARNING_ENGAGED)
686 sub_cause_code_type = "collision risk warning engaged";
687 } else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100) {
688 if (sub_cause_code == RailwayLevelCrossingSubCauseCode().UNAVAILABLE)
689 sub_cause_code_type = "unavailable";
690 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().DO_NOT_CROSS_ABNORMAL_SITUATION)
691 sub_cause_code_type = "do not cross abnormal situation";
692 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().CLOSED)
693 sub_cause_code_type = "closed";
694 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().UNGUARDED)
695 sub_cause_code_type = "unguarded";
696 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().NOMINAL)
697 sub_cause_code_type = "nominal";
698 }
699 return sub_cause_code_type;
700 } else {
701 throw std::invalid_argument("SituationContainer is not present!");
702 }
703}
704
705} // namespace etsi_its_denm_ts_msgs::access
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v2.2.1.
Common getter functions for the ETSI ITS DENM (EN and TS).
double getWGSHeading(const DENM &denm)
Get the WGS Heading object.
double getWGSHeadingConfidenceCDD(const Wgs84Angle &heading)
Get the WGS Heading confidence.
double getWGSHeadingCDD(const Wgs84Angle &heading)
Get the WGS Heading value.
std::string getCauseCodeType(const DENM &denm)
Get the Cause Code Type object.
double getWGSHeadingConfidence(const DENM &denm)
Get the WGS Heading confidence.
std::string getSubCauseCodeType(const DENM &denm)
Get the Sub Cause Code Type object.
uint8_t getCauseCode(const DENM &denm)
Get the Cause Code object.
uint8_t getSubCauseCode(const DENM &denm)
Get the Sub Cause Code object.