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