etsi_its_messages v3.4.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 getYawRate (const CAM &cam)
 Get the Yaw Rate of CAM.
double getYawRateConfidence (const CAM &cam)
 Get the Yaw Rate 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 300 of file cam_getters_common.h.

300 {
301 return getBitString(acceleration_control.value, acceleration_control.bits_unused);
302}

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

72 {
73 return getAltitude(cam.cam.cam_parameters.basic_container.reference_position.altitude);
74}
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 310 of file cam_getters_common.h.

310 {
311 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
312}

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

340 {
341 return getBitString(emergency_priority.value, emergency_priority.bits_unused);
342}

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

280 {
281 if (cam.cam.cam_parameters.low_frequency_container_is_present) {
282 if (cam.cam.cam_parameters.low_frequency_container.choice ==
283 LowFrequencyContainer::CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY) {
284 return getExteriorLights(
285 cam.cam.cam_parameters.low_frequency_container.basic_vehicle_container_low_frequency.exterior_lights);
286 } else {
287 throw std::invalid_argument("LowFrequencyContainer is not BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY!");
288 }
289 } else {
290 throw std::invalid_argument("LowFrequencyContainer is not present!");
291 }
292}
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 270 of file cam_getters_common.h.

270 {
271 return getBitString(exterior_lights.value, exterior_lights.bits_unused);
272}

◆ getGenerationDeltaTime()

GenerationDeltaTime getGenerationDeltaTime ( const CAM & cam)
inline

Get the GenerationDeltaTime.

Parameters
camCAM to get the GenerationDeltaTime from
Returns
GenerationDeltaTime the GenerationDeltaTime

Definition at line 28 of file cam_getters_common.h.

28{ 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 36 of file cam_getters_common.h.

36{ 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 84 of file cam_getters_common.h.

84 {
85 return getHeadingCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
86}
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 95 of file cam_getters_common.h.

95 {
96 return getHeadingConfidenceCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
97}
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 208 of file cam_getters_common.h.

208 {
209 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
210 .lateral_acceleration_is_present) {
212 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
213 } else {
214 throw std::invalid_argument("LateralAcceleration is not present!");
215 }
216}
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 224 of file cam_getters_common.h.

224 {
225 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
226 .lateral_acceleration_is_present) {
228 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
229 } else {
230 throw std::invalid_argument("LateralAccelerationConfidence is not present!");
231 }
232}
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 52 of file cam_getters_common.h.

52 {
53 return getLatitude(cam.cam.cam_parameters.basic_container.reference_position.latitude);
54}
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 330 of file cam_getters_common.h.

330 {
331 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
332}

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

62 {
63 return getLongitude(cam.cam.cam_parameters.basic_container.reference_position.longitude);
64}
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 186 of file cam_getters_common.h.

186 {
188 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
189}
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 197 of file cam_getters_common.h.

197 {
199 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
200}
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 320 of file cam_getters_common.h.

320 {
321 return getBitString(special_transport_type.value, special_transport_type.bits_unused);
322}

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

165 {
166 return getSpeed(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
167}
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 175 of file cam_getters_common.h.

175 {
176 return getSpeedConfidence(
177 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
178}
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 20 of file cam_getters_common.h.

20{ 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 44 of file cam_getters_common.h.

44{ 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 258 of file cam_getters_common.h.

258 {
259 int zone;
260 bool northp;
261 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
262}
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 245 of file cam_getters_common.h.

245 {
246 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
247}

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

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

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

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

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

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

◆ getYawRate()

double getYawRate ( const CAM & cam)
inline

Get the Yaw Rate of CAM.

Parameters
camCAM to get the YawRate from
Returns
double yaw rate in degrees per second as decimal number

Definition at line 105 of file cam_getters_common.h.

105 {
106 return getYawRateCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.yaw_rate);
107}
double getYawRateCDD(const YawRate &yaw_rate)
Get the Yaw Rate value.

◆ getYawRateConfidence()

double getYawRateConfidence ( const CAM & cam)
inline

Get the Yaw Rate Confidence of CAM.

Parameters
camCAM to get the YawRateConfidence from
Returns
double yaw rate standard deviation in degrees per second as decimal number

Definition at line 115 of file cam_getters_common.h.

115 {
116 return getYawRateConfidenceCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.yaw_rate);
117}
double getYawRateConfidenceCDD(const YawRate &yaw_rate)
Get the Yaw Rate Confidence.