added 1 custom message

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Committer:
randalthor
Date:
Fri May 19 08:59:12 2017 +0000
Revision:
2:af816ffd33df
Parent:
0:9e9b7db60fd5
custom message mobile robot added for ITU cyber physical lab

Who changed what in which revision?

UserRevisionLine numberNew contents of line
garyservin 0:9e9b7db60fd5 1 #ifndef _ROS_actionlib_TestRequestGoal_h
garyservin 0:9e9b7db60fd5 2 #define _ROS_actionlib_TestRequestGoal_h
garyservin 0:9e9b7db60fd5 3
garyservin 0:9e9b7db60fd5 4 #include <stdint.h>
garyservin 0:9e9b7db60fd5 5 #include <string.h>
garyservin 0:9e9b7db60fd5 6 #include <stdlib.h>
garyservin 0:9e9b7db60fd5 7 #include "ros/msg.h"
garyservin 0:9e9b7db60fd5 8 #include "ros/duration.h"
garyservin 0:9e9b7db60fd5 9
garyservin 0:9e9b7db60fd5 10 namespace actionlib
garyservin 0:9e9b7db60fd5 11 {
garyservin 0:9e9b7db60fd5 12
garyservin 0:9e9b7db60fd5 13 class TestRequestGoal : public ros::Msg
garyservin 0:9e9b7db60fd5 14 {
garyservin 0:9e9b7db60fd5 15 public:
garyservin 0:9e9b7db60fd5 16 typedef int32_t _terminate_status_type;
garyservin 0:9e9b7db60fd5 17 _terminate_status_type terminate_status;
garyservin 0:9e9b7db60fd5 18 typedef bool _ignore_cancel_type;
garyservin 0:9e9b7db60fd5 19 _ignore_cancel_type ignore_cancel;
garyservin 0:9e9b7db60fd5 20 typedef const char* _result_text_type;
garyservin 0:9e9b7db60fd5 21 _result_text_type result_text;
garyservin 0:9e9b7db60fd5 22 typedef int32_t _the_result_type;
garyservin 0:9e9b7db60fd5 23 _the_result_type the_result;
garyservin 0:9e9b7db60fd5 24 typedef bool _is_simple_client_type;
garyservin 0:9e9b7db60fd5 25 _is_simple_client_type is_simple_client;
garyservin 0:9e9b7db60fd5 26 typedef ros::Duration _delay_accept_type;
garyservin 0:9e9b7db60fd5 27 _delay_accept_type delay_accept;
garyservin 0:9e9b7db60fd5 28 typedef ros::Duration _delay_terminate_type;
garyservin 0:9e9b7db60fd5 29 _delay_terminate_type delay_terminate;
garyservin 0:9e9b7db60fd5 30 typedef ros::Duration _pause_status_type;
garyservin 0:9e9b7db60fd5 31 _pause_status_type pause_status;
garyservin 0:9e9b7db60fd5 32 enum { TERMINATE_SUCCESS = 0 };
garyservin 0:9e9b7db60fd5 33 enum { TERMINATE_ABORTED = 1 };
garyservin 0:9e9b7db60fd5 34 enum { TERMINATE_REJECTED = 2 };
garyservin 0:9e9b7db60fd5 35 enum { TERMINATE_LOSE = 3 };
garyservin 0:9e9b7db60fd5 36 enum { TERMINATE_DROP = 4 };
garyservin 0:9e9b7db60fd5 37 enum { TERMINATE_EXCEPTION = 5 };
garyservin 0:9e9b7db60fd5 38
garyservin 0:9e9b7db60fd5 39 TestRequestGoal():
garyservin 0:9e9b7db60fd5 40 terminate_status(0),
garyservin 0:9e9b7db60fd5 41 ignore_cancel(0),
garyservin 0:9e9b7db60fd5 42 result_text(""),
garyservin 0:9e9b7db60fd5 43 the_result(0),
garyservin 0:9e9b7db60fd5 44 is_simple_client(0),
garyservin 0:9e9b7db60fd5 45 delay_accept(),
garyservin 0:9e9b7db60fd5 46 delay_terminate(),
garyservin 0:9e9b7db60fd5 47 pause_status()
garyservin 0:9e9b7db60fd5 48 {
garyservin 0:9e9b7db60fd5 49 }
garyservin 0:9e9b7db60fd5 50
garyservin 0:9e9b7db60fd5 51 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:9e9b7db60fd5 52 {
garyservin 0:9e9b7db60fd5 53 int offset = 0;
garyservin 0:9e9b7db60fd5 54 union {
garyservin 0:9e9b7db60fd5 55 int32_t real;
garyservin 0:9e9b7db60fd5 56 uint32_t base;
garyservin 0:9e9b7db60fd5 57 } u_terminate_status;
garyservin 0:9e9b7db60fd5 58 u_terminate_status.real = this->terminate_status;
garyservin 0:9e9b7db60fd5 59 *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 60 *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 61 *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 62 *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 63 offset += sizeof(this->terminate_status);
garyservin 0:9e9b7db60fd5 64 union {
garyservin 0:9e9b7db60fd5 65 bool real;
garyservin 0:9e9b7db60fd5 66 uint8_t base;
garyservin 0:9e9b7db60fd5 67 } u_ignore_cancel;
garyservin 0:9e9b7db60fd5 68 u_ignore_cancel.real = this->ignore_cancel;
garyservin 0:9e9b7db60fd5 69 *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 70 offset += sizeof(this->ignore_cancel);
garyservin 0:9e9b7db60fd5 71 uint32_t length_result_text = strlen(this->result_text);
garyservin 0:9e9b7db60fd5 72 varToArr(outbuffer + offset, length_result_text);
garyservin 0:9e9b7db60fd5 73 offset += 4;
garyservin 0:9e9b7db60fd5 74 memcpy(outbuffer + offset, this->result_text, length_result_text);
garyservin 0:9e9b7db60fd5 75 offset += length_result_text;
garyservin 0:9e9b7db60fd5 76 union {
garyservin 0:9e9b7db60fd5 77 int32_t real;
garyservin 0:9e9b7db60fd5 78 uint32_t base;
garyservin 0:9e9b7db60fd5 79 } u_the_result;
garyservin 0:9e9b7db60fd5 80 u_the_result.real = this->the_result;
garyservin 0:9e9b7db60fd5 81 *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 82 *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 83 *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 84 *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 85 offset += sizeof(this->the_result);
garyservin 0:9e9b7db60fd5 86 union {
garyservin 0:9e9b7db60fd5 87 bool real;
garyservin 0:9e9b7db60fd5 88 uint8_t base;
garyservin 0:9e9b7db60fd5 89 } u_is_simple_client;
garyservin 0:9e9b7db60fd5 90 u_is_simple_client.real = this->is_simple_client;
garyservin 0:9e9b7db60fd5 91 *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 92 offset += sizeof(this->is_simple_client);
garyservin 0:9e9b7db60fd5 93 *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 94 *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 95 *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 96 *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 97 offset += sizeof(this->delay_accept.sec);
garyservin 0:9e9b7db60fd5 98 *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 99 *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 100 *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 101 *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 102 offset += sizeof(this->delay_accept.nsec);
garyservin 0:9e9b7db60fd5 103 *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 104 *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 105 *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 106 *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 107 offset += sizeof(this->delay_terminate.sec);
garyservin 0:9e9b7db60fd5 108 *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 109 *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 110 *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 111 *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 112 offset += sizeof(this->delay_terminate.nsec);
garyservin 0:9e9b7db60fd5 113 *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 114 *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 115 *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 116 *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 117 offset += sizeof(this->pause_status.sec);
garyservin 0:9e9b7db60fd5 118 *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF;
garyservin 0:9e9b7db60fd5 119 *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF;
garyservin 0:9e9b7db60fd5 120 *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF;
garyservin 0:9e9b7db60fd5 121 *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF;
garyservin 0:9e9b7db60fd5 122 offset += sizeof(this->pause_status.nsec);
garyservin 0:9e9b7db60fd5 123 return offset;
garyservin 0:9e9b7db60fd5 124 }
garyservin 0:9e9b7db60fd5 125
garyservin 0:9e9b7db60fd5 126 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:9e9b7db60fd5 127 {
garyservin 0:9e9b7db60fd5 128 int offset = 0;
garyservin 0:9e9b7db60fd5 129 union {
garyservin 0:9e9b7db60fd5 130 int32_t real;
garyservin 0:9e9b7db60fd5 131 uint32_t base;
garyservin 0:9e9b7db60fd5 132 } u_terminate_status;
garyservin 0:9e9b7db60fd5 133 u_terminate_status.base = 0;
garyservin 0:9e9b7db60fd5 134 u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 135 u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 136 u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 137 u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 138 this->terminate_status = u_terminate_status.real;
garyservin 0:9e9b7db60fd5 139 offset += sizeof(this->terminate_status);
garyservin 0:9e9b7db60fd5 140 union {
garyservin 0:9e9b7db60fd5 141 bool real;
garyservin 0:9e9b7db60fd5 142 uint8_t base;
garyservin 0:9e9b7db60fd5 143 } u_ignore_cancel;
garyservin 0:9e9b7db60fd5 144 u_ignore_cancel.base = 0;
garyservin 0:9e9b7db60fd5 145 u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 146 this->ignore_cancel = u_ignore_cancel.real;
garyservin 0:9e9b7db60fd5 147 offset += sizeof(this->ignore_cancel);
garyservin 0:9e9b7db60fd5 148 uint32_t length_result_text;
garyservin 0:9e9b7db60fd5 149 arrToVar(length_result_text, (inbuffer + offset));
garyservin 0:9e9b7db60fd5 150 offset += 4;
garyservin 0:9e9b7db60fd5 151 for(unsigned int k= offset; k< offset+length_result_text; ++k){
garyservin 0:9e9b7db60fd5 152 inbuffer[k-1]=inbuffer[k];
garyservin 0:9e9b7db60fd5 153 }
garyservin 0:9e9b7db60fd5 154 inbuffer[offset+length_result_text-1]=0;
garyservin 0:9e9b7db60fd5 155 this->result_text = (char *)(inbuffer + offset-1);
garyservin 0:9e9b7db60fd5 156 offset += length_result_text;
garyservin 0:9e9b7db60fd5 157 union {
garyservin 0:9e9b7db60fd5 158 int32_t real;
garyservin 0:9e9b7db60fd5 159 uint32_t base;
garyservin 0:9e9b7db60fd5 160 } u_the_result;
garyservin 0:9e9b7db60fd5 161 u_the_result.base = 0;
garyservin 0:9e9b7db60fd5 162 u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 163 u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 164 u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 165 u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 166 this->the_result = u_the_result.real;
garyservin 0:9e9b7db60fd5 167 offset += sizeof(this->the_result);
garyservin 0:9e9b7db60fd5 168 union {
garyservin 0:9e9b7db60fd5 169 bool real;
garyservin 0:9e9b7db60fd5 170 uint8_t base;
garyservin 0:9e9b7db60fd5 171 } u_is_simple_client;
garyservin 0:9e9b7db60fd5 172 u_is_simple_client.base = 0;
garyservin 0:9e9b7db60fd5 173 u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:9e9b7db60fd5 174 this->is_simple_client = u_is_simple_client.real;
garyservin 0:9e9b7db60fd5 175 offset += sizeof(this->is_simple_client);
garyservin 0:9e9b7db60fd5 176 this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 177 this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 178 this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 179 this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 180 offset += sizeof(this->delay_accept.sec);
garyservin 0:9e9b7db60fd5 181 this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 182 this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 183 this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 184 this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 185 offset += sizeof(this->delay_accept.nsec);
garyservin 0:9e9b7db60fd5 186 this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 187 this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 188 this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 189 this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 190 offset += sizeof(this->delay_terminate.sec);
garyservin 0:9e9b7db60fd5 191 this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 192 this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 193 this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 194 this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 195 offset += sizeof(this->delay_terminate.nsec);
garyservin 0:9e9b7db60fd5 196 this->pause_status.sec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 197 this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 198 this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 199 this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 200 offset += sizeof(this->pause_status.sec);
garyservin 0:9e9b7db60fd5 201 this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:9e9b7db60fd5 202 this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:9e9b7db60fd5 203 this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:9e9b7db60fd5 204 this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:9e9b7db60fd5 205 offset += sizeof(this->pause_status.nsec);
garyservin 0:9e9b7db60fd5 206 return offset;
garyservin 0:9e9b7db60fd5 207 }
garyservin 0:9e9b7db60fd5 208
garyservin 0:9e9b7db60fd5 209 const char * getType(){ return "actionlib/TestRequestGoal"; };
garyservin 0:9e9b7db60fd5 210 const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; };
garyservin 0:9e9b7db60fd5 211
garyservin 0:9e9b7db60fd5 212 };
garyservin 0:9e9b7db60fd5 213
garyservin 0:9e9b7db60fd5 214 }
garyservin 0:9e9b7db60fd5 215 #endif