TF2Error.h
Go to the documentation of this file.
00001 #ifndef _ROS_tf2_msgs_TF2Error_h
00002 #define _ROS_tf2_msgs_TF2Error_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace tf2_msgs
00010 {
00011 
00012   class TF2Error : public ros::Msg
00013   {
00014     public:
00015       uint8_t error;
00016       char * error_string;
00017       enum { NO_ERROR =  0 };
00018       enum { LOOKUP_ERROR =  1 };
00019       enum { CONNECTIVITY_ERROR =  2 };
00020       enum { EXTRAPOLATION_ERROR =  3 };
00021       enum { INVALID_ARGUMENT_ERROR =  4 };
00022       enum { TIMEOUT_ERROR =  5 };
00023       enum { TRANSFORM_ERROR =  6 };
00024 
00025     virtual int serialize(unsigned char *outbuffer) const
00026     {
00027       int offset = 0;
00028       *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF;
00029       offset += sizeof(this->error);
00030       uint32_t length_error_string = strlen( (const char*) this->error_string);
00031       memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t));
00032       offset += 4;
00033       memcpy(outbuffer + offset, this->error_string, length_error_string);
00034       offset += length_error_string;
00035       return offset;
00036     }
00037 
00038     virtual int deserialize(unsigned char *inbuffer)
00039     {
00040       int offset = 0;
00041       this->error =  ((uint8_t) (*(inbuffer + offset)));
00042       offset += sizeof(this->error);
00043       uint32_t length_error_string;
00044       memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t));
00045       offset += 4;
00046       for(unsigned int k= offset; k< offset+length_error_string; ++k){
00047           inbuffer[k-1]=inbuffer[k];
00048       }
00049       inbuffer[offset+length_error_string-1]=0;
00050       this->error_string = (char *)(inbuffer + offset-1);
00051       offset += length_error_string;
00052      return offset;
00053     }
00054 
00055     const char * getType(){ return "tf2_msgs/TF2Error"; };
00056     const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; };
00057 
00058   };
00059 
00060 }
00061 #endif


lizi_arduino
Author(s): RoboTiCan
autogenerated on Wed Aug 26 2015 12:24:23