etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_getters_common.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#ifndef ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_GETTERS_COMMON_H
10#define ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_GETTERS_COMMON_H
11
12#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
13
20inline uint32_t getStationID(const DENM& denm) { return getStationID(denm.header); }
21
28inline TimestampIts getReferenceTime(const DENM& denm) { return denm.denm.management.reference_time; }
29
36inline uint64_t getReferenceTimeValue(const DENM& denm) { return getReferenceTime(denm).value; }
37
44inline uint8_t getStationType(const DENM& denm) { return denm.denm.management.station_type.value; }
45
52inline double getLatitude(const DENM& denm) { return getLatitude(denm.denm.management.event_position.latitude); }
53
60inline double getLongitude(const DENM& denm) { return getLongitude(denm.denm.management.event_position.longitude); }
61
68inline double getAltitude(const DENM& denm) { return getAltitude(denm.denm.management.event_position.altitude); }
69
76inline bool getIsHeadingPresent(const DENM& denm) {
77 if (denm.denm.location_is_present) {
78 return denm.denm.location.event_position_heading_is_present;
79 } else {
80 throw std::invalid_argument("LocationContainer is not present!");
81 }
82}
83
90inline double getSpeed(const DENM& denm) {
91 if (denm.denm.location_is_present) {
92 if (denm.denm.location.event_speed_is_present) {
93 return getSpeed(denm.denm.location.event_speed);
94 } else {
95 throw std::invalid_argument("Speed is not present!");
96 }
97 } else {
98 throw std::invalid_argument("LocationContainer is not present!");
99 }
100}
101
108inline bool getIsSpeedPresent(const DENM& denm) {
109 if (denm.denm.location_is_present) {
110 return denm.denm.location.event_speed_is_present;
111 } else {
112 throw std::invalid_argument("LocationContainer is not present!");
113 }
114}
115
122inline double getSpeedConfidence(const DENM& denm) {
123 return getSpeedConfidence(
124 denm.denm.location.event_speed);
125}
126
135inline gm::PointStamped getUTMPosition(const DENM& denm, int& zone, bool& northp) {
136 return getUTMPosition(denm.denm.management.event_position, zone, northp);
137}
138
145inline gm::PointStamped getUTMPosition(const DENM& denm) {
146 int zone;
147 bool northp;
148 return getUTMPosition(denm.denm.management.event_position, zone, northp);
149}
150
157inline std::vector<bool> getDrivingLaneStatus(const DrivingLaneStatus& driving_lane_status) {
158 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
159}
160
167inline std::vector<bool> getLightBarSirenInUse(const LightBarSirenInUse& light_bar_siren_in_use) {
168 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
169}
170
171#endif // ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_GETTERS_COMMON_H
bool getIsHeadingPresent(const DENM &denm)
Get the IsHeadingPresent object.
uint64_t getReferenceTimeValue(const DENM &denm)
Get the ReferenceTime-Value.
uint32_t getStationID(const DENM &denm)
Get the Station ID object.
std::vector< bool > getLightBarSirenInUse(const LightBarSirenInUse &light_bar_siren_in_use)
Get the Lightbar Siren In Use in form of bool vector.
double getAltitude(const DENM &denm)
Get the Altitude value of DENM.
double getLongitude(const DENM &denm)
Get the Longitude value of DENM.
double getSpeed(const DENM &denm)
Get the vehicle speed.
double getSpeedConfidence(const DENM &denm)
Get the Speed Confidence.
TimestampIts getReferenceTime(const DENM &denm)
Get the Reference Time object.
double getLatitude(const DENM &denm)
Get the Latitude value of DENM.
uint8_t getStationType(const DENM &denm)
Get the stationType object.
std::vector< bool > getDrivingLaneStatus(const DrivingLaneStatus &driving_lane_status)
Get the Driving Lane Status in form of bool vector.
gm::PointStamped getUTMPosition(const DENM &denm, int &zone, bool &northp)
Get the UTM Position defined within the ManagementContainer of the DENM.
bool getIsSpeedPresent(const DENM &denm)
Get the IsSpeedPresent object.