-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathslros_busmsg_conversion.cpp
59 lines (40 loc) · 1.73 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
#include "slros_busmsg_conversion.h"
// Conversions between SL_Bus_obstacleStopper_geometry_msgs_Twist and geometry_msgs::Twist
void convertFromBus(geometry_msgs::Twist* msgPtr, SL_Bus_obstacleStopper_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_obstacleStopper_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_obstacleStopper_geometry_msgs_Vector3 and geometry_msgs::Vector3
void convertFromBus(geometry_msgs::Vector3* msgPtr, SL_Bus_obstacleStopper_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_obstacleStopper_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_obstacleStopper_std_msgs_Float32 and std_msgs::Float32
void convertFromBus(std_msgs::Float32* msgPtr, SL_Bus_obstacleStopper_std_msgs_Float32 const* busPtr)
{
const std::string rosMessageType("std_msgs/Float32");
msgPtr->data = busPtr->Data;
}
void convertToBus(SL_Bus_obstacleStopper_std_msgs_Float32* busPtr, std_msgs::Float32 const* msgPtr)
{
const std::string rosMessageType("std_msgs/Float32");
busPtr->Data = msgPtr->data;
}