ros melodic library with custom message

Dependents:   Robot_team1_QEI_Douglas Robot_team1

Committer:
scarter1
Date:
Wed Oct 30 14:59:49 2019 +0000
Revision:
0:020db18a476d
melodic library;

Who changed what in which revision?

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