mapem_ts_getters.h
Go to the documentation of this file.
1 /*
2 =============================================================================
3 MIT License
4 
5 Copyright (c) 2023-2025 Institute for Automotive Engineering (ika), RWTH Aachen University
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 =============================================================================
25 */
26 
32 #pragma once
33 
35 
36 namespace access {
37 
40 
47  inline MinuteOfTheYear getMinuteOfTheYear(const MapData& map) {
48  throwIfNotPresent(map.time_stamp_is_present, "map.time_stamp");
49  return map.time_stamp;
50  }
51 
58  inline uint32_t getMinuteOfTheYearValue(const MapData& map) {
59  MinuteOfTheYear moy = getMinuteOfTheYear(map);
60  return moy.value;
61  }
62 
69  inline MinuteOfTheYear getMinuteOfTheYear(const MAPEM& mapem) {
70  return getMinuteOfTheYear(mapem.map);
71  }
72 
79  inline uint32_t getMinuteOfTheYearValue(const MAPEM& mapem) {
80  return getMinuteOfTheYearValue(mapem.map);
81  }
82 
89  inline uint16_t getIntersectionID(const IntersectionID& intsct_id) {
90  return intsct_id.value;
91  }
92 
99  inline uint16_t getIntersectionID(const IntersectionGeometry& intsct) {
100  return getIntersectionID(intsct.id.id);
101  }
102 
109  inline double getLatitude(const Latitude& latitude) {
110  return ((double)latitude.value)*1e-7;
111  }
112 
119  inline double getLongitude(const Longitude& longitude) {
120  return ((double)longitude.value)*1e-7;
121  }
122 
129  inline double getElevation(const Elevation& elevation) {
130  return ((double)elevation.value)*1e-1;
131  }
132 
139  inline double getLatitude(const Position3D& ref_point) {
140  return getLatitude(ref_point.lat);
141  }
142 
149  inline double getLongitude(const Position3D& ref_point) {
150  return getLongitude(ref_point.lon);
151  }
152 
159  inline double getElevation(const Position3D& ref_point) {
160  throwIfNotPresent(ref_point.elevation_is_present, "Position3D.elevation_is_present");
161  return getElevation(ref_point.elevation);
162  }
163 
170  inline std::vector<bool> getLaneDirection(const LaneDirection& lane_direction) {
171  return getBitString(lane_direction.value, lane_direction.bits_unused);
172  }
173 
180  inline std::vector<bool> getLaneDirection(const LaneAttributes& lane_attributes) {
181  return getLaneDirection(lane_attributes.directional_use);
182  }
183 
190  inline std::vector<bool> getLaneDirection(const GenericLane& generic_lane) {
191  return getLaneDirection(generic_lane.lane_attributes);
192  }
193 
201  template <typename T>
202  inline gm::Point getPointFromNodeXY(const T& node_xy) {
203  gm::Point p;
204  p.x = ((double)node_xy.x.value) * 1e-2;
205  p.y = ((double)node_xy.y.value) * 1e-2;
206  return p;
207  }
208 
209 } // namespace access
210 
211 } // namespace etsi_its_mapem_ts_msgs
etsi_its_mapem_ts_msgs::access::getLaneDirection
std::vector< bool > getLaneDirection(const LaneDirection &lane_direction)
Get the LaneDirection in form of bool vector.
Definition: mapem_ts_getters.h:170
etsi_its_mapem_ts_msgs
Definition: mapem_ts_getters.h:34
checks.h
Sanity-check functions etc.
getBitString
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.
Definition: asn1_primitives_getters.h:42
etsi_its_mapem_ts_msgs::access::getMinuteOfTheYear
MinuteOfTheYear getMinuteOfTheYear(const MapData &map)
Get the value of MinuteOfTheYear object MapData object.
Definition: mapem_ts_getters.h:47
throwIfNotPresent
void throwIfNotPresent(const bool is_present, const std::string val_desc)
Throws an exception if the given value is not present.
Definition: checks.h:57
etsi_its_mapem_ts_msgs::access::getIntersectionID
uint16_t getIntersectionID(const IntersectionID &intsct_id)
Get the IntersectionID value.
Definition: mapem_ts_getters.h:89
etsi_its_mapem_ts_msgs::access::getLongitude
double getLongitude(const Longitude &longitude)
Get the Longitude value.
Definition: mapem_ts_getters.h:119
etsi_its_mapem_ts_msgs::access::getMinuteOfTheYearValue
uint32_t getMinuteOfTheYearValue(const MapData &map)
Get the value of MinuteOfTheYear value from MapData object.
Definition: mapem_ts_getters.h:58
etsi_its_mapem_ts_msgs::access::getElevation
double getElevation(const Elevation &elevation)
Get the Elevation value.
Definition: mapem_ts_getters.h:129
asn1_primitives_getters.h
etsi_its_mapem_ts_msgs::access::getPointFromNodeXY
gm::Point getPointFromNodeXY(const T &node_xy)
Get the Point From NodeXY object.
Definition: mapem_ts_getters.h:202
etsi_its_mapem_ts_msgs::access::getLatitude
double getLatitude(const Latitude &latitude)
Get the Latitude value.
Definition: mapem_ts_getters.h:109


etsi_its_msgs_utils
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:32:12