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