Statistics
| Branch: | Revision:

root / quad2 / arduino / src / ros_lib / geometry_msgs / TransformStamped.h @ c1426757

History | View | Annotate | Download (1.67 KB)

1
#ifndef _ROS_geometry_msgs_TransformStamped_h
2
#define _ROS_geometry_msgs_TransformStamped_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
#include "geometry_msgs/Transform.h"
10

    
11
namespace geometry_msgs
12
{
13

    
14
  class TransformStamped : public ros::Msg
15
  {
16
    public:
17
      std_msgs::Header header;
18
      char * child_frame_id;
19
      geometry_msgs::Transform transform;
20

    
21
    virtual int serialize(unsigned char *outbuffer) const
22
    {
23
      int offset = 0;
24
      offset += this->header.serialize(outbuffer + offset);
25
      uint32_t * length_child_frame_id = (uint32_t *)(outbuffer + offset);
26
      *length_child_frame_id = strlen( (const char*) this->child_frame_id);
27
      offset += 4;
28
      memcpy(outbuffer + offset, this->child_frame_id, *length_child_frame_id);
29
      offset += *length_child_frame_id;
30
      offset += this->transform.serialize(outbuffer + offset);
31
      return offset;
32
    }
33

    
34
    virtual int deserialize(unsigned char *inbuffer)
35
    {
36
      int offset = 0;
37
      offset += this->header.deserialize(inbuffer + offset);
38
      uint32_t length_child_frame_id = *(uint32_t *)(inbuffer + offset);
39
      offset += 4;
40
      for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){
41
          inbuffer[k-1]=inbuffer[k];
42
      }
43
      inbuffer[offset+length_child_frame_id-1]=0;
44
      this->child_frame_id = (char *)(inbuffer + offset-1);
45
      offset += length_child_frame_id;
46
      offset += this->transform.deserialize(inbuffer + offset);
47
     return offset;
48
    }
49

    
50
    const char * getType(){ return "geometry_msgs/TransformStamped"; };
51
    const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; };
52

    
53
  };
54

    
55
}
56
#endif