etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
mapem_ts_getters.h File Reference

Getter functions for the ETSI ITS MAPEM. More...

#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
#include <etsi_its_msgs_utils/impl/checks.h>

Go to the source code of this file.

Functions

std::vector< bool > etsi_its_mapem_ts_msgs::access::getBitString (const std::vector< uint8_t > &buffer, const int bits_unused)
 Get a Bit String in form of bool vector.
template<typename T1, typename T2>
void etsi_its_mapem_ts_msgs::access::throwIfOutOfRange (const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
 Throws an exception if a given value is out of a defined range.
void etsi_its_mapem_ts_msgs::access::throwIfNotPresent (const bool is_present, const std::string val_desc)
 Throws an exception if the given value is not present.
MinuteOfTheYear etsi_its_mapem_ts_msgs::access::getMinuteOfTheYear (const MapData &map)
 Get the value of MinuteOfTheYear object MapData object.
uint32_t etsi_its_mapem_ts_msgs::access::getMinuteOfTheYearValue (const MapData &map)
 Get the value of MinuteOfTheYear value from MapData object.
MinuteOfTheYear etsi_its_mapem_ts_msgs::access::getMinuteOfTheYear (const MAPEM &mapem)
 Get the value of MinuteOfTheYear object from mapem.
uint32_t etsi_its_mapem_ts_msgs::access::getMinuteOfTheYearValue (const MAPEM &mapem)
 Get the value of MinuteOfTheYear value from mapem.
uint16_t etsi_its_mapem_ts_msgs::access::getIntersectionID (const IntersectionID &intsct_id)
 Get the IntersectionID value.
uint16_t etsi_its_mapem_ts_msgs::access::getIntersectionID (const IntersectionGeometry &intsct)
 Get the IntersectionId of an IntersectionGeometry object.
double etsi_its_mapem_ts_msgs::access::getLatitude (const Latitude &latitude)
 Get the Latitude value.
double etsi_its_mapem_ts_msgs::access::getLongitude (const Longitude &longitude)
 Get the Longitude value.
double etsi_its_mapem_ts_msgs::access::getElevation (const Elevation &elevation)
 Get the Elevation value.
double etsi_its_mapem_ts_msgs::access::getLatitude (const Position3D &ref_point)
 Get the Latitude value from a given Position3D object.
double etsi_its_mapem_ts_msgs::access::getLongitude (const Position3D &ref_point)
 Get the Longitude value from a given Position3D object.
double etsi_its_mapem_ts_msgs::access::getElevation (const Position3D &ref_point)
 Get the Elevation value from a given Position3D object.
std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection (const LaneDirection &lane_direction)
 Get the LaneDirection in form of bool vector.
std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection (const LaneAttributes &lane_attributes)
 Get the LaneDirection in form of bool vector from a LaneAttributes object.
std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection (const GenericLane &generic_lane)
 Get the LaneDirection in form of bool vector from a GenericLane object.
template<typename T>
gm::Point etsi_its_mapem_ts_msgs::access::getPointFromNodeXY (const T &node_xy)
 Get the Point From NodeXY object.

Detailed Description

Getter functions for the ETSI ITS MAPEM.

Definition in file mapem_ts_getters.h.

Function Documentation

◆ getBitString()

std::vector< bool > etsi_its_mapem_ts_msgs::access::getBitString ( const std::vector< uint8_t > & buffer,
const int bits_unused )
inline

Get a Bit String in form of bool vector.

Parameters
bufferas uint8_t vector
bits_unusednumber of bits to ignore at the end of the bit string
Returns
std::vector<bool>

Definition at line 43 of file mapem_ts_getters.h.

58 inline uint32_t getMinuteOfTheYearValue(const MapData& map) {
59 MinuteOfTheYear moy = getMinuteOfTheYear(map);
60 return moy.value;
61 }
62
void throwIfNotPresent(const bool is_present, const std::string val_desc)
Throws an exception if the given value is not present.

◆ getElevation() [1/2]

double etsi_its_mapem_ts_msgs::access::getElevation ( const Elevation & elevation)
inline

Get the Elevation value.

Parameters
elevationobject to get the Elevation value from
Returns
Elevation value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 129 of file mapem_ts_getters.h.

129 {
130 return ((double)elevation.value)*1e-1;
131 }

◆ getElevation() [2/2]

double etsi_its_mapem_ts_msgs::access::getElevation ( const Position3D & ref_point)
inline

Get the Elevation value from a given Position3D object.

Parameters
ref_pointPosition3D object to get the Elevation value from
Returns
Elevation value (above the reference ellipsoid surface) in meter as decimal number

Definition at line 159 of file mapem_ts_getters.h.

159 {
160 throwIfNotPresent(ref_point.elevation_is_present, "Position3D.elevation_is_present");
161 return getElevation(ref_point.elevation);
162 }
double getElevation(const Elevation &elevation)
Get the Elevation value.

◆ getIntersectionID() [1/2]

uint16_t etsi_its_mapem_ts_msgs::access::getIntersectionID ( const IntersectionGeometry & intsct)
inline

Get the IntersectionId of an IntersectionGeometry object.

Parameters
intsctIntersectionGeometry object
Returns
uint16_t the IntersectionId value

Definition at line 99 of file mapem_ts_getters.h.

99 {
100 return getIntersectionID(intsct.id.id);
101 }
uint16_t getIntersectionID(const IntersectionID &intsct_id)
Get the IntersectionID value.

◆ getIntersectionID() [2/2]

uint16_t etsi_its_mapem_ts_msgs::access::getIntersectionID ( const IntersectionID & intsct_id)
inline

Get the IntersectionID value.

Parameters
intsct_idIntersectionID object to get the value from
Returns
uint16_t the IntersectionID value

Definition at line 89 of file mapem_ts_getters.h.

89 {
90 return intsct_id.value;
91 }

◆ getLaneDirection() [1/3]

std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection ( const GenericLane & generic_lane)
inline

Get the LaneDirection in form of bool vector from a GenericLane object.

Parameters
generic_laneGenericLane object to get the bool vector from
Returns
std::vector<bool>

Definition at line 190 of file mapem_ts_getters.h.

190 {
191 return getLaneDirection(generic_lane.lane_attributes);
192 }
std::vector< bool > getLaneDirection(const LaneDirection &lane_direction)
Get the LaneDirection in form of bool vector.

◆ getLaneDirection() [2/3]

std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection ( const LaneAttributes & lane_attributes)
inline

Get the LaneDirection in form of bool vector from a LaneAttributes object.

Parameters
lane_attributesLaneAttributes object to get the bool vector from
Returns
std::vector<bool>

Definition at line 180 of file mapem_ts_getters.h.

180 {
181 return getLaneDirection(lane_attributes.directional_use);
182 }

◆ getLaneDirection() [3/3]

std::vector< bool > etsi_its_mapem_ts_msgs::access::getLaneDirection ( const LaneDirection & lane_direction)
inline

Get the LaneDirection in form of bool vector.

Parameters
lane_directionLaneDirection object to get the bool vector from
Returns
std::vector<bool>

Definition at line 170 of file mapem_ts_getters.h.

170 {
171 return getBitString(lane_direction.value, lane_direction.bits_unused);
172 }
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.

◆ getLatitude() [1/2]

double etsi_its_mapem_ts_msgs::access::getLatitude ( const Latitude & latitude)
inline

Get the Latitude value.

Parameters
latitudeobject to get the Latitude value from
Returns
Latitude value in degree as decimal number

Definition at line 109 of file mapem_ts_getters.h.

109 {
110 return ((double)latitude.value)*1e-7;
111 }

◆ getLatitude() [2/2]

double etsi_its_mapem_ts_msgs::access::getLatitude ( const Position3D & ref_point)
inline

Get the Latitude value from a given Position3D object.

Parameters
ref_pointPosition3D object to get the Latitude value from
Returns
Latitude value in degree as decimal number

Definition at line 139 of file mapem_ts_getters.h.

139 {
140 return getLatitude(ref_point.lat);
141 }
double getLatitude(const Latitude &latitude)
Get the Latitude value.

◆ getLongitude() [1/2]

double etsi_its_mapem_ts_msgs::access::getLongitude ( const Longitude & longitude)
inline

Get the Longitude value.

Parameters
longitudeobject to get the Longitude value from
Returns
Longitude value in degree as decimal number

Definition at line 119 of file mapem_ts_getters.h.

119 {
120 return ((double)longitude.value)*1e-7;
121 }

◆ getLongitude() [2/2]

double etsi_its_mapem_ts_msgs::access::getLongitude ( const Position3D & ref_point)
inline

Get the Longitude value from a given Position3D object.

Parameters
ref_pointPosition3D object to get the Longitude value from
Returns
Longitude value in degree as decimal number

Definition at line 149 of file mapem_ts_getters.h.

149 {
150 return getLongitude(ref_point.lon);
151 }
double getLongitude(const Longitude &longitude)
Get the Longitude value.

◆ getMinuteOfTheYear() [1/2]

MinuteOfTheYear etsi_its_mapem_ts_msgs::access::getMinuteOfTheYear ( const MapData & map)
inline

Get the value of MinuteOfTheYear object MapData object.

Parameters
mapobject to get the MinuteOfTheYear from
Returns
MinuteOfTheYear the minute of the year object

Definition at line 47 of file mapem_ts_getters.h.

47 {
48 throwIfNotPresent(map.time_stamp_is_present, "map.time_stamp");
49 return map.time_stamp;
50 }

◆ getMinuteOfTheYear() [2/2]

MinuteOfTheYear etsi_its_mapem_ts_msgs::access::getMinuteOfTheYear ( const MAPEM & mapem)
inline

Get the value of MinuteOfTheYear object from mapem.

Parameters
mapemobject to get the MinuteOfTheYear
Returns
MinuteOfTheYear the minute of the year object

Definition at line 69 of file mapem_ts_getters.h.

69 {
70 return getMinuteOfTheYear(mapem.map);
71 }
MinuteOfTheYear getMinuteOfTheYear(const MapData &map)
Get the value of MinuteOfTheYear object MapData object.

◆ getMinuteOfTheYearValue() [1/2]

uint32_t etsi_its_mapem_ts_msgs::access::getMinuteOfTheYearValue ( const MapData & map)
inline

Get the value of MinuteOfTheYear value from MapData object.

Parameters
mapobject to get the MinuteOfTheYear value from
Returns
uint32_t the minute of the year value

Definition at line 58 of file mapem_ts_getters.h.

58 {
59 MinuteOfTheYear moy = getMinuteOfTheYear(map);
60 return moy.value;
61 }

◆ getMinuteOfTheYearValue() [2/2]

uint32_t etsi_its_mapem_ts_msgs::access::getMinuteOfTheYearValue ( const MAPEM & mapem)
inline

Get the value of MinuteOfTheYear value from mapem.

Parameters
mapemobject to get the MinuteOfTheYear value from
Returns
uint32_t the minute of the year value

Definition at line 79 of file mapem_ts_getters.h.

79 {
80 return getMinuteOfTheYearValue(mapem.map);
81 }
uint32_t getMinuteOfTheYearValue(const MapData &map)
Get the value of MinuteOfTheYear value from MapData object.

◆ getPointFromNodeXY()

template<typename T>
gm::Point etsi_its_mapem_ts_msgs::access::getPointFromNodeXY ( const T & node_xy)
inline

Get the Point From NodeXY object.

Template Parameters
Trepresenting different NodeXY types (NodeXY20b, NodeXY22b...)
Parameters
node_xythe NodeXY object
Returns
gm::Point geometry_msgs::Point representing the node point (values given in meters)

Definition at line 202 of file mapem_ts_getters.h.

202 {
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 }

◆ throwIfNotPresent()

void etsi_its_mapem_ts_msgs::access::throwIfNotPresent ( const bool is_present,
const std::string val_desc )
inline

Throws an exception if the given value is not present.

Parameters
is_presentWhether the value is present.
val_descDescription of the value for the exception message.

Definition at line 58 of file mapem_ts_getters.h.

58 {
59 MinuteOfTheYear moy = getMinuteOfTheYear(map);
60 return moy.value;

◆ throwIfOutOfRange()

template<typename T1, typename T2>
void etsi_its_mapem_ts_msgs::access::throwIfOutOfRange ( const T1 & val,
const T2 & min,
const T2 & max,
const std::string val_desc )

Throws an exception if a given value is out of a defined range.

Template Parameters
T1
T2
Parameters
valThe value to check if it is in the range.
minThe minimum value of the range.
maxThe maximum value of the range.
val_descDescription of the value for the exception message.

Definition at line 47 of file mapem_ts_getters.h.

47 {
48 throwIfNotPresent(map.time_stamp_is_present, "map.time_stamp");
49 return map.time_stamp;
50 }
51