Skip to content

Commit 4c86f3d

Browse files
authored
Add files via upload
1 parent 8a72e65 commit 4c86f3d

File tree

4 files changed

+869
-0
lines changed

4 files changed

+869
-0
lines changed

headers/arc.h

+225
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
#ifndef _ROS_SERVICE_arc_h
2+
#define _ROS_SERVICE_arc_h
3+
#include <stdint.h>
4+
#include <string.h>
5+
#include <stdlib.h>
6+
#include "ros/msg.h"
7+
8+
namespace headers
9+
{
10+
11+
static const char ARC[] = "headers/arc";
12+
13+
class arcRequest : public ros::Msg
14+
{
15+
public:
16+
double rg;
17+
double arcl;
18+
19+
arcRequest():
20+
rg(0),
21+
arcl(0)
22+
{
23+
}
24+
25+
virtual int serialize(unsigned char *outbuffer) const
26+
{
27+
int offset = 0;
28+
union {
29+
double real;
30+
uint64_t base;
31+
} u_rg;
32+
u_rg.real = this->rg;
33+
*(outbuffer + offset + 0) = (u_rg.base >> (8 * 0)) & 0xFF;
34+
*(outbuffer + offset + 1) = (u_rg.base >> (8 * 1)) & 0xFF;
35+
*(outbuffer + offset + 2) = (u_rg.base >> (8 * 2)) & 0xFF;
36+
*(outbuffer + offset + 3) = (u_rg.base >> (8 * 3)) & 0xFF;
37+
*(outbuffer + offset + 4) = (u_rg.base >> (8 * 4)) & 0xFF;
38+
*(outbuffer + offset + 5) = (u_rg.base >> (8 * 5)) & 0xFF;
39+
*(outbuffer + offset + 6) = (u_rg.base >> (8 * 6)) & 0xFF;
40+
*(outbuffer + offset + 7) = (u_rg.base >> (8 * 7)) & 0xFF;
41+
offset += sizeof(this->rg);
42+
union {
43+
double real;
44+
uint64_t base;
45+
} u_arcl;
46+
u_arcl.real = this->arcl;
47+
*(outbuffer + offset + 0) = (u_arcl.base >> (8 * 0)) & 0xFF;
48+
*(outbuffer + offset + 1) = (u_arcl.base >> (8 * 1)) & 0xFF;
49+
*(outbuffer + offset + 2) = (u_arcl.base >> (8 * 2)) & 0xFF;
50+
*(outbuffer + offset + 3) = (u_arcl.base >> (8 * 3)) & 0xFF;
51+
*(outbuffer + offset + 4) = (u_arcl.base >> (8 * 4)) & 0xFF;
52+
*(outbuffer + offset + 5) = (u_arcl.base >> (8 * 5)) & 0xFF;
53+
*(outbuffer + offset + 6) = (u_arcl.base >> (8 * 6)) & 0xFF;
54+
*(outbuffer + offset + 7) = (u_arcl.base >> (8 * 7)) & 0xFF;
55+
offset += sizeof(this->arcl);
56+
return offset;
57+
}
58+
59+
virtual int deserialize(unsigned char *inbuffer)
60+
{
61+
int offset = 0;
62+
union {
63+
double real;
64+
uint64_t base;
65+
} u_rg;
66+
u_rg.base = 0;
67+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
68+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
69+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
70+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
71+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
72+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
73+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
74+
u_rg.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
75+
this->rg = u_rg.real;
76+
offset += sizeof(this->rg);
77+
union {
78+
double real;
79+
uint64_t base;
80+
} u_arcl;
81+
u_arcl.base = 0;
82+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
83+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
84+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
85+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
86+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
87+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
88+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
89+
u_arcl.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
90+
this->arcl = u_arcl.real;
91+
offset += sizeof(this->arcl);
92+
return offset;
93+
}
94+
95+
const char * getType(){ return ARC; };
96+
const char * getMD5(){ return "5e33bda32ab3d20bdfe1aadf5e3578e1"; };
97+
98+
};
99+
100+
class arcResponse : public ros::Msg
101+
{
102+
public:
103+
double x;
104+
double y;
105+
double tc;
106+
107+
arcResponse():
108+
x(0),
109+
y(0),
110+
tc(0)
111+
{
112+
}
113+
114+
virtual int serialize(unsigned char *outbuffer) const
115+
{
116+
int offset = 0;
117+
union {
118+
double real;
119+
uint64_t base;
120+
} u_x;
121+
u_x.real = this->x;
122+
*(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
123+
*(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
124+
*(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
125+
*(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
126+
*(outbuffer + offset + 4) = (u_x.base >> (8 * 4)) & 0xFF;
127+
*(outbuffer + offset + 5) = (u_x.base >> (8 * 5)) & 0xFF;
128+
*(outbuffer + offset + 6) = (u_x.base >> (8 * 6)) & 0xFF;
129+
*(outbuffer + offset + 7) = (u_x.base >> (8 * 7)) & 0xFF;
130+
offset += sizeof(this->x);
131+
union {
132+
double real;
133+
uint64_t base;
134+
} u_y;
135+
u_y.real = this->y;
136+
*(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
137+
*(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
138+
*(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
139+
*(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
140+
*(outbuffer + offset + 4) = (u_y.base >> (8 * 4)) & 0xFF;
141+
*(outbuffer + offset + 5) = (u_y.base >> (8 * 5)) & 0xFF;
142+
*(outbuffer + offset + 6) = (u_y.base >> (8 * 6)) & 0xFF;
143+
*(outbuffer + offset + 7) = (u_y.base >> (8 * 7)) & 0xFF;
144+
offset += sizeof(this->y);
145+
union {
146+
double real;
147+
uint64_t base;
148+
} u_tc;
149+
u_tc.real = this->tc;
150+
*(outbuffer + offset + 0) = (u_tc.base >> (8 * 0)) & 0xFF;
151+
*(outbuffer + offset + 1) = (u_tc.base >> (8 * 1)) & 0xFF;
152+
*(outbuffer + offset + 2) = (u_tc.base >> (8 * 2)) & 0xFF;
153+
*(outbuffer + offset + 3) = (u_tc.base >> (8 * 3)) & 0xFF;
154+
*(outbuffer + offset + 4) = (u_tc.base >> (8 * 4)) & 0xFF;
155+
*(outbuffer + offset + 5) = (u_tc.base >> (8 * 5)) & 0xFF;
156+
*(outbuffer + offset + 6) = (u_tc.base >> (8 * 6)) & 0xFF;
157+
*(outbuffer + offset + 7) = (u_tc.base >> (8 * 7)) & 0xFF;
158+
offset += sizeof(this->tc);
159+
return offset;
160+
}
161+
162+
virtual int deserialize(unsigned char *inbuffer)
163+
{
164+
int offset = 0;
165+
union {
166+
double real;
167+
uint64_t base;
168+
} u_x;
169+
u_x.base = 0;
170+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
171+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
172+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
173+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
174+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
175+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
176+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
177+
u_x.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
178+
this->x = u_x.real;
179+
offset += sizeof(this->x);
180+
union {
181+
double real;
182+
uint64_t base;
183+
} u_y;
184+
u_y.base = 0;
185+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
186+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
187+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
188+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
189+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
190+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
191+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
192+
u_y.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
193+
this->y = u_y.real;
194+
offset += sizeof(this->y);
195+
union {
196+
double real;
197+
uint64_t base;
198+
} u_tc;
199+
u_tc.base = 0;
200+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
201+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
202+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
203+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
204+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
205+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
206+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
207+
u_tc.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
208+
this->tc = u_tc.real;
209+
offset += sizeof(this->tc);
210+
return offset;
211+
}
212+
213+
const char * getType(){ return ARC; };
214+
const char * getMD5(){ return "84e4f6eadb78eb0d756b2a3e47fcc7ac"; };
215+
216+
};
217+
218+
class arc {
219+
public:
220+
typedef arcRequest Request;
221+
typedef arcResponse Response;
222+
};
223+
224+
}
225+
#endif

0 commit comments

Comments
 (0)