kitt_platform
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros
GoalStatus.h
Go to the documentation of this file.
1 #ifndef _ROS_actionlib_msgs_GoalStatus_h
2 #define _ROS_actionlib_msgs_GoalStatus_h
3 
4 #include <stdint.h>
5 #include <string.h>
6 #include <stdlib.h>
7 #include "ros/msg.h"
9 
10 namespace actionlib_msgs
11 {
12 
13  class GoalStatus : public ros::Msg
14  {
15  public:
17  uint8_t status;
18  const char* text;
19  enum { PENDING = 0 };
20  enum { ACTIVE = 1 };
21  enum { PREEMPTED = 2 };
22  enum { SUCCEEDED = 3 };
23  enum { ABORTED = 4 };
24  enum { REJECTED = 5 };
25  enum { PREEMPTING = 6 };
26  enum { RECALLING = 7 };
27  enum { RECALLED = 8 };
28  enum { LOST = 9 };
29 
31  goal_id(),
32  status(0),
33  text("")
34  {
35  }
36 
37  virtual int serialize(unsigned char *outbuffer) const
38  {
39  int offset = 0;
40  offset += this->goal_id.serialize(outbuffer + offset);
41  *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF;
42  offset += sizeof(this->status);
43  uint32_t length_text = strlen(this->text);
44  memcpy(outbuffer + offset, &length_text, sizeof(uint32_t));
45  offset += 4;
46  memcpy(outbuffer + offset, this->text, length_text);
47  offset += length_text;
48  return offset;
49  }
50 
51  virtual int deserialize(unsigned char *inbuffer)
52  {
53  int offset = 0;
54  offset += this->goal_id.deserialize(inbuffer + offset);
55  this->status = ((uint8_t) (*(inbuffer + offset)));
56  offset += sizeof(this->status);
57  uint32_t length_text;
58  memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t));
59  offset += 4;
60  for(unsigned int k= offset; k< offset+length_text; ++k){
61  inbuffer[k-1]=inbuffer[k];
62  }
63  inbuffer[offset+length_text-1]=0;
64  this->text = (char *)(inbuffer + offset-1);
65  offset += length_text;
66  return offset;
67  }
68 
69  const char * getType(){ return "actionlib_msgs/GoalStatus"; };
70  const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; };
71 
72  };
73 
74 }
75 #endif
Definition: GoalStatus.h:23
Definition: GoalStatus.h:26
actionlib_msgs::GoalID goal_id
Definition: GoalStatus.h:16
virtual int deserialize(unsigned char *inbuffer)
Definition: GoalStatus.h:51
Definition: GoalStatus.h:22
Definition: GoalStatus.h:28
Definition: GoalID.h:13
Definition: GoalStatus.h:19
Definition: GoalStatus.h:13
uint8_t status
Definition: GoalStatus.h:17
const char * text
Definition: GoalStatus.h:18
Definition: GoalStatus.h:20
const char * getType()
Definition: GoalStatus.h:69
Definition: GoalStatus.h:21
virtual int serialize(unsigned char *outbuffer) const
Definition: GoalStatus.h:37
GoalStatus()
Definition: GoalStatus.h:30
Definition: GoalStatus.h:25
virtual int deserialize(unsigned char *inbuffer)
Definition: GoalID.h:46
const char * getMD5()
Definition: GoalStatus.h:70
Definition: msg.h:43
virtual int serialize(unsigned char *outbuffer) const
Definition: GoalID.h:25
Definition: GoalStatus.h:24
Definition: GoalStatus.h:27