ROS Serial library for Mbed platforms for ROS Indigo Igloo. Check http://wiki.ros.org/rosserial_mbed/ for more information
Dependents: rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more
TF2Error.h
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 const 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 TF2Error(): 00026 error(0), 00027 error_string("") 00028 { 00029 } 00030 00031 virtual int serialize(unsigned char *outbuffer) const 00032 { 00033 int offset = 0; 00034 *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; 00035 offset += sizeof(this->error); 00036 uint32_t length_error_string = strlen(this->error_string); 00037 memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); 00038 offset += 4; 00039 memcpy(outbuffer + offset, this->error_string, length_error_string); 00040 offset += length_error_string; 00041 return offset; 00042 } 00043 00044 virtual int deserialize(unsigned char *inbuffer) 00045 { 00046 int offset = 0; 00047 this->error = ((uint8_t) (*(inbuffer + offset))); 00048 offset += sizeof(this->error); 00049 uint32_t length_error_string; 00050 memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); 00051 offset += 4; 00052 for(unsigned int k= offset; k< offset+length_error_string; ++k){ 00053 inbuffer[k-1]=inbuffer[k]; 00054 } 00055 inbuffer[offset+length_error_string-1]=0; 00056 this->error_string = (char *)(inbuffer + offset-1); 00057 offset += length_error_string; 00058 return offset; 00059 } 00060 00061 const char * getType(){ return "tf2_msgs/TF2Error"; }; 00062 const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; 00063 00064 }; 00065 00066 } 00067 #endif
Generated on Tue Jul 12 2022 18:39:41 by 1.7.2