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

Common getter functions for the ETSI ITS CAM (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 CAM &cam)
 Get the Station ID object.
 
GenerationDeltaTime getGenerationDeltaTime (const CAM &cam)
 Get the GenerationDeltaTime.
 
uint16_t getGenerationDeltaTimeValue (const CAM &cam)
 Get the GenerationDeltaTime-Value.
 
uint8_t getStationType (const CAM &cam)
 Get the stationType object.
 
double getLatitude (const CAM &cam)
 Get the Latitude value of CAM.
 
double getLongitude (const CAM &cam)
 Get the Longitude value of CAM.
 
double getAltitude (const CAM &cam)
 Get the Altitude value of CAM.
 
double getHeading (const CAM &cam)
 Get the Heading value of CAM.
 
double getHeadingConfidence (const CAM &cam)
 Get the Heading confidence of CAM.
 
double getVehicleLength (const VehicleLength &vehicle_length)
 Get the Vehicle Length.
 
double getVehicleLength (const CAM &cam)
 Get the Vehicle Length.
 
double getVehicleWidth (const VehicleWidth &vehicle_width)
 Get the Vehicle Width.
 
double getVehicleWidth (const CAM &cam)
 Get the Vehicle Width.
 
double getSpeed (const CAM &cam)
 Get the vehicle speed.
 
double getSpeedConfidence (const CAM &cam)
 Get the Speed Confidence.
 
double getLongitudinalAcceleration (const CAM &cam)
 Get the longitudinal acceleration.
 
double getLongitudinalAccelerationConfidence (const CAM &cam)
 Get the Longitudinal Acceleration Confidence.
 
double getLateralAcceleration (const CAM &cam)
 Get the lateral acceleration.
 
double getLateralAccelerationConfidence (const CAM &cam)
 Get the Lateral Acceleration Confidence.
 
gm::PointStamped getUTMPosition (const CAM &cam, int &zone, bool &northp)
 Get the UTM Position defined within the BasicContainer of the CAM.
 
gm::PointStamped getUTMPosition (const CAM &cam)
 Get the UTM Position defined within the BasicContainer of the CAM.
 
std::vector< bool > getExteriorLights (const ExteriorLights &exterior_lights)
 Get the Exterior Lights in form of bool vector.
 
std::vector< bool > getExteriorLights (const CAM &cam)
 Get Exterior Lights as bool vector.
 
std::vector< bool > getAccelerationControl (const AccelerationControl &acceleration_control)
 Get Acceleration Control in form of bool vector.
 
std::vector< bool > getDrivingLaneStatus (const DrivingLaneStatus &driving_lane_status)
 Get the Driving Lane Status in form of bool vector.
 
std::vector< bool > getSpecialTransportType (const SpecialTransportType &special_transport_type)
 Get the Special Transport Type 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.
 
std::vector< bool > getEmergencyPriority (const EmergencyPriority &emergency_priority)
 Get the Vehicle Role in form of bool vector.
 

Detailed Description

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

Definition in file cam_getters_common.h.

Function Documentation

◆ getAccelerationControl()

std::vector< bool > getAccelerationControl ( const AccelerationControl & acceleration_control)
inline

Get Acceleration Control in form of bool vector.

Parameters
acceleration_control
Returns
std::vector<bool>

Definition at line 303 of file cam_getters_common.h.

303 {
304 return getBitString(acceleration_control.value, acceleration_control.bits_unused);
305}

◆ getAltitude()

double getAltitude ( const CAM & cam)
inline

Get the Altitude value of CAM.

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

Definition at line 95 of file cam_getters_common.h.

95 {
96 return getAltitude(cam.cam.cam_parameters.basic_container.reference_position.altitude);
97}
double getAltitude(const CAM &cam)
Get the Altitude value of CAM.

◆ 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 313 of file cam_getters_common.h.

313 {
314 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
315}

◆ getEmergencyPriority()

std::vector< bool > getEmergencyPriority ( const EmergencyPriority & emergency_priority)
inline

Get the Vehicle Role in form of bool vector.

Parameters
vehicle_role
Returns
std::vector<bool>

Definition at line 343 of file cam_getters_common.h.

343 {
344 return getBitString(emergency_priority.value, emergency_priority.bits_unused);
345}

◆ getExteriorLights() [1/2]

std::vector< bool > getExteriorLights ( const CAM & cam)
inline

Get Exterior Lights as bool vector.

Parameters
camCAM to get the ExteriorLights values from
Returns
std::vector<bool>

Definition at line 283 of file cam_getters_common.h.

283 {
284 if (cam.cam.cam_parameters.low_frequency_container_is_present) {
285 if (cam.cam.cam_parameters.low_frequency_container.choice ==
286 LowFrequencyContainer::CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY) {
287 return getExteriorLights(
288 cam.cam.cam_parameters.low_frequency_container.basic_vehicle_container_low_frequency.exterior_lights);
289 } else {
290 throw std::invalid_argument("LowFrequencyContainer is not BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY!");
291 }
292 } else {
293 throw std::invalid_argument("LowFrequencyContainer is not present!");
294 }
295}
std::vector< bool > getExteriorLights(const ExteriorLights &exterior_lights)
Get the Exterior Lights in form of bool vector.

◆ getExteriorLights() [2/2]

std::vector< bool > getExteriorLights ( const ExteriorLights & exterior_lights)
inline

Get the Exterior Lights in form of bool vector.

Parameters
exterior_lights
Returns
std::vector<bool>

Definition at line 273 of file cam_getters_common.h.

273 {
274 return getBitString(exterior_lights.value, exterior_lights.bits_unused);
275}

◆ getGenerationDeltaTime()

GenerationDeltaTime getGenerationDeltaTime ( const CAM & cam)
inline

Get the GenerationDeltaTime.

Parameters
camCAM to get the GenerationDeltaTime from
Returns
GenerationDeltaTime the GenerationDeltaTime

Definition at line 51 of file cam_getters_common.h.

51{ return cam.cam.generation_delta_time; }

◆ getGenerationDeltaTimeValue()

uint16_t getGenerationDeltaTimeValue ( const CAM & cam)
inline

Get the GenerationDeltaTime-Value.

Parameters
camCAM to get the GenerationDeltaTime-Value from
Returns
uint16_t the GenerationDeltaTime-Value

Definition at line 59 of file cam_getters_common.h.

59{ return getGenerationDeltaTime(cam).value; }
GenerationDeltaTime getGenerationDeltaTime(const CAM &cam)
Get the GenerationDeltaTime.

◆ getHeading()

double getHeading ( const CAM & cam)
inline

Get the Heading value of CAM.

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

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

Definition at line 107 of file cam_getters_common.h.

107 {
108 return getHeadingCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
109}
double getHeadingCDD(const Heading &heading)
Get the Heading value.

◆ getHeadingConfidence()

double getHeadingConfidence ( const CAM & cam)
inline

Get the Heading confidence of CAM.

Parameters
camCAM to get the Heading confidence from
Returns
Heading standard deviation in degree as decimal number

Definition at line 118 of file cam_getters_common.h.

118 {
119 return getHeadingConfidenceCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
120}
double getHeadingConfidenceCDD(const Heading &heading)
Get the Heading value.

◆ getLateralAcceleration()

double getLateralAcceleration ( const CAM & cam)
inline

Get the lateral acceleration.

Parameters
camCAM to get the lateral acceleration from
Returns
lateral acceleration in m/s^2 as decimal number (left is positive)

Definition at line 211 of file cam_getters_common.h.

211 {
212 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
213 .lateral_acceleration_is_present) {
215 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
216 } else {
217 throw std::invalid_argument("LateralAcceleration is not present!");
218 }
219}
double getLateralAcceleration(const CAM &cam)
Get the lateral acceleration.

◆ getLateralAccelerationConfidence()

double getLateralAccelerationConfidence ( const CAM & cam)
inline

Get the Lateral Acceleration Confidence.

Parameters
camCAM to get the LateralAccelerationConfidence from
Returns
double standard deviation of the lateral acceleration in m/s^2 as decimal number

Definition at line 227 of file cam_getters_common.h.

227 {
228 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
229 .lateral_acceleration_is_present) {
231 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
232 } else {
233 throw std::invalid_argument("LateralAccelerationConfidence is not present!");
234 }
235}
double getLateralAccelerationConfidence(const CAM &cam)
Get the Lateral Acceleration Confidence.

◆ getLatitude()

double getLatitude ( const CAM & cam)
inline

Get the Latitude value of CAM.

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

Definition at line 75 of file cam_getters_common.h.

75 {
76 return getLatitude(cam.cam.cam_parameters.basic_container.reference_position.latitude);
77}
double getLatitude(const CAM &cam)
Get the Latitude value of CAM.

◆ 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 333 of file cam_getters_common.h.

333 {
334 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
335}

◆ getLongitude()

double getLongitude ( const CAM & cam)
inline

Get the Longitude value of CAM.

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

Definition at line 85 of file cam_getters_common.h.

85 {
86 return getLongitude(cam.cam.cam_parameters.basic_container.reference_position.longitude);
87}
double getLongitude(const CAM &cam)
Get the Longitude value of CAM.

◆ getLongitudinalAcceleration()

double getLongitudinalAcceleration ( const CAM & cam)
inline

Get the longitudinal acceleration.

Parameters
camCAM to get the longitudinal acceleration from
Returns
longitudinal acceleration in m/s^2 as decimal number (accelerating is positive)

Definition at line 189 of file cam_getters_common.h.

189 {
191 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
192}
double getLongitudinalAcceleration(const CAM &cam)
Get the longitudinal acceleration.

◆ getLongitudinalAccelerationConfidence()

double getLongitudinalAccelerationConfidence ( const CAM & cam)
inline

Get the Longitudinal Acceleration Confidence.

Parameters
camCAM to get the LongitudinalAccelerationConfidence from
Returns
double standard deviation of the longitudinal acceleration in m/s^2 as decimal number

Definition at line 200 of file cam_getters_common.h.

200 {
202 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
203}
double getLongitudinalAccelerationConfidence(const CAM &cam)
Get the Longitudinal Acceleration Confidence.

◆ getSpecialTransportType()

std::vector< bool > getSpecialTransportType ( const SpecialTransportType & special_transport_type)
inline

Get the Special Transport Type in form of bool vector.

Parameters
special_transport_type
Returns
std::vector<bool>

Definition at line 323 of file cam_getters_common.h.

323 {
324 return getBitString(special_transport_type.value, special_transport_type.bits_unused);
325}

◆ getSpeed()

double getSpeed ( const CAM & cam)
inline

Get the vehicle speed.

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

Definition at line 168 of file cam_getters_common.h.

168 {
169 return getSpeed(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
170}
double getSpeed(const CAM &cam)
Get the vehicle speed.

◆ getSpeedConfidence()

double getSpeedConfidence ( const CAM & cam)
inline

Get the Speed Confidence.

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

Definition at line 178 of file cam_getters_common.h.

178 {
179 return getSpeedConfidence(
180 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
181}
double getSpeedConfidence(const CAM &cam)
Get the Speed Confidence.

◆ getStationID()

uint32_t getStationID ( const CAM & cam)
inline

Get the Station ID object.

Parameters
camCAM to get the StationID value from
Returns
stationID value

Definition at line 43 of file cam_getters_common.h.

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

◆ getStationType()

uint8_t getStationType ( const CAM & cam)
inline

Get the stationType object.

Parameters
camCAM to get the stationType value from
Returns
stationType value

Definition at line 67 of file cam_getters_common.h.

67{ return cam.cam.cam_parameters.basic_container.station_type.value; }

◆ getUTMPosition() [1/2]

gm::PointStamped getUTMPosition ( const CAM & cam)
inline

Get the UTM Position defined within the BasicContainer of the CAM.

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

Parameters
[in]camCAM to get the UTM Position from
Returns
gm::PointStamped geometry_msgs::PointStamped of the given position

Definition at line 261 of file cam_getters_common.h.

261 {
262 int zone;
263 bool northp;
264 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
265}
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.

◆ getUTMPosition() [2/2]

gm::PointStamped getUTMPosition ( const CAM & cam,
int & zone,
bool & northp )
inline

Get the UTM Position defined within the BasicContainer of the CAM.

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

Parameters
[in]camCAM 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 248 of file cam_getters_common.h.

248 {
249 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
250}

◆ getVehicleLength() [1/2]

double getVehicleLength ( const CAM & cam)
inline

Get the Vehicle Length.

Parameters
camCAM to get the vehicle length value from
Returns
vehicle length value in meter as decimal number

Definition at line 138 of file cam_getters_common.h.

138 {
139 return getVehicleLength(
140 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_length);
141}
double getVehicleLength(const VehicleLength &vehicle_length)
Get the Vehicle Length.

◆ getVehicleLength() [2/2]

double getVehicleLength ( const VehicleLength & vehicle_length)
inline

Get the Vehicle Length.

Parameters
vehicleLengthto get the vehicle length value from
Returns
vehicle length value in meter as decimal number

Definition at line 128 of file cam_getters_common.h.

128 {
129 return ((double)vehicle_length.vehicle_length_value.value) * 1e-1;
130}

◆ getVehicleWidth() [1/2]

double getVehicleWidth ( const CAM & cam)
inline

Get the Vehicle Width.

Parameters
camCAM to get the vehicle width value from
Returns
vehicle width value in meter as decimal number

Definition at line 157 of file cam_getters_common.h.

157 {
158 return getVehicleWidth(
159 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_width);
160}
double getVehicleWidth(const VehicleWidth &vehicle_width)
Get the Vehicle Width.

◆ getVehicleWidth() [2/2]

double getVehicleWidth ( const VehicleWidth & vehicle_width)
inline

Get the Vehicle Width.

Parameters
vehicleWidthto get the vehicle width value from
Returns
vehicle width value in meter as decimal number

Definition at line 149 of file cam_getters_common.h.

149{ return ((double)vehicle_width.value) * 1e-1; }