etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_ts_setters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#pragma once
10
11namespace etsi_its_denm_ts_msgs::access {
12
14
16
21 * @param station_id
22 * @param protocol_version
23 */
24inline void setItsPduHeader(DENM& denm, const uint32_t station_id, const uint8_t protocol_version = 0) {
25 setItsPduHeader(denm.header, MessageId::DENM, station_id, protocol_version);
26}
27
28/**
29 * @brief Set the IsWGSHeadingPresent object for DENM
30 *
31 * @param denm DENM to set IsWGSHeadingPresent
32 * @param presence_of_heading IsWGSHeadingPresent-Value (true or false)
33 */
34inline void setIsWGSHeadingPresent(DENM& denm, bool presence_of_heading) {
35 if (denm.denm.location_is_present) {
36 denm.denm.location.event_position_heading_is_present = presence_of_heading;
37 } else {
38 throw std::invalid_argument("LocationContainer is not present!");
39 }
41
43 * @brief Set the WGS Heading for a DENM
44 *
45 * 0.0° equals WGS84 North, 90.0° equals WGS84 East, 180.0° equals WGS84 South and 270.0° equals WGS84 West
46 * Wgs84AngleConfidence is set to UNAVAILABLE
47 *
48 * @param denm DENM to set the WGS Heading
49 * @param heading_val Heading value in degree as decimal number
50 * @param confidence standard deviation of heading in degree as decimal number (default: infinity, mapping to Wgs84AngleConfidence::UNAVAILABLE)
51 */
52inline void setWGSHeading(DENM& denm, const double heading_val, const double confidence = std::numeric_limits<double>::infinity()) {
53 if (denm.denm.location_is_present) {
54 setWGSHeadingCDD(denm.denm.location.event_position_heading, heading_val, confidence);
55 setIsWGSHeadingPresent(denm, true);
56 } else {
57 throw std::invalid_argument("LocationContainer is not present!");
58 }
59}
60
61} // namespace etsi_its_denm_ts_msgs::access
Setter functions for the ETSI ITS Common Data Dictionary (CDD) v2.2.1.
Common setter functions for the ETSI ITS DENM (EN and TS).
void setWGSHeadingCDD(Wgs84Angle &heading, const double value, double confidence=std::numeric_limits< double >::infinity())
Set the Wgs84Angle object.
void setWGSHeading(DENM &denm, const double heading_val, const double confidence=std::numeric_limits< double >::infinity())
Set the WGS Heading for a DENM.
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 setIsWGSHeadingPresent(DENM &denm, bool presence_of_heading)
Set the IsWGSHeadingPresent object for DENM.