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 TestRequestGoal.h Source File

TestRequestGoal.h

00001 #ifndef _ROS_actionlib_TestRequestGoal_h
00002 #define _ROS_actionlib_TestRequestGoal_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "ros/duration.h"
00009 
00010 namespace actionlib
00011 {
00012 
00013   class TestRequestGoal : public ros::Msg
00014   {
00015     public:
00016       int32_t terminate_status;
00017       bool ignore_cancel;
00018       const char* result_text;
00019       int32_t the_result;
00020       bool is_simple_client;
00021       ros::Duration delay_accept;
00022       ros::Duration delay_terminate;
00023       ros::Duration pause_status;
00024       enum { TERMINATE_SUCCESS =  0 };
00025       enum { TERMINATE_ABORTED =  1 };
00026       enum { TERMINATE_REJECTED =  2 };
00027       enum { TERMINATE_LOSE =  3 };
00028       enum { TERMINATE_DROP =  4 };
00029       enum { TERMINATE_EXCEPTION =  5 };
00030 
00031     TestRequestGoal():
00032       terminate_status(0),
00033       ignore_cancel(0),
00034       result_text(""),
00035       the_result(0),
00036       is_simple_client(0),
00037       delay_accept(),
00038       delay_terminate(),
00039       pause_status()
00040     {
00041     }
00042 
00043     virtual int serialize(unsigned char *outbuffer) const
00044     {
00045       int offset = 0;
00046       union {
00047         int32_t real;
00048         uint32_t base;
00049       } u_terminate_status;
00050       u_terminate_status.real = this->terminate_status;
00051       *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF;
00052       *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF;
00053       *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF;
00054       *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF;
00055       offset += sizeof(this->terminate_status);
00056       union {
00057         bool real;
00058         uint8_t base;
00059       } u_ignore_cancel;
00060       u_ignore_cancel.real = this->ignore_cancel;
00061       *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF;
00062       offset += sizeof(this->ignore_cancel);
00063       uint32_t length_result_text = strlen(this->result_text);
00064       memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t));
00065       offset += 4;
00066       memcpy(outbuffer + offset, this->result_text, length_result_text);
00067       offset += length_result_text;
00068       union {
00069         int32_t real;
00070         uint32_t base;
00071       } u_the_result;
00072       u_the_result.real = this->the_result;
00073       *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF;
00074       *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF;
00075       *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF;
00076       *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF;
00077       offset += sizeof(this->the_result);
00078       union {
00079         bool real;
00080         uint8_t base;
00081       } u_is_simple_client;
00082       u_is_simple_client.real = this->is_simple_client;
00083       *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF;
00084       offset += sizeof(this->is_simple_client);
00085       *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF;
00086       *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF;
00087       *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF;
00088       *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF;
00089       offset += sizeof(this->delay_accept.sec);
00090       *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF;
00091       *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF;
00092       *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF;
00093       *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF;
00094       offset += sizeof(this->delay_accept.nsec);
00095       *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF;
00096       *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF;
00097       *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF;
00098       *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF;
00099       offset += sizeof(this->delay_terminate.sec);
00100       *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF;
00101       *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF;
00102       *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF;
00103       *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF;
00104       offset += sizeof(this->delay_terminate.nsec);
00105       *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF;
00106       *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF;
00107       *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF;
00108       *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF;
00109       offset += sizeof(this->pause_status.sec);
00110       *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF;
00111       *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF;
00112       *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF;
00113       *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF;
00114       offset += sizeof(this->pause_status.nsec);
00115       return offset;
00116     }
00117 
00118     virtual int deserialize(unsigned char *inbuffer)
00119     {
00120       int offset = 0;
00121       union {
00122         int32_t real;
00123         uint32_t base;
00124       } u_terminate_status;
00125       u_terminate_status.base = 0;
00126       u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00127       u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00128       u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00129       u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00130       this->terminate_status = u_terminate_status.real;
00131       offset += sizeof(this->terminate_status);
00132       union {
00133         bool real;
00134         uint8_t base;
00135       } u_ignore_cancel;
00136       u_ignore_cancel.base = 0;
00137       u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00138       this->ignore_cancel = u_ignore_cancel.real;
00139       offset += sizeof(this->ignore_cancel);
00140       uint32_t length_result_text;
00141       memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t));
00142       offset += 4;
00143       for(unsigned int k= offset; k< offset+length_result_text; ++k){
00144           inbuffer[k-1]=inbuffer[k];
00145       }
00146       inbuffer[offset+length_result_text-1]=0;
00147       this->result_text = (char *)(inbuffer + offset-1);
00148       offset += length_result_text;
00149       union {
00150         int32_t real;
00151         uint32_t base;
00152       } u_the_result;
00153       u_the_result.base = 0;
00154       u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00155       u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00156       u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00157       u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00158       this->the_result = u_the_result.real;
00159       offset += sizeof(this->the_result);
00160       union {
00161         bool real;
00162         uint8_t base;
00163       } u_is_simple_client;
00164       u_is_simple_client.base = 0;
00165       u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00166       this->is_simple_client = u_is_simple_client.real;
00167       offset += sizeof(this->is_simple_client);
00168       this->delay_accept.sec =  ((uint32_t) (*(inbuffer + offset)));
00169       this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00170       this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00171       this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00172       offset += sizeof(this->delay_accept.sec);
00173       this->delay_accept.nsec =  ((uint32_t) (*(inbuffer + offset)));
00174       this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00175       this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00176       this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00177       offset += sizeof(this->delay_accept.nsec);
00178       this->delay_terminate.sec =  ((uint32_t) (*(inbuffer + offset)));
00179       this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00180       this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00181       this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00182       offset += sizeof(this->delay_terminate.sec);
00183       this->delay_terminate.nsec =  ((uint32_t) (*(inbuffer + offset)));
00184       this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00185       this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00186       this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00187       offset += sizeof(this->delay_terminate.nsec);
00188       this->pause_status.sec =  ((uint32_t) (*(inbuffer + offset)));
00189       this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00190       this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00191       this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00192       offset += sizeof(this->pause_status.sec);
00193       this->pause_status.nsec =  ((uint32_t) (*(inbuffer + offset)));
00194       this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00195       this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00196       this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00197       offset += sizeof(this->pause_status.nsec);
00198      return offset;
00199     }
00200 
00201     const char * getType(){ return "actionlib/TestRequestGoal"; };
00202     const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; };
00203 
00204   };
00205 
00206 }
00207 #endif