kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Quaternion.h
Go to the documentation of this file.
1 #ifndef _ROS_geometry_msgs_Quaternion_h
2 #define _ROS_geometry_msgs_Quaternion_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 Quaternion : public ros::Msg
13  {
14  public:
15  float x;
16  float y;
17  float z;
18  float w;
19 
21  x(0),
22  y(0),
23  z(0),
24  w(0)
25  {
26  }
27 
28  virtual int serialize(unsigned char *outbuffer) const
29  {
30  int offset = 0;
31  offset += serializeAvrFloat64(outbuffer + offset, this->x);
32  offset += serializeAvrFloat64(outbuffer + offset, this->y);
33  offset += serializeAvrFloat64(outbuffer + offset, this->z);
34  offset += serializeAvrFloat64(outbuffer + offset, this->w);
35  return offset;
36  }
37 
38  virtual int deserialize(unsigned char *inbuffer)
39  {
40  int offset = 0;
41  offset += deserializeAvrFloat64(inbuffer + offset, &(this->x));
42  offset += deserializeAvrFloat64(inbuffer + offset, &(this->y));
43  offset += deserializeAvrFloat64(inbuffer + offset, &(this->z));
44  offset += deserializeAvrFloat64(inbuffer + offset, &(this->w));
45  return offset;
46  }
47 
48  const char * getType(){ return "geometry_msgs/Quaternion"; };
49  const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; };
50 
51  };
52 
53 }
54 #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 * getMD5()
Definition: Quaternion.h:49
virtual int serialize(unsigned char *outbuffer) const
Definition: Quaternion.h:28
float x
Definition: Quaternion.h:15
float z
Definition: Quaternion.h:17
Quaternion()
Definition: Quaternion.h:20
float w
Definition: Quaternion.h:18
virtual int deserialize(unsigned char *inbuffer)
Definition: Quaternion.h:38
Definition: Quaternion.h:12
float y
Definition: Quaternion.h:16
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
const char * getType()
Definition: Quaternion.h:48