kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Twist2D.h
Go to the documentation of this file.
1 #ifndef _ROS_kitt_nav_msgs_Twist2D_h
2 #define _ROS_kitt_nav_msgs_Twist2D_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
8 
9 namespace kitt_nav_msgs
10 {
11 
12  class Twist2D : public ros::Msg
13  {
14  public:
15  float vx;
16  float vy;
17  float vtheta;
18 
20  vx(0),
21  vy(0),
22  vtheta(0)
23  {
24  }
25 
26  virtual int serialize(unsigned char *outbuffer) const
27  {
28  int offset = 0;
29  offset += serializeAvrFloat64(outbuffer + offset, this->vx);
30  offset += serializeAvrFloat64(outbuffer + offset, this->vy);
31  offset += serializeAvrFloat64(outbuffer + offset, this->vtheta);
32  return offset;
33  }
34 
35  virtual int deserialize(unsigned char *inbuffer)
36  {
37  int offset = 0;
38  offset += deserializeAvrFloat64(inbuffer + offset, &(this->vx));
39  offset += deserializeAvrFloat64(inbuffer + offset, &(this->vy));
40  offset += deserializeAvrFloat64(inbuffer + offset, &(this->vtheta));
41  return offset;
42  }
43 
44  const char * getType(){ return "kitt_nav_msgs/Twist2D"; };
45  const char * getMD5(){ return "b78002d4ee4c60ed2705e4646260dfc6"; };
46 
47  };
48 
49 }
50 #endif
static int serializeAvrFloat64(unsigned char *outbuffer, const float f)
This tricky function handles promoting a 32bit float to a 64bit double, so that AVR can publish messa...
Definition: msg.h:62
const char * getType()
Definition: Twist2D.h:44
Definition: Twist2D.h:12
float vx
Definition: Twist2D.h:15
float vy
Definition: Twist2D.h:16
virtual int serialize(unsigned char *outbuffer) const
Definition: Twist2D.h:26
const char * getMD5()
Definition: Twist2D.h:45
Twist2D()
Definition: Twist2D.h:19
float vtheta
Definition: Twist2D.h:17
virtual int deserialize(unsigned char *inbuffer)
Definition: Twist2D.h:35
Definition: msg.h:43
static int deserializeAvrFloat64(const unsigned char *inbuffer, float *f)
This tricky function handles demoting a 64bit double to a 32bit float, so that AVR can understand mes...
Definition: msg.h:100