kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Point32.h
Go to the documentation of this file.
1 #ifndef _ROS_geometry_msgs_Point32_h
2 #define _ROS_geometry_msgs_Point32_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace geometry_msgs
10 {
11 
12  class Point32 : public ros::Msg
13  {
14  public:
15  float x;
16  float y;
17  float z;
18 
20  x(0),
21  y(0),
22  z(0)
23  {
24  }
25 
26  virtual int serialize(unsigned char *outbuffer) const
27  {
28  int offset = 0;
29  union {
30  float real;
31  uint32_t base;
32  } u_x;
33  u_x.real = this->x;
34  *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF;
35  *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF;
36  *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF;
37  *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF;
38  offset += sizeof(this->x);
39  union {
40  float real;
41  uint32_t base;
42  } u_y;
43  u_y.real = this->y;
44  *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF;
45  *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF;
46  *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF;
47  *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF;
48  offset += sizeof(this->y);
49  union {
50  float real;
51  uint32_t base;
52  } u_z;
53  u_z.real = this->z;
54  *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF;
55  *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF;
56  *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF;
57  *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF;
58  offset += sizeof(this->z);
59  return offset;
60  }
61 
62  virtual int deserialize(unsigned char *inbuffer)
63  {
64  int offset = 0;
65  union {
66  float real;
67  uint32_t base;
68  } u_x;
69  u_x.base = 0;
70  u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
71  u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
72  u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
73  u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
74  this->x = u_x.real;
75  offset += sizeof(this->x);
76  union {
77  float real;
78  uint32_t base;
79  } u_y;
80  u_y.base = 0;
81  u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
82  u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
83  u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
84  u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
85  this->y = u_y.real;
86  offset += sizeof(this->y);
87  union {
88  float real;
89  uint32_t base;
90  } u_z;
91  u_z.base = 0;
92  u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
93  u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
94  u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
95  u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
96  this->z = u_z.real;
97  offset += sizeof(this->z);
98  return offset;
99  }
100 
101  const char * getType(){ return "geometry_msgs/Point32"; };
102  const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; };
103 
104  };
105 
106 }
107 #endif
Point32()
Definition: Point32.h:19
float x
Definition: Point32.h:15
virtual int serialize(unsigned char *outbuffer) const
Definition: Point32.h:26
virtual int deserialize(unsigned char *inbuffer)
Definition: Point32.h:62
const char * getType()
Definition: Point32.h:101
Definition: Point32.h:12
float z
Definition: Point32.h:17
const char * getMD5()
Definition: Point32.h:102
Definition: msg.h:43
float y
Definition: Point32.h:16