-
Notifications
You must be signed in to change notification settings - Fork 0
/
slros_busmsg_conversion.cpp
260 lines (187 loc) · 9.21 KB
/
slros_busmsg_conversion.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
#include "slros_busmsg_conversion.h"
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Point and geometry_msgs::Point
void convertFromBus(geometry_msgs::Point* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Point const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Point");
msgPtr->x = busPtr->X;
msgPtr->y = busPtr->Y;
msgPtr->z = busPtr->Z;
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Point* busPtr, geometry_msgs::Point const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Point");
busPtr->X = msgPtr->x;
busPtr->Y = msgPtr->y;
busPtr->Z = msgPtr->z;
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Pose and geometry_msgs::Pose
void convertFromBus(geometry_msgs::Pose* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Pose const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Pose");
convertFromBus(&msgPtr->orientation, &busPtr->Orientation);
convertFromBus(&msgPtr->position, &busPtr->Position);
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Pose* busPtr, geometry_msgs::Pose const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Pose");
convertToBus(&busPtr->Orientation, &msgPtr->orientation);
convertToBus(&busPtr->Position, &msgPtr->position);
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_PoseWithCovariance and geometry_msgs::PoseWithCovariance
void convertFromBus(geometry_msgs::PoseWithCovariance* msgPtr, SL_Bus_deadreckoning_geometry_msgs_PoseWithCovariance const* busPtr)
{
const std::string rosMessageType("geometry_msgs/PoseWithCovariance");
convertFromBusFixedPrimitiveArray(msgPtr->covariance, busPtr->Covariance);
convertFromBus(&msgPtr->pose, &busPtr->Pose);
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_PoseWithCovariance* busPtr, geometry_msgs::PoseWithCovariance const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/PoseWithCovariance");
convertToBusFixedPrimitiveArray(busPtr->Covariance, msgPtr->covariance, slros::NoopWarning());
convertToBus(&busPtr->Pose, &msgPtr->pose);
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Quaternion and geometry_msgs::Quaternion
void convertFromBus(geometry_msgs::Quaternion* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Quaternion const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Quaternion");
msgPtr->w = busPtr->W;
msgPtr->x = busPtr->X;
msgPtr->y = busPtr->Y;
msgPtr->z = busPtr->Z;
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Quaternion* busPtr, geometry_msgs::Quaternion const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Quaternion");
busPtr->W = msgPtr->w;
busPtr->X = msgPtr->x;
busPtr->Y = msgPtr->y;
busPtr->Z = msgPtr->z;
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Twist and geometry_msgs::Twist
void convertFromBus(geometry_msgs::Twist* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Twist const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Twist");
convertFromBus(&msgPtr->angular, &busPtr->Angular);
convertFromBus(&msgPtr->linear, &busPtr->Linear);
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Twist* busPtr, geometry_msgs::Twist const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Twist");
convertToBus(&busPtr->Angular, &msgPtr->angular);
convertToBus(&busPtr->Linear, &msgPtr->linear);
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_TwistWithCovariance and geometry_msgs::TwistWithCovariance
void convertFromBus(geometry_msgs::TwistWithCovariance* msgPtr, SL_Bus_deadreckoning_geometry_msgs_TwistWithCovariance const* busPtr)
{
const std::string rosMessageType("geometry_msgs/TwistWithCovariance");
convertFromBusFixedPrimitiveArray(msgPtr->covariance, busPtr->Covariance);
convertFromBus(&msgPtr->twist, &busPtr->Twist);
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_TwistWithCovariance* busPtr, geometry_msgs::TwistWithCovariance const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/TwistWithCovariance");
convertToBusFixedPrimitiveArray(busPtr->Covariance, msgPtr->covariance, slros::NoopWarning());
convertToBus(&busPtr->Twist, &msgPtr->twist);
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Vector3 and geometry_msgs::Vector3
void convertFromBus(geometry_msgs::Vector3* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Vector3 const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Vector3");
msgPtr->x = busPtr->X;
msgPtr->y = busPtr->Y;
msgPtr->z = busPtr->Z;
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Vector3* busPtr, geometry_msgs::Vector3 const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Vector3");
busPtr->X = msgPtr->x;
busPtr->Y = msgPtr->y;
busPtr->Z = msgPtr->z;
}
// Conversions between SL_Bus_deadreckoning_geometry_msgs_Wrench and geometry_msgs::Wrench
void convertFromBus(geometry_msgs::Wrench* msgPtr, SL_Bus_deadreckoning_geometry_msgs_Wrench const* busPtr)
{
const std::string rosMessageType("geometry_msgs/Wrench");
convertFromBus(&msgPtr->force, &busPtr->Force);
convertFromBus(&msgPtr->torque, &busPtr->Torque);
}
void convertToBus(SL_Bus_deadreckoning_geometry_msgs_Wrench* busPtr, geometry_msgs::Wrench const* msgPtr)
{
const std::string rosMessageType("geometry_msgs/Wrench");
convertToBus(&busPtr->Force, &msgPtr->force);
convertToBus(&busPtr->Torque, &msgPtr->torque);
}
// Conversions between SL_Bus_deadreckoning_nav_msgs_Odometry and nav_msgs::Odometry
void convertFromBus(nav_msgs::Odometry* msgPtr, SL_Bus_deadreckoning_nav_msgs_Odometry const* busPtr)
{
const std::string rosMessageType("nav_msgs/Odometry");
convertFromBusVariablePrimitiveArray(msgPtr->child_frame_id, busPtr->ChildFrameId, busPtr->ChildFrameId_SL_Info);
convertFromBus(&msgPtr->header, &busPtr->Header);
convertFromBus(&msgPtr->pose, &busPtr->Pose);
convertFromBus(&msgPtr->twist, &busPtr->Twist);
}
void convertToBus(SL_Bus_deadreckoning_nav_msgs_Odometry* busPtr, nav_msgs::Odometry const* msgPtr)
{
const std::string rosMessageType("nav_msgs/Odometry");
convertToBusVariablePrimitiveArray(busPtr->ChildFrameId, busPtr->ChildFrameId_SL_Info, msgPtr->child_frame_id, slros::EnabledWarning(rosMessageType, "child_frame_id"));
convertToBus(&busPtr->Header, &msgPtr->header);
convertToBus(&busPtr->Pose, &msgPtr->pose);
convertToBus(&busPtr->Twist, &msgPtr->twist);
}
// Conversions between SL_Bus_deadreckoning_ros_time_Time and ros::Time
void convertFromBus(ros::Time* msgPtr, SL_Bus_deadreckoning_ros_time_Time const* busPtr)
{
const std::string rosMessageType("ros_time/Time");
msgPtr->sec = busPtr->Sec;
msgPtr->nsec = busPtr->Nsec;
}
void convertToBus(SL_Bus_deadreckoning_ros_time_Time* busPtr, ros::Time const* msgPtr)
{
const std::string rosMessageType("ros_time/Time");
busPtr->Sec = msgPtr->sec;
busPtr->Nsec = msgPtr->nsec;
}
// Conversions between SL_Bus_deadreckoning_sensor_msgs_LaserScan and sensor_msgs::LaserScan
void convertFromBus(sensor_msgs::LaserScan* msgPtr, SL_Bus_deadreckoning_sensor_msgs_LaserScan const* busPtr)
{
const std::string rosMessageType("sensor_msgs/LaserScan");
msgPtr->angle_increment = busPtr->AngleIncrement;
msgPtr->angle_max = busPtr->AngleMax;
msgPtr->angle_min = busPtr->AngleMin;
convertFromBus(&msgPtr->header, &busPtr->Header);
convertFromBusVariablePrimitiveArray(msgPtr->intensities, busPtr->Intensities, busPtr->Intensities_SL_Info);
msgPtr->range_max = busPtr->RangeMax;
msgPtr->range_min = busPtr->RangeMin;
convertFromBusVariablePrimitiveArray(msgPtr->ranges, busPtr->Ranges, busPtr->Ranges_SL_Info);
msgPtr->scan_time = busPtr->ScanTime;
msgPtr->time_increment = busPtr->TimeIncrement;
}
void convertToBus(SL_Bus_deadreckoning_sensor_msgs_LaserScan* busPtr, sensor_msgs::LaserScan const* msgPtr)
{
const std::string rosMessageType("sensor_msgs/LaserScan");
busPtr->AngleIncrement = msgPtr->angle_increment;
busPtr->AngleMax = msgPtr->angle_max;
busPtr->AngleMin = msgPtr->angle_min;
convertToBus(&busPtr->Header, &msgPtr->header);
convertToBusVariablePrimitiveArray(busPtr->Intensities, busPtr->Intensities_SL_Info, msgPtr->intensities, slros::EnabledWarning(rosMessageType, "intensities"));
busPtr->RangeMax = msgPtr->range_max;
busPtr->RangeMin = msgPtr->range_min;
convertToBusVariablePrimitiveArray(busPtr->Ranges, busPtr->Ranges_SL_Info, msgPtr->ranges, slros::EnabledWarning(rosMessageType, "ranges"));
busPtr->ScanTime = msgPtr->scan_time;
busPtr->TimeIncrement = msgPtr->time_increment;
}
// Conversions between SL_Bus_deadreckoning_std_msgs_Header and std_msgs::Header
void convertFromBus(std_msgs::Header* msgPtr, SL_Bus_deadreckoning_std_msgs_Header const* busPtr)
{
const std::string rosMessageType("std_msgs/Header");
convertFromBusVariablePrimitiveArray(msgPtr->frame_id, busPtr->FrameId, busPtr->FrameId_SL_Info);
msgPtr->seq = busPtr->Seq;
convertFromBus(&msgPtr->stamp, &busPtr->Stamp);
}
void convertToBus(SL_Bus_deadreckoning_std_msgs_Header* busPtr, std_msgs::Header const* msgPtr)
{
const std::string rosMessageType("std_msgs/Header");
convertToBusVariablePrimitiveArray(busPtr->FrameId, busPtr->FrameId_SL_Info, msgPtr->frame_id, slros::EnabledWarning(rosMessageType, "frame_id"));
busPtr->Seq = msgPtr->seq;
convertToBus(&busPtr->Stamp, &msgPtr->stamp);
}