convertPolygon.h
Go to the documentation of this file.
1 
40 #pragma once
41 
42 #include <stdexcept>
43 
48 #ifdef ROS1
49 #include <etsi_its_mcm_uulm_msgs/Waypoint.h>
50 #include <etsi_its_mcm_uulm_msgs/Polygon.h>
51 namespace mcm_uulm_msgs = etsi_its_mcm_uulm_msgs;
52 #else
53 #include <etsi_its_mcm_uulm_msgs/msg/waypoint.hpp>
54 #include <etsi_its_mcm_uulm_msgs/msg/polygon.hpp>
55 namespace mcm_uulm_msgs = etsi_its_mcm_uulm_msgs::msg;
56 #endif
57 
58 
60 
61 void toRos_Polygon(const mcm_uulm_Polygon_t& in, mcm_uulm_msgs::Polygon& out) {
62  for (int i = 0; i < in.list.count; ++i) {
63  mcm_uulm_msgs::Waypoint el;
64  toRos_Waypoint(*(in.list.array[i]), el);
65  out.array.push_back(el);
66  }
67 }
68 
69 void toStruct_Polygon(const mcm_uulm_msgs::Polygon& in, mcm_uulm_Polygon_t& out) {
70  memset(&out, 0, sizeof(mcm_uulm_Polygon_t));
71  for (int i = 0; i < in.array.size(); ++i) {
73  toStruct_Waypoint(in.array[i], *el);
74  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
75  }
76 }
77 
78 }
convertWaypoint.h
etsi_its_mcm_uulm_conversion::toRos_Waypoint
void toRos_Waypoint(const mcm_uulm_Waypoint_t &in, mcm_uulm_msgs::Waypoint &out)
Definition: convertWaypoint.h:58
etsi_its_mcm_uulm_conversion
Definition: convertAdviceResponse.h:59
etsi_its_mcm_uulm_conversion::toRos_Polygon
void toRos_Polygon(const mcm_uulm_Polygon_t &in, mcm_uulm_msgs::Polygon &out)
Definition: convertPolygon.h:61
mcm_uulm_Waypoint
etsi_its_mcm_uulm_conversion::toStruct_Waypoint
void toStruct_Waypoint(const mcm_uulm_msgs::Waypoint &in, mcm_uulm_Waypoint_t &out)
Definition: convertWaypoint.h:63
mcm_uulm_Polygon.h
mcm_uulm_Waypoint.h
asn_SEQUENCE_OF.h
mcm_uulm_Polygon
asn_sequence_add
#define asn_sequence_add
etsi_its_mcm_uulm_conversion::toStruct_Polygon
void toStruct_Polygon(const mcm_uulm_msgs::Polygon &in, mcm_uulm_Polygon_t &out)
Definition: convertPolygon.h:69


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