convertIntersectionStateList.h
Go to the documentation of this file.
1 
43 #pragma once
44 
45 #include <stdexcept>
46 
51 #ifdef ROS1
52 #include <etsi_its_spatem_ts_msgs/IntersectionState.h>
53 #include <etsi_its_spatem_ts_msgs/IntersectionStateList.h>
54 namespace spatem_ts_msgs = etsi_its_spatem_ts_msgs;
55 #else
56 #include <etsi_its_spatem_ts_msgs/msg/intersection_state.hpp>
57 #include <etsi_its_spatem_ts_msgs/msg/intersection_state_list.hpp>
58 namespace spatem_ts_msgs = etsi_its_spatem_ts_msgs::msg;
59 #endif
60 
61 
63 
64 void toRos_IntersectionStateList(const spatem_ts_IntersectionStateList_t& in, spatem_ts_msgs::IntersectionStateList& out) {
65  for (int i = 0; i < in.list.count; ++i) {
66  spatem_ts_msgs::IntersectionState el;
67  toRos_IntersectionState(*(in.list.array[i]), el);
68  out.array.push_back(el);
69  }
70 }
71 
72 void toStruct_IntersectionStateList(const spatem_ts_msgs::IntersectionStateList& in, spatem_ts_IntersectionStateList_t& out) {
73  memset(&out, 0, sizeof(spatem_ts_IntersectionStateList_t));
74  for (int i = 0; i < in.array.size(); ++i) {
76  toStruct_IntersectionState(in.array[i], *el);
77  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
78  }
79 }
80 
81 }
spatem_ts_IntersectionState.h
etsi_its_spatem_ts_conversion::toStruct_IntersectionStateList
void toStruct_IntersectionStateList(const spatem_ts_msgs::IntersectionStateList &in, spatem_ts_IntersectionStateList_t &out)
Definition: convertIntersectionStateList.h:72
convertIntersectionState.h
spatem_ts_IntersectionStateList
etsi_its_spatem_ts_conversion::toStruct_IntersectionState
void toStruct_IntersectionState(const spatem_ts_msgs::IntersectionState &in, spatem_ts_IntersectionState_t &out)
Definition: convertIntersectionState.h:104
spatem_ts_IntersectionStateList.h
etsi_its_spatem_ts_conversion::toRos_IntersectionState
void toRos_IntersectionState(const spatem_ts_IntersectionState_t &in, spatem_ts_msgs::IntersectionState &out)
Definition: convertIntersectionState.h:77
asn_SEQUENCE_OF.h
asn_sequence_add
#define asn_sequence_add
etsi_its_spatem_ts_conversion::toRos_IntersectionStateList
void toRos_IntersectionStateList(const spatem_ts_IntersectionStateList_t &in, spatem_ts_msgs::IntersectionStateList &out)
Definition: convertIntersectionStateList.h:64
spatem_ts_IntersectionState
etsi_its_spatem_ts_conversion
Definition: convertAdvisorySpeed.h:67


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