36namespace etsi_its_denm_msgs::access {
47inline void setItsPduHeader(DENM& denm,
const uint32_t station_id,
const uint8_t protocol_version = 0) {
48 setItsPduHeader(denm.header, ItsPduHeader::MESSAGE_ID_DENM, station_id, protocol_version);
59 DENM& denm,
const uint64_t unix_nanosecs,
60 const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end()->second) {
63 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX,
"TimestampIts");
64 denm.denm.management.reference_time = t_its;
73inline void setStationType(DENM& denm,
const int value) { setStationType(denm.denm.management.station_type, value); }
86inline void setReferencePosition(DENM& denm,
const double latitude,
const double longitude,
87 const double altitude = AltitudeValue::UNAVAILABLE) {
88 setReferencePosition(denm.denm.management.event_position, latitude, longitude, altitude);
99inline void setHeadingValue(HeadingValue& heading,
const double value) {
100 int64_t deg = (int64_t)std::round(value * 1e1);
101 throwIfOutOfRange(deg, HeadingValue::MIN, HeadingValue::MAX,
"HeadingValue");
114inline void setHeading(Heading& heading,
const double value) {
115 heading.heading_confidence.value = HeadingConfidence::UNAVAILABLE;
126 if (denm.denm.location_is_present) {
127 denm.denm.location.event_position_heading_is_present = presence_of_heading;
129 throw std::invalid_argument(
"LocationContainer is not present!");
142inline void setHeading(DENM& denm,
const double heading_val) {
143 if (denm.denm.location_is_present) {
144 setHeading(denm.denm.location.event_position_heading, heading_val);
147 throw std::invalid_argument(
"LocationContainer is not present!");
157inline void setIsSpeedPresent(DENM& denm,
bool presence_of_speed) {
158 if (denm.denm.location_is_present) {
159 denm.denm.location.event_speed_is_present = presence_of_speed;
161 throw std::invalid_argument(
"LocationContainer is not present!");
171inline void setSpeed(DENM& denm,
const double speed_val) {
172 if (denm.denm.location_is_present) {
173 setSpeed(denm.denm.location.event_speed, speed_val);
176 throw std::invalid_argument(
"LocationContainer is not present!");
192inline void setFromUTMPosition(DENM& denm,
const gm::PointStamped& utm_position,
const int& zone,
const bool& northp) {
202inline void setDrivingLaneStatus(DrivingLaneStatus& driving_lane_status,
const std::vector<bool>& bits) {
212inline void setLightBarSirenInUse(LightBarSirenInUse& light_bar_siren_in_use,
const std::vector<bool>& bits) {
void setHeading(Heading &heading, const double value)
Set the Heading object.
void setTimestampITS(TimestampIts ×tamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Set the TimestampITS object.
void setBitString(T &bitstring, const std::vector< bool > &bits)
Set a Bit String by a vector of bools.
void setHeadingValue(HeadingValue &heading, const double value)
Set the HeadingValue object.
void setItsPduHeader(ItsPduHeader &header, const uint8_t message_id, const uint32_t station_id, const uint8_t protocol_version=0)
Set the Its Pdu Header object.
void setLightBarSirenInUse(LightBarSirenInUse &light_bar_siren_in_use, const std::vector< bool > &bits)
Set the Lightbar Siren In Use by a vector of bools.
void setDrivingLaneStatus(DrivingLaneStatus &driving_lane_status, const std::vector< bool > &bits)
Set the Driving Lane Status by a vector of bools.
void setFromUTMPosition(T &reference_position, const gm::PointStamped &utm_position, const int zone, const bool northp)
Set the ReferencePosition from a given UTM-Position.
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v1.3.1.
File containing constants that are used in the context of ETIS ITS Messages.
void setReferenceTime(CollectivePerceptionMessage &cpm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.end() ->second)
Sets the reference time in a CPM.
void setIsSpeedPresent(DENM &denm, bool presence_of_speed)
Set the IsSpeedPresent object for DENM.
void setIsHeadingPresent(DENM &denm, bool presence_of_heading)
Set the IsHeadingPresent object for DENM.