Gary Servin / ros_lib_indigo

Dependencies:   BufferedSerial

Dependents:   rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GoalStatus.h Source File

GoalStatus.h

00001 #ifndef _ROS_actionlib_msgs_GoalStatus_h
00002 #define _ROS_actionlib_msgs_GoalStatus_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "actionlib_msgs/GoalID.h"
00009 
00010 namespace actionlib_msgs
00011 {
00012 
00013   class GoalStatus : public ros::Msg
00014   {
00015     public:
00016       actionlib_msgs::GoalID goal_id;
00017       uint8_t status;
00018       const char* text;
00019       enum { PENDING =  0    };
00020       enum { ACTIVE =  1    };
00021       enum { PREEMPTED =  2    };
00022       enum { SUCCEEDED =  3    };
00023       enum { ABORTED =  4    };
00024       enum { REJECTED =  5    };
00025       enum { PREEMPTING =  6    };
00026       enum { RECALLING =  7    };
00027       enum { RECALLED =  8    };
00028       enum { LOST =  9    };
00029 
00030     GoalStatus():
00031       goal_id(),
00032       status(0),
00033       text("")
00034     {
00035     }
00036 
00037     virtual int serialize(unsigned char *outbuffer) const
00038     {
00039       int offset = 0;
00040       offset += this->goal_id.serialize(outbuffer + offset);
00041       *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF;
00042       offset += sizeof(this->status);
00043       uint32_t length_text = strlen(this->text);
00044       memcpy(outbuffer + offset, &length_text, sizeof(uint32_t));
00045       offset += 4;
00046       memcpy(outbuffer + offset, this->text, length_text);
00047       offset += length_text;
00048       return offset;
00049     }
00050 
00051     virtual int deserialize(unsigned char *inbuffer)
00052     {
00053       int offset = 0;
00054       offset += this->goal_id.deserialize(inbuffer + offset);
00055       this->status =  ((uint8_t) (*(inbuffer + offset)));
00056       offset += sizeof(this->status);
00057       uint32_t length_text;
00058       memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t));
00059       offset += 4;
00060       for(unsigned int k= offset; k< offset+length_text; ++k){
00061           inbuffer[k-1]=inbuffer[k];
00062       }
00063       inbuffer[offset+length_text-1]=0;
00064       this->text = (char *)(inbuffer + offset-1);
00065       offset += length_text;
00066      return offset;
00067     }
00068 
00069     const char * getType(){ return "actionlib_msgs/GoalStatus"; };
00070     const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; };
00071 
00072   };
00073 
00074 }
00075 #endif