convertRoadSegmentList.h
Go to the documentation of this file.
1 
43 #pragma once
44 
45 #include <stdexcept>
46 
51 #ifdef ROS1
52 #include <etsi_its_mapem_ts_msgs/RoadSegment.h>
53 #include <etsi_its_mapem_ts_msgs/RoadSegmentList.h>
54 namespace mapem_ts_msgs = etsi_its_mapem_ts_msgs;
55 #else
56 #include <etsi_its_mapem_ts_msgs/msg/road_segment.hpp>
57 #include <etsi_its_mapem_ts_msgs/msg/road_segment_list.hpp>
58 namespace mapem_ts_msgs = etsi_its_mapem_ts_msgs::msg;
59 #endif
60 
61 
63 
64 void toRos_RoadSegmentList(const mapem_ts_RoadSegmentList_t& in, mapem_ts_msgs::RoadSegmentList& out) {
65  for (int i = 0; i < in.list.count; ++i) {
66  mapem_ts_msgs::RoadSegment el;
67  toRos_RoadSegment(*(in.list.array[i]), el);
68  out.array.push_back(el);
69  }
70 }
71 
72 void toStruct_RoadSegmentList(const mapem_ts_msgs::RoadSegmentList& in, mapem_ts_RoadSegmentList_t& out) {
73  memset(&out, 0, sizeof(mapem_ts_RoadSegmentList_t));
74  for (int i = 0; i < in.array.size(); ++i) {
76  toStruct_RoadSegment(in.array[i], *el);
77  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
78  }
79 }
80 
81 }
etsi_its_mapem_ts_conversion::toRos_RoadSegment
void toRos_RoadSegment(const mapem_ts_RoadSegment_t &in, mapem_ts_msgs::RoadSegment &out)
Definition: convertRoadSegment.h:73
etsi_its_mapem_ts_conversion::toStruct_RoadSegmentList
void toStruct_RoadSegmentList(const mapem_ts_msgs::RoadSegmentList &in, mapem_ts_RoadSegmentList_t &out)
Definition: convertRoadSegmentList.h:72
mapem_ts_RoadSegment
mapem_ts_RoadSegmentList
etsi_its_mapem_ts_conversion::toRos_RoadSegmentList
void toRos_RoadSegmentList(const mapem_ts_RoadSegmentList_t &in, mapem_ts_msgs::RoadSegmentList &out)
Definition: convertRoadSegmentList.h:64
etsi_its_mapem_ts_conversion
Definition: convertAllowedManeuvers.h:70
etsi_its_mapem_ts_conversion::toStruct_RoadSegment
void toStruct_RoadSegment(const mapem_ts_msgs::RoadSegment &in, mapem_ts_RoadSegment_t &out)
Definition: convertRoadSegment.h:92
asn_SEQUENCE_OF.h
mapem_ts_RoadSegmentList.h
asn_sequence_add
#define asn_sequence_add
mapem_ts_RoadSegment.h
convertRoadSegment.h


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