kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
Path.h
Go to the documentation of this file.
1 #ifndef _ROS_nav_msgs_Path_h
2 #define _ROS_nav_msgs_Path_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"
10 
11 namespace nav_msgs
12 {
13 
14  class Path : public ros::Msg
15  {
16  public:
18  uint8_t poses_length;
21 
22  Path():
23  header(),
24  poses_length(0), poses(NULL)
25  {
26  }
27 
28  virtual int serialize(unsigned char *outbuffer) const
29  {
30  int offset = 0;
31  offset += this->header.serialize(outbuffer + offset);
32  *(outbuffer + offset++) = poses_length;
33  *(outbuffer + offset++) = 0;
34  *(outbuffer + offset++) = 0;
35  *(outbuffer + offset++) = 0;
36  for( uint8_t i = 0; i < poses_length; i++){
37  offset += this->poses[i].serialize(outbuffer + offset);
38  }
39  return offset;
40  }
41 
42  virtual int deserialize(unsigned char *inbuffer)
43  {
44  int offset = 0;
45  offset += this->header.deserialize(inbuffer + offset);
46  uint8_t poses_lengthT = *(inbuffer + offset++);
47  if(poses_lengthT > poses_length)
48  this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped));
49  offset += 3;
50  poses_length = poses_lengthT;
51  for( uint8_t i = 0; i < poses_length; i++){
52  offset += this->st_poses.deserialize(inbuffer + offset);
53  memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::PoseStamped));
54  }
55  return offset;
56  }
57 
58  const char * getType(){ return "nav_msgs/Path"; };
59  const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; };
60 
61  };
62 
63 }
64 #endif
virtual int deserialize(unsigned char *inbuffer)
Definition: Header.h:53
virtual int serialize(unsigned char *outbuffer) const
Definition: Path.h:28
uint8_t poses_length
Definition: Path.h:18
geometry_msgs::PoseStamped st_poses
Definition: Path.h:19
const char * getType()
Definition: Path.h:58
Path()
Definition: Path.h:22
const char * getMD5()
Definition: Path.h:59
virtual int serialize(unsigned char *outbuffer) const
Definition: Header.h:27
geometry_msgs::PoseStamped * poses
Definition: Path.h:20
virtual int deserialize(unsigned char *inbuffer)
Definition: Path.h:42
virtual int deserialize(unsigned char *inbuffer)
Definition: PoseStamped.h:34
Definition: PoseStamped.h:14
Definition: Header.h:13
std_msgs::Header header
Definition: Path.h:17
Definition: Path.h:14
virtual int serialize(unsigned char *outbuffer) const
Definition: PoseStamped.h:26
Definition: msg.h:43