convertPathHistory.h
Go to the documentation of this file.
1 
51 #pragma once
52 
53 #include <stdexcept>
54 
59 #ifdef ROS1
60 #include <etsi_its_vam_ts_msgs/PathPoint.h>
61 #include <etsi_its_vam_ts_msgs/PathHistory.h>
62 namespace vam_ts_msgs = etsi_its_vam_ts_msgs;
63 #else
64 #include <etsi_its_vam_ts_msgs/msg/path_point.hpp>
65 #include <etsi_its_vam_ts_msgs/msg/path_history.hpp>
66 namespace vam_ts_msgs = etsi_its_vam_ts_msgs::msg;
67 #endif
68 
69 
71 
72 void toRos_PathHistory(const vam_ts_PathHistory_t& in, vam_ts_msgs::PathHistory& out) {
73  for (int i = 0; i < in.list.count; ++i) {
74  vam_ts_msgs::PathPoint el;
75  toRos_PathPoint(*(in.list.array[i]), el);
76  out.array.push_back(el);
77  }
78 }
79 
80 void toStruct_PathHistory(const vam_ts_msgs::PathHistory& in, vam_ts_PathHistory_t& out) {
81  memset(&out, 0, sizeof(vam_ts_PathHistory_t));
82  for (int i = 0; i < in.array.size(); ++i) {
83  vam_ts_PathPoint_t* el = (vam_ts_PathPoint_t*) calloc(1, sizeof(vam_ts_PathPoint_t));
84  toStruct_PathPoint(in.array[i], *el);
85  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
86  }
87 }
88 
89 }
vam_ts_PathPoint
etsi_its_vam_ts_conversion::toRos_PathHistory
void toRos_PathHistory(const vam_ts_PathHistory_t &in, vam_ts_msgs::PathHistory &out)
Definition: convertPathHistory.h:72
etsi_its_vam_ts_conversion::toStruct_PathPoint
void toStruct_PathPoint(const vam_ts_msgs::PathPoint &in, vam_ts_PathPoint_t &out)
Definition: convertPathPoint.h:79
vam_ts_PathHistory.h
etsi_its_vam_ts_conversion::toStruct_PathHistory
void toStruct_PathHistory(const vam_ts_msgs::PathHistory &in, vam_ts_PathHistory_t &out)
Definition: convertPathHistory.h:80
vam_ts_PathHistory
asn_SEQUENCE_OF.h
asn_sequence_add
#define asn_sequence_add
etsi_its_vam_ts_conversion::toRos_PathPoint
void toRos_PathPoint(const vam_ts_PathPoint_t &in, vam_ts_msgs::PathPoint &out)
Definition: convertPathPoint.h:71
vam_ts_PathPoint.h
convertPathPoint.h
etsi_its_vam_ts_conversion
Definition: convertAccelerationChange.h:66


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