32#ifndef ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_GETTERS_COMMON_H
33#define ETSI_ITS_MSGS_UTILS_IMPL_CAM_CAM_GETTERS_COMMON_H
35#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
67inline uint8_t
getStationType(
const CAM& cam) {
return cam.cam.cam_parameters.basic_container.station_type.value; }
76 return getLatitude(cam.cam.cam_parameters.basic_container.reference_position.latitude);
86 return getLongitude(cam.cam.cam_parameters.basic_container.reference_position.longitude);
96 return getAltitude(cam.cam.cam_parameters.basic_container.reference_position.altitude);
108 return getHeadingCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
119 return getHeadingConfidenceCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.heading);
129 return getYawRateCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.yaw_rate);
139 return getYawRateConfidenceCDD(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.yaw_rate);
149 return ((
double)vehicle_length.vehicle_length_value.value) * 1e-1;
160 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_length);
169inline double getVehicleWidth(
const VehicleWidth& vehicle_width) {
return ((
double)vehicle_width.value) * 1e-1; }
179 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.vehicle_width);
189 return getSpeed(cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
200 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.speed);
211 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
222 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.longitudinal_acceleration);
232 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
233 .lateral_acceleration_is_present) {
235 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
237 throw std::invalid_argument(
"LateralAcceleration is not present!");
248 if (cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency
249 .lateral_acceleration_is_present) {
251 cam.cam.cam_parameters.high_frequency_container.basic_vehicle_container_high_frequency.lateral_acceleration);
253 throw std::invalid_argument(
"LateralAccelerationConfidence is not present!");
269 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
284 return getUTMPosition(cam.cam.cam_parameters.basic_container.reference_position, zone, northp);
294 return getBitString(exterior_lights.value, exterior_lights.bits_unused);
304 if (cam.cam.cam_parameters.low_frequency_container_is_present) {
305 if (cam.cam.cam_parameters.low_frequency_container.choice ==
306 LowFrequencyContainer::CHOICE_BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY) {
308 cam.cam.cam_parameters.low_frequency_container.basic_vehicle_container_low_frequency.exterior_lights);
310 throw std::invalid_argument(
"LowFrequencyContainer is not BASIC_VEHICLE_CONTAINER_LOW_FREQUENCY!");
313 throw std::invalid_argument(
"LowFrequencyContainer is not present!");
324 return getBitString(acceleration_control.value, acceleration_control.bits_unused);
334 return getBitString(driving_lane_status.value, driving_lane_status.bits_unused);
344 return getBitString(special_transport_type.value, special_transport_type.bits_unused);
354 return getBitString(light_bar_siren_in_use.value, light_bar_siren_in_use.bits_unused);
364 return getBitString(emergency_priority.value, emergency_priority.bits_unused);
double getLongitude(const CAM &cam)
Get the Longitude value of CAM.
std::vector< bool > getAccelerationControl(const AccelerationControl &acceleration_control)
Get Acceleration Control in form of bool vector.
std::vector< bool > getSpecialTransportType(const SpecialTransportType &special_transport_type)
Get the Special Transport Type in form of bool vector.
double getVehicleWidth(const VehicleWidth &vehicle_width)
Get the Vehicle Width.
double getHeadingConfidence(const CAM &cam)
Get the Heading confidence of CAM.
std::vector< bool > getLightBarSirenInUse(const LightBarSirenInUse &light_bar_siren_in_use)
Get the Lightbar Siren In Use in form of bool vector.
gm::PointStamped getUTMPosition(const CAM &cam, int &zone, bool &northp)
Get the UTM Position defined within the BasicContainer of the CAM.
uint8_t getStationType(const CAM &cam)
Get the stationType object.
double getLateralAccelerationConfidence(const CAM &cam)
Get the Lateral Acceleration Confidence.
double getLongitudinalAcceleration(const CAM &cam)
Get the longitudinal acceleration.
uint32_t getStationID(const CAM &cam)
Get the Station ID object.
std::vector< bool > getEmergencyPriority(const EmergencyPriority &emergency_priority)
Get the Vehicle Role in form of bool vector.
double getLongitudinalAccelerationConfidence(const CAM &cam)
Get the Longitudinal Acceleration Confidence.
double getLateralAcceleration(const CAM &cam)
Get the lateral acceleration.
double getLatitude(const CAM &cam)
Get the Latitude value of CAM.
uint16_t getGenerationDeltaTimeValue(const CAM &cam)
Get the GenerationDeltaTime-Value.
double getSpeed(const CAM &cam)
Get the vehicle speed.
double getAltitude(const CAM &cam)
Get the Altitude value of CAM.
double getYawRateConfidence(const CAM &cam)
Get the Yaw Rate Confidence of CAM.
std::vector< bool > getExteriorLights(const ExteriorLights &exterior_lights)
Get the Exterior Lights in form of bool vector.
double getHeading(const CAM &cam)
Get the Heading value of CAM.
std::vector< bool > getDrivingLaneStatus(const DrivingLaneStatus &driving_lane_status)
Get the Driving Lane Status in form of bool vector.
double getSpeedConfidence(const CAM &cam)
Get the Speed Confidence.
double getVehicleLength(const VehicleLength &vehicle_length)
Get the Vehicle Length.
GenerationDeltaTime getGenerationDeltaTime(const CAM &cam)
Get the GenerationDeltaTime.
double getYawRate(const CAM &cam)
Get the Yaw Rate of CAM.
double getHeadingCDD(const Heading &heading)
Get the Heading value.
double getHeadingConfidenceCDD(const Heading &heading)
Get the Heading value.
double getYawRateConfidenceCDD(const YawRate &yaw_rate)
Get the Yaw Rate Confidence.
double getYawRateCDD(const YawRate &yaw_rate)
Get the Yaw Rate value.