kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
ColorRGBA.h
Go to the documentation of this file.
1 #ifndef _ROS_std_msgs_ColorRGBA_h
2 #define _ROS_std_msgs_ColorRGBA_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace std_msgs
10 {
11 
12  class ColorRGBA : public ros::Msg
13  {
14  public:
15  float r;
16  float g;
17  float b;
18  float a;
19 
21  r(0),
22  g(0),
23  b(0),
24  a(0)
25  {
26  }
27 
28  virtual int serialize(unsigned char *outbuffer) const
29  {
30  int offset = 0;
31  union {
32  float real;
33  uint32_t base;
34  } u_r;
35  u_r.real = this->r;
36  *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF;
37  *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF;
38  *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF;
39  *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF;
40  offset += sizeof(this->r);
41  union {
42  float real;
43  uint32_t base;
44  } u_g;
45  u_g.real = this->g;
46  *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF;
47  *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF;
48  *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF;
49  *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF;
50  offset += sizeof(this->g);
51  union {
52  float real;
53  uint32_t base;
54  } u_b;
55  u_b.real = this->b;
56  *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF;
57  *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF;
58  *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF;
59  *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF;
60  offset += sizeof(this->b);
61  union {
62  float real;
63  uint32_t base;
64  } u_a;
65  u_a.real = this->a;
66  *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF;
67  *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF;
68  *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF;
69  *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF;
70  offset += sizeof(this->a);
71  return offset;
72  }
73 
74  virtual int deserialize(unsigned char *inbuffer)
75  {
76  int offset = 0;
77  union {
78  float real;
79  uint32_t base;
80  } u_r;
81  u_r.base = 0;
82  u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
83  u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
84  u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
85  u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
86  this->r = u_r.real;
87  offset += sizeof(this->r);
88  union {
89  float real;
90  uint32_t base;
91  } u_g;
92  u_g.base = 0;
93  u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
94  u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
95  u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
96  u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
97  this->g = u_g.real;
98  offset += sizeof(this->g);
99  union {
100  float real;
101  uint32_t base;
102  } u_b;
103  u_b.base = 0;
104  u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
105  u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
106  u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
107  u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
108  this->b = u_b.real;
109  offset += sizeof(this->b);
110  union {
111  float real;
112  uint32_t base;
113  } u_a;
114  u_a.base = 0;
115  u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
116  u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
117  u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
118  u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
119  this->a = u_a.real;
120  offset += sizeof(this->a);
121  return offset;
122  }
123 
124  const char * getType(){ return "std_msgs/ColorRGBA"; };
125  const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; };
126 
127  };
128 
129 }
130 #endif
float r
Definition: ColorRGBA.h:15
virtual int deserialize(unsigned char *inbuffer)
Definition: ColorRGBA.h:74
const char * getType()
Definition: ColorRGBA.h:124
virtual int serialize(unsigned char *outbuffer) const
Definition: ColorRGBA.h:28
ColorRGBA()
Definition: ColorRGBA.h:20
float b
Definition: ColorRGBA.h:17
const char * getMD5()
Definition: ColorRGBA.h:125
Definition: ColorRGBA.h:12
float a
Definition: ColorRGBA.h:18
float g
Definition: ColorRGBA.h:16
Definition: msg.h:43