etsi_its_messages v3.0.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 Heading &heading)
 Get the Heading value.
 
double getHeading (const CAM &cam)
 Get the Heading value 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 getLongitudinalAcceleration (const CAM &cam)
 Get the longitudinal acceleration.
 
double getLateralAcceleration (const CAM &cam)
 Get the lateral acceleration.
 
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 264 of file cam_getters_common.h.

264 {
265 return getBitString(acceleration_control.value, acceleration_control.bits_unused);
266}

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

274 {
275 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
276}

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

304 {
305 return getBitString(emergency_priority.value, emergency_priority.bits_unused);
306}

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

244 {
245 if (cam.cam.cam_parameters.low_frequency_container_is_present) {
246 if (cam.cam.cam_parameters.low_frequency_container.choice ==
247 LowFrequencyContainer::CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY) {
248 return getExteriorLights(
249 cam.cam.cam_parameters.low_frequency_container.basic_vehicle_container_low_frequency.exterior_lights);
250 } else {
251 throw std::invalid_argument("LowFrequencyContainer is not BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY!");
252 }
253 } else {
254 throw std::invalid_argument("LowFrequencyContainer is not present!");
255 }
256}
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 234 of file cam_getters_common.h.

234 {
235 return getBitString(exterior_lights.value, exterior_lights.bits_unused);
236}

◆ 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() [1/2]

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

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

◆ getHeading() [2/2]

double getHeading ( 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 107 of file cam_getters_common.h.

107{ return ((double)heading.heading_value.value) * 1e-1; }

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

188 {
189 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
190 .lateral_acceleration_is_present) {
192 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
193 } else {
194 throw std::invalid_argument("LateralAcceleration is not present!");
195 }
196}
double getLateralAcceleration(const CAM &cam)
Get the lateral acceleration.

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

294 {
295 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
296}

◆ 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 (left is positive)

Definition at line 177 of file cam_getters_common.h.

177 {
179 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
180}
double getLongitudinalAcceleration(const CAM &cam)
Get the longitudinal acceleration.

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

284 {
285 return getBitString(special_transport_type.value, special_transport_type.bits_unused);
286}

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

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

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

222 {
223 int zone;
224 bool northp;
225 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
226}
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 209 of file cam_getters_common.h.

209 {
210 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
211}

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

137 {
138 return getVehicleLength(
139 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_length);
140}
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 127 of file cam_getters_common.h.

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

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

156 {
157 return getVehicleWidth(
158 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_width);
159}
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 148 of file cam_getters_common.h.

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