etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_getters_common.h File Reference

Common getter functions for the ETSI ITS DENM (EN and TS). More...

#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>

Go to the source code of this file.

Functions

uint32_t getStationID (const DENM &denm)
 Get the Station ID object.
TimestampIts getReferenceTime (const DENM &denm)
 Get the Reference Time object.
uint64_t getReferenceTimeValue (const DENM &denm)
 Get the ReferenceTime-Value.
uint8_t getStationType (const DENM &denm)
 Get the stationType object.
double getLatitude (const DENM &denm)
 Get the Latitude value of DENM.
double getLongitude (const DENM &denm)
 Get the Longitude value of DENM.
double getAltitude (const DENM &denm)
 Get the Altitude value of DENM.
bool getIsHeadingPresent (const DENM &denm)
 Get the IsHeadingPresent object.
double getSpeed (const DENM &denm)
 Get the vehicle speed.
bool getIsSpeedPresent (const DENM &denm)
 Get the IsSpeedPresent object.
double getSpeedConfidence (const DENM &denm)
 Get the Speed Confidence.
gm::PointStamped getUTMPosition (const DENM &denm, int &zone, bool &northp)
 Get the UTM Position defined within the ManagementContainer of the DENM.
gm::PointStamped getUTMPosition (const DENM &denm)
 Get the UTM Position defined within the ManagementContainer of the DENM.
std::vector< bool > getDrivingLaneStatus (const DrivingLaneStatus &driving_lane_status)
 Get the Driving Lane Status in form of bool vector.
std::vector< bool > getLightBarSirenInUse (const LightBarSirenInUse &light_bar_siren_in_use)
 Get the Lightbar Siren In Use in form of bool vector.

Detailed Description

Common getter functions for the ETSI ITS DENM (EN and TS).

Definition in file denm_getters_common.h.

Function Documentation

◆ getAltitude()

double 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 91 of file denm_getters_common.h.

91{ return getAltitude(denm.denm.management.event_position.altitude); }
double getAltitude(const DENM &denm)
Get the Altitude value of DENM.

◆ getDrivingLaneStatus()

std::vector< bool > 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 180 of file denm_getters_common.h.

180 {
181 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
182}

◆ getIsHeadingPresent()

bool 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 99 of file denm_getters_common.h.

99 {
100 if (denm.denm.location_is_present) {
101 return denm.denm.location.event_position_heading_is_present;
102 } else {
103 throw std::invalid_argument("LocationContainer is not present!");
104 }
105}

◆ getIsSpeedPresent()

bool 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 131 of file denm_getters_common.h.

131 {
132 if (denm.denm.location_is_present) {
133 return denm.denm.location.event_speed_is_present;
134 } else {
135 throw std::invalid_argument("LocationContainer is not present!");
136 }
137}

◆ getLatitude()

double 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 75 of file denm_getters_common.h.

75{ return getLatitude(denm.denm.management.event_position.latitude); }
double getLatitude(const DENM &denm)
Get the Latitude value of DENM.

◆ getLightBarSirenInUse()

std::vector< bool > 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 190 of file denm_getters_common.h.

190 {
191 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
192}

◆ getLongitude()

double 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 83 of file denm_getters_common.h.

83{ return getLongitude(denm.denm.management.event_position.longitude); }
double getLongitude(const DENM &denm)
Get the Longitude value of DENM.

◆ getReferenceTime()

TimestampIts getReferenceTime ( const DENM & denm)
inline

Get the Reference Time object.

Parameters
denmDENM to get the ReferenceTime-Value from
Returns
TimestampIts

Definition at line 51 of file denm_getters_common.h.

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

◆ getReferenceTimeValue()

uint64_t 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 59 of file denm_getters_common.h.

59{ return getReferenceTime(denm).value; }
TimestampIts getReferenceTime(const DENM &denm)
Get the Reference Time object.

◆ getSpeed()

double 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 113 of file denm_getters_common.h.

113 {
114 if (denm.denm.location_is_present) {
115 if (denm.denm.location.event_speed_is_present) {
116 return getSpeed(denm.denm.location.event_speed);
117 } else {
118 throw std::invalid_argument("Speed is not present!");
119 }
120 } else {
121 throw std::invalid_argument("LocationContainer is not present!");
122 }
123}
double getSpeed(const DENM &denm)
Get the vehicle speed.

◆ getSpeedConfidence()

double 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 145 of file denm_getters_common.h.

145 {
146 return getSpeedConfidence(
147 denm.denm.location.event_speed);
148}
double getSpeedConfidence(const DENM &denm)
Get the Speed Confidence.

◆ getStationID()

uint32_t getStationID ( const DENM & denm)
inline

Get the Station ID object.

Parameters
denmDENM to get the StationID value from
Returns
stationID value

Definition at line 43 of file denm_getters_common.h.

43{ return getStationID(denm.header); }
uint32_t getStationID(const DENM &denm)
Get the Station ID object.

◆ getStationType()

uint8_t getStationType ( const DENM & denm)
inline

Get the stationType object.

Parameters
denmDENM to get the stationType value from
Returns
stationType value

Definition at line 67 of file denm_getters_common.h.

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

◆ getUTMPosition() [1/2]

gm::PointStamped getUTMPosition ( const DENM & denm)
inline

Get the UTM Position defined within the ManagementContainer of the DENM.

Parameters
denmDENM to get the UTM Position from
Returns
gm::PointStamped geometry_msgs::PointStamped of the given position

Definition at line 168 of file denm_getters_common.h.

168 {
169 int zone;
170 bool northp;
171 return getUTMPosition(denm.denm.management.event_position, zone, northp);
172}
gm::PointStamped getUTMPosition(const DENM &denm, int &zone, bool &northp)
Get the UTM Position defined within the ManagementContainer of the DENM.

◆ getUTMPosition() [2/2]

gm::PointStamped getUTMPosition ( const DENM & denm,
int & zone,
bool & northp )
inline

Get the UTM Position defined within the ManagementContainer of the DENM.

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 158 of file denm_getters_common.h.

158 {
159 return getUTMPosition(denm.denm.management.event_position, zone, northp);
160}