convertPathHistory.h
Go to the documentation of this file.
1 
40 #pragma once
41 
42 #include <stdexcept>
43 
48 #ifdef ROS1
49 #include <etsi_its_denm_msgs/PathPoint.h>
50 #include <etsi_its_denm_msgs/PathHistory.h>
51 namespace denm_msgs = etsi_its_denm_msgs;
52 #else
53 #include <etsi_its_denm_msgs/msg/path_point.hpp>
54 #include <etsi_its_denm_msgs/msg/path_history.hpp>
55 namespace denm_msgs = etsi_its_denm_msgs::msg;
56 #endif
57 
58 
59 namespace etsi_its_denm_conversion {
60 
61 void toRos_PathHistory(const denm_PathHistory_t& in, denm_msgs::PathHistory& out) {
62  for (int i = 0; i < in.list.count; ++i) {
63  denm_msgs::PathPoint el;
64  toRos_PathPoint(*(in.list.array[i]), el);
65  out.array.push_back(el);
66  }
67 }
68 
69 void toStruct_PathHistory(const denm_msgs::PathHistory& in, denm_PathHistory_t& out) {
70  memset(&out, 0, sizeof(denm_PathHistory_t));
71  for (int i = 0; i < in.array.size(); ++i) {
72  denm_PathPoint_t* el = (denm_PathPoint_t*) calloc(1, sizeof(denm_PathPoint_t));
73  toStruct_PathPoint(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 }
denm_PathHistory.h
denm_PathPoint
etsi_its_denm_conversion::toStruct_PathHistory
void toStruct_PathHistory(const denm_msgs::PathHistory &in, denm_PathHistory_t &out)
Definition: convertPathHistory.h:69
etsi_its_denm_conversion::toRos_PathPoint
void toRos_PathPoint(const denm_PathPoint_t &in, denm_msgs::PathPoint &out)
Definition: convertPathPoint.h:59
denm_PathPoint.h
etsi_its_denm_conversion::toStruct_PathPoint
void toStruct_PathPoint(const denm_msgs::PathPoint &in, denm_PathPoint_t &out)
Definition: convertPathPoint.h:67
etsi_its_denm_conversion
Definition: convertAccidentSubCauseCode.h:54
etsi_its_denm_conversion::toRos_PathHistory
void toRos_PathHistory(const denm_PathHistory_t &in, denm_msgs::PathHistory &out)
Definition: convertPathHistory.h:61
asn_SEQUENCE_OF.h
asn_sequence_add
#define asn_sequence_add
convertPathPoint.h
denm_PathHistory


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