convertProtectedCommunicationZone.h
Go to the documentation of this file.
1 
48 #pragma once
49 
57 #ifdef ROS1
58 #include <etsi_its_cam_msgs/ProtectedCommunicationZone.h>
59 namespace cam_msgs = etsi_its_cam_msgs;
60 #else
61 #include <etsi_its_cam_msgs/msg/protected_communication_zone.hpp>
62 namespace cam_msgs = etsi_its_cam_msgs::msg;
63 #endif
64 
65 
66 namespace etsi_its_cam_conversion {
67 
68 void toRos_ProtectedCommunicationZone(const cam_ProtectedCommunicationZone_t& in, cam_msgs::ProtectedCommunicationZone& out) {
69  toRos_ProtectedZoneType(in.protectedZoneType, out.protected_zone_type);
70  if (in.expiryTime) {
71  toRos_TimestampIts(*in.expiryTime, out.expiry_time);
72  out.expiry_time_is_present = true;
73  }
74  toRos_Latitude(in.protectedZoneLatitude, out.protected_zone_latitude);
75  toRos_Longitude(in.protectedZoneLongitude, out.protected_zone_longitude);
76  if (in.protectedZoneRadius) {
77  toRos_ProtectedZoneRadius(*in.protectedZoneRadius, out.protected_zone_radius);
78  out.protected_zone_radius_is_present = true;
79  }
80  if (in.protectedZoneID) {
81  toRos_ProtectedZoneID(*in.protectedZoneID, out.protected_zone_id);
82  out.protected_zone_id_is_present = true;
83  }
84 }
85 
86 void toStruct_ProtectedCommunicationZone(const cam_msgs::ProtectedCommunicationZone& in, cam_ProtectedCommunicationZone_t& out) {
87  memset(&out, 0, sizeof(cam_ProtectedCommunicationZone_t));
88  toStruct_ProtectedZoneType(in.protected_zone_type, out.protectedZoneType);
89  if (in.expiry_time_is_present) {
90  out.expiryTime = (cam_TimestampIts_t*) calloc(1, sizeof(cam_TimestampIts_t));
91  toStruct_TimestampIts(in.expiry_time, *out.expiryTime);
92  }
93  toStruct_Latitude(in.protected_zone_latitude, out.protectedZoneLatitude);
94  toStruct_Longitude(in.protected_zone_longitude, out.protectedZoneLongitude);
95  if (in.protected_zone_radius_is_present) {
97  toStruct_ProtectedZoneRadius(in.protected_zone_radius, *out.protectedZoneRadius);
98  }
99  if (in.protected_zone_id_is_present) {
100  out.protectedZoneID = (cam_ProtectedZoneID_t*) calloc(1, sizeof(cam_ProtectedZoneID_t));
101  toStruct_ProtectedZoneID(in.protected_zone_id, *out.protectedZoneID);
102  }
103 }
104 
105 }
convertTimestampIts.h
ASN__PRIMITIVE_TYPE_s
etsi_its_cam_conversion::toStruct_ProtectedZoneID
void toStruct_ProtectedZoneID(const cam_msgs::ProtectedZoneID &in, cam_ProtectedZoneID_t &out)
Definition: convertProtectedZoneID.h:60
etsi_its_cam_conversion::toRos_ProtectedZoneRadius
void toRos_ProtectedZoneRadius(const cam_ProtectedZoneRadius_t &in, cam_msgs::ProtectedZoneRadius &out)
Definition: convertProtectedZoneRadius.h:56
etsi_its_cam_conversion
Definition: convertAccelerationConfidence.h:54
cam_ProtectedCommunicationZone::protectedZoneType
cam_ProtectedZoneType_t protectedZoneType
etsi_its_cam_conversion::toStruct_ProtectedZoneType
void toStruct_ProtectedZoneType(const cam_msgs::ProtectedZoneType &in, cam_ProtectedZoneType_t &out)
Definition: convertProtectedZoneType.h:59
cam_ProtectedCommunicationZone.h
etsi_its_cam_conversion::toRos_ProtectedCommunicationZone
void toRos_ProtectedCommunicationZone(const cam_ProtectedCommunicationZone_t &in, cam_msgs::ProtectedCommunicationZone &out)
Definition: convertProtectedCommunicationZone.h:68
etsi_its_cam_conversion::toStruct_Latitude
void toStruct_Latitude(const cam_msgs::Latitude &in, cam_Latitude_t &out)
Definition: convertLatitude.h:60
etsi_its_cam_conversion::toRos_TimestampIts
void toRos_TimestampIts(const cam_TimestampIts_t &in, cam_msgs::TimestampIts &out)
Definition: convertTimestampIts.h:56
cam_ProtectedCommunicationZone::protectedZoneLatitude
cam_Latitude_t protectedZoneLatitude
cam_ProtectedCommunicationZone
cam_ProtectedZoneRadius_t
long cam_ProtectedZoneRadius_t
cam_ProtectedCommunicationZone::protectedZoneID
cam_ProtectedZoneID_t * protectedZoneID
cam_ProtectedCommunicationZone::protectedZoneLongitude
cam_Longitude_t protectedZoneLongitude
convertProtectedZoneType.h
convertLongitude.h
convertProtectedZoneRadius.h
etsi_its_cam_conversion::toStruct_ProtectedZoneRadius
void toStruct_ProtectedZoneRadius(const cam_msgs::ProtectedZoneRadius &in, cam_ProtectedZoneRadius_t &out)
Definition: convertProtectedZoneRadius.h:60
etsi_its_cam_conversion::toStruct_TimestampIts
void toStruct_TimestampIts(const cam_msgs::TimestampIts &in, cam_TimestampIts_t &out)
Definition: convertTimestampIts.h:60
cam_ProtectedCommunicationZone::expiryTime
cam_TimestampIts_t * expiryTime
etsi_its_cam_conversion::toRos_Longitude
void toRos_Longitude(const cam_Longitude_t &in, cam_msgs::Longitude &out)
Definition: convertLongitude.h:56
etsi_its_cam_conversion::toRos_ProtectedZoneID
void toRos_ProtectedZoneID(const cam_ProtectedZoneID_t &in, cam_msgs::ProtectedZoneID &out)
Definition: convertProtectedZoneID.h:56
cam_ProtectedCommunicationZone::protectedZoneRadius
cam_ProtectedZoneRadius_t * protectedZoneRadius
etsi_its_cam_conversion::toStruct_ProtectedCommunicationZone
void toStruct_ProtectedCommunicationZone(const cam_msgs::ProtectedCommunicationZone &in, cam_ProtectedCommunicationZone_t &out)
Definition: convertProtectedCommunicationZone.h:86
convertProtectedZoneID.h
convertLatitude.h
cam_ProtectedZoneID_t
long cam_ProtectedZoneID_t
etsi_its_cam_conversion::toStruct_Longitude
void toStruct_Longitude(const cam_msgs::Longitude &in, cam_Longitude_t &out)
Definition: convertLongitude.h:60
etsi_its_cam_conversion::toRos_ProtectedZoneType
void toRos_ProtectedZoneType(const cam_ProtectedZoneType_t &in, cam_msgs::ProtectedZoneType &out)
Definition: convertProtectedZoneType.h:55
etsi_its_cam_conversion::toRos_Latitude
void toRos_Latitude(const cam_Latitude_t &in, cam_msgs::Latitude &out)
Definition: convertLatitude.h:56


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