Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (1.62 KB)

1
#ifndef _ROS_geometry_msgs_PoseArray_h
2
#define _ROS_geometry_msgs_PoseArray_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/Pose.h"
10

    
11
namespace geometry_msgs
12
{
13

    
14
  class PoseArray : public ros::Msg
15
  {
16
    public:
17
      std_msgs::Header header;
18
      uint8_t poses_length;
19
      geometry_msgs::Pose st_poses;
20
      geometry_msgs::Pose * poses;
21

    
22
    virtual int serialize(unsigned char *outbuffer) const
23
    {
24
      int offset = 0;
25
      offset += this->header.serialize(outbuffer + offset);
26
      *(outbuffer + offset++) = poses_length;
27
      *(outbuffer + offset++) = 0;
28
      *(outbuffer + offset++) = 0;
29
      *(outbuffer + offset++) = 0;
30
      for( uint8_t i = 0; i < poses_length; i++){
31
      offset += this->poses[i].serialize(outbuffer + offset);
32
      }
33
      return offset;
34
    }
35

    
36
    virtual int deserialize(unsigned char *inbuffer)
37
    {
38
      int offset = 0;
39
      offset += this->header.deserialize(inbuffer + offset);
40
      uint8_t poses_lengthT = *(inbuffer + offset++);
41
      if(poses_lengthT > poses_length)
42
        this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose));
43
      offset += 3;
44
      poses_length = poses_lengthT;
45
      for( uint8_t i = 0; i < poses_length; i++){
46
      offset += this->st_poses.deserialize(inbuffer + offset);
47
        memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose));
48
      }
49
     return offset;
50
    }
51

    
52
    const char * getType(){ return "geometry_msgs/PoseArray"; };
53
    const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; };
54

    
55
  };
56

    
57
}
58
#endif