root / quad2 / arduino / src / ros_lib / nav_msgs / GetPlan.h @ c1426757
History | View | Annotate | Download (2.59 KB)
1 | c1426757 | Tom Mullins | #ifndef _ROS_SERVICE_GetPlan_h
|
---|---|---|---|
2 | #define _ROS_SERVICE_GetPlan_h
|
||
3 | #include <stdint.h> |
||
4 | #include <string.h> |
||
5 | #include <stdlib.h> |
||
6 | #include "ros/msg.h" |
||
7 | #include "geometry_msgs/PoseStamped.h" |
||
8 | #include "nav_msgs/Path.h" |
||
9 | |||
10 | namespace nav_msgs |
||
11 | { |
||
12 | |||
13 | static const char GETPLAN[] = "nav_msgs/GetPlan"; |
||
14 | |||
15 | class GetPlanRequest : public ros::Msg |
||
16 | { |
||
17 | public:
|
||
18 | geometry_msgs::PoseStamped start; |
||
19 | geometry_msgs::PoseStamped goal; |
||
20 | float tolerance;
|
||
21 | |||
22 | virtual int serialize(unsigned char *outbuffer) const |
||
23 | { |
||
24 | int offset = 0; |
||
25 | offset += this->start.serialize(outbuffer + offset); |
||
26 | offset += this->goal.serialize(outbuffer + offset); |
||
27 | union {
|
||
28 | float real;
|
||
29 | uint32_t base; |
||
30 | } u_tolerance; |
||
31 | u_tolerance.real = this->tolerance; |
||
32 | *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; |
||
33 | *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; |
||
34 | *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; |
||
35 | *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; |
||
36 | offset += sizeof(this->tolerance);
|
||
37 | return offset;
|
||
38 | } |
||
39 | |||
40 | virtual int deserialize(unsigned char *inbuffer) |
||
41 | { |
||
42 | int offset = 0; |
||
43 | offset += this->start.deserialize(inbuffer + offset); |
||
44 | offset += this->goal.deserialize(inbuffer + offset); |
||
45 | union {
|
||
46 | float real;
|
||
47 | uint32_t base; |
||
48 | } u_tolerance; |
||
49 | u_tolerance.base = 0;
|
||
50 | u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
||
51 | u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
||
52 | u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
||
53 | u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
||
54 | this->tolerance = u_tolerance.real; |
||
55 | offset += sizeof(this->tolerance);
|
||
56 | return offset;
|
||
57 | } |
||
58 | |||
59 | const char * getType(){ return GETPLAN; }; |
||
60 | const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; |
||
61 | |||
62 | }; |
||
63 | |||
64 | class GetPlanResponse : public ros::Msg |
||
65 | { |
||
66 | public:
|
||
67 | nav_msgs::Path plan; |
||
68 | |||
69 | virtual int serialize(unsigned char *outbuffer) const |
||
70 | { |
||
71 | int offset = 0; |
||
72 | offset += this->plan.serialize(outbuffer + offset); |
||
73 | return offset;
|
||
74 | } |
||
75 | |||
76 | virtual int deserialize(unsigned char *inbuffer) |
||
77 | { |
||
78 | int offset = 0; |
||
79 | offset += this->plan.deserialize(inbuffer + offset); |
||
80 | return offset;
|
||
81 | } |
||
82 | |||
83 | const char * getType(){ return GETPLAN; }; |
||
84 | const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; |
||
85 | |||
86 | }; |
||
87 | |||
88 | class GetPlan { |
||
89 | public:
|
||
90 | typedef GetPlanRequest Request;
|
||
91 | typedef GetPlanResponse Response;
|
||
92 | }; |
||
93 | |||
94 | } |
||
95 | #endif |