convertPathReferences.h
Go to the documentation of this file.
1 
46 #pragma once
47 
48 #include <stdexcept>
49 
54 #ifdef ROS1
55 #include <etsi_its_denm_ts_msgs/PathId.h>
56 #include <etsi_its_denm_ts_msgs/PathReferences.h>
57 namespace denm_ts_msgs = etsi_its_denm_ts_msgs;
58 #else
59 #include <etsi_its_denm_ts_msgs/msg/path_id.hpp>
60 #include <etsi_its_denm_ts_msgs/msg/path_references.hpp>
61 namespace denm_ts_msgs = etsi_its_denm_ts_msgs::msg;
62 #endif
63 
64 
66 
67 void toRos_PathReferences(const denm_ts_PathReferences_t& in, denm_ts_msgs::PathReferences& out) {
68  for (int i = 0; i < in.list.count; ++i) {
69  denm_ts_msgs::PathId el;
70  toRos_PathId(*(in.list.array[i]), el);
71  out.array.push_back(el);
72  }
73 }
74 
75 void toStruct_PathReferences(const denm_ts_msgs::PathReferences& in, denm_ts_PathReferences_t& out) {
76  memset(&out, 0, sizeof(denm_ts_PathReferences_t));
77  for (int i = 0; i < in.array.size(); ++i) {
78  denm_ts_PathId_t* el = (denm_ts_PathId_t*) calloc(1, sizeof(denm_ts_PathId_t));
79  toStruct_PathId(in.array[i], *el);
80  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
81  }
82 }
83 
84 }
denm_ts_PathReferences
denm_ts_PathId.h
etsi_its_denm_ts_conversion::toRos_PathId
void toRos_PathId(const denm_ts_PathId_t &in, denm_ts_msgs::PathId &out)
Definition: convertPathId.h:83
etsi_its_denm_ts_conversion::toStruct_PathReferences
void toStruct_PathReferences(const denm_ts_msgs::PathReferences &in, denm_ts_PathReferences_t &out)
Definition: convertPathReferences.h:75
etsi_its_denm_ts_conversion
Definition: convertAcceleration3dWithConfidence.h:69
etsi_its_denm_ts_conversion::toStruct_PathId
void toStruct_PathId(const denm_ts_msgs::PathId &in, denm_ts_PathId_t &out)
Definition: convertPathId.h:87
etsi_its_denm_ts_conversion::toRos_PathReferences
void toRos_PathReferences(const denm_ts_PathReferences_t &in, denm_ts_msgs::PathReferences &out)
Definition: convertPathReferences.h:67
convertPathId.h
denm_ts_PathId_t
long denm_ts_PathId_t
denm_ts_PathReferences.h
asn_SEQUENCE_OF.h
asn_sequence_add
#define asn_sequence_add


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