convertPath.h
Go to the documentation of this file.
1 
50 #pragma once
51 
52 #include <stdexcept>
53 
58 #ifdef ROS1
59 #include <etsi_its_cam_ts_msgs/PathPoint.h>
60 #include <etsi_its_cam_ts_msgs/Path.h>
61 namespace cam_ts_msgs = etsi_its_cam_ts_msgs;
62 #else
63 #include <etsi_its_cam_ts_msgs/msg/path_point.hpp>
64 #include <etsi_its_cam_ts_msgs/msg/path.hpp>
65 namespace cam_ts_msgs = etsi_its_cam_ts_msgs::msg;
66 #endif
67 
68 
70 
71 void toRos_Path(const cam_ts_Path_t& in, cam_ts_msgs::Path& out) {
72  for (int i = 0; i < in.list.count; ++i) {
73  cam_ts_msgs::PathPoint el;
74  toRos_PathPoint(*(in.list.array[i]), el);
75  out.array.push_back(el);
76  }
77 }
78 
79 void toStruct_Path(const cam_ts_msgs::Path& in, cam_ts_Path_t& out) {
80  memset(&out, 0, sizeof(cam_ts_Path_t));
81  for (int i = 0; i < in.array.size(); ++i) {
82  cam_ts_PathPoint_t* el = (cam_ts_PathPoint_t*) calloc(1, sizeof(cam_ts_PathPoint_t));
83  toStruct_PathPoint(in.array[i], *el);
84  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
85  }
86 }
87 
88 }
etsi_its_cam_ts_conversion::toStruct_PathPoint
void toStruct_PathPoint(const cam_ts_msgs::PathPoint &in, cam_ts_PathPoint_t &out)
Definition: convertPathPoint.h:79
cam_ts_Path
etsi_its_cam_ts_conversion::toRos_PathPoint
void toRos_PathPoint(const cam_ts_PathPoint_t &in, cam_ts_msgs::PathPoint &out)
Definition: convertPathPoint.h:71
etsi_its_cam_ts_conversion
Definition: convertAccelerationComponent.h:69
cam_ts_PathPoint
cam_ts_PathPoint.h
cam_ts_Path.h
etsi_its_cam_ts_conversion::toStruct_Path
void toStruct_Path(const cam_ts_msgs::Path &in, cam_ts_Path_t &out)
Definition: convertPath.h:79
asn_SEQUENCE_OF.h
etsi_its_cam_ts_conversion::toRos_Path
void toRos_Path(const cam_ts_Path_t &in, cam_ts_msgs::Path &out)
Definition: convertPath.h:71
asn_sequence_add
#define asn_sequence_add
convertPathPoint.h


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