etsi_its_messages 2.4.0
Loading...
Searching...
No Matches
cam_getters_common.h File Reference

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

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

262 {
263 return getBitString(acceleration_control.value, acceleration_control.bits_unused);
264}
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.

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

93 {
94 return getAltitude(cam.cam.cam_parameters.basic_container.reference_position.altitude);
95}
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 272 of file cam_getters_common.h.

272 {
273 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
274}

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

302 {
303 return getBitString(emergency_priority.value, emergency_priority.bits_unused);
304}

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

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

232 {
233 return getBitString(exterior_lights.value, exterior_lights.bits_unused);
234}

◆ getGenerationDeltaTime()

GenerationDeltaTime getGenerationDeltaTime ( const CAM & cam)
inline

Get the GenerationDeltaTime.

Parameters
camCAM to get the GenerationDeltaTime from
Returns
GenerationDeltaTime the GenerationDeltaTime

Definition at line 49 of file cam_getters_common.h.

49{ 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 57 of file cam_getters_common.h.

57{ 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 115 of file cam_getters_common.h.

115 {
116 return getHeading(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
117}
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 105 of file cam_getters_common.h.

105{ 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 186 of file cam_getters_common.h.

186 {
187 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
188 .lateral_acceleration_is_present) {
190 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
191 } else {
192 throw std::invalid_argument("LateralAcceleration is not present!");
193 }
194}
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 73 of file cam_getters_common.h.

73 {
74 return getLatitude(cam.cam.cam_parameters.basic_container.reference_position.latitude);
75}
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 292 of file cam_getters_common.h.

292 {
293 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
294}

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

83 {
84 return getLongitude(cam.cam.cam_parameters.basic_container.reference_position.longitude);
85}
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 175 of file cam_getters_common.h.

175 {
177 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
178}
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 282 of file cam_getters_common.h.

282 {
283 return getBitString(special_transport_type.value, special_transport_type.bits_unused);
284}

◆ 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.

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

41{ 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 65 of file cam_getters_common.h.

65{ 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 220 of file cam_getters_common.h.

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

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

◆ 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; }