Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MultiArrayDimension.h
00001 #ifndef _ROS_std_msgs_MultiArrayDimension_h 00002 #define _ROS_std_msgs_MultiArrayDimension_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace std_msgs 00010 { 00011 00012 class MultiArrayDimension : public ros::Msg 00013 { 00014 public: 00015 typedef const char* _label_type; 00016 _label_type label; 00017 typedef uint32_t _size_type; 00018 _size_type size; 00019 typedef uint32_t _stride_type; 00020 _stride_type stride; 00021 00022 MultiArrayDimension(): 00023 label(""), 00024 size(0), 00025 stride(0) 00026 { 00027 } 00028 00029 virtual int serialize(unsigned char *outbuffer) const 00030 { 00031 int offset = 0; 00032 uint32_t length_label = strlen(this->label); 00033 varToArr(outbuffer + offset, length_label); 00034 offset += 4; 00035 memcpy(outbuffer + offset, this->label, length_label); 00036 offset += length_label; 00037 *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; 00038 *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; 00039 *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; 00040 *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; 00041 offset += sizeof(this->size); 00042 *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; 00043 *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; 00044 *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; 00045 *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; 00046 offset += sizeof(this->stride); 00047 return offset; 00048 } 00049 00050 virtual int deserialize(unsigned char *inbuffer) 00051 { 00052 int offset = 0; 00053 uint32_t length_label; 00054 arrToVar(length_label, (inbuffer + offset)); 00055 offset += 4; 00056 for(unsigned int k= offset; k< offset+length_label; ++k){ 00057 inbuffer[k-1]=inbuffer[k]; 00058 } 00059 inbuffer[offset+length_label-1]=0; 00060 this->label = (char *)(inbuffer + offset-1); 00061 offset += length_label; 00062 this->size = ((uint32_t) (*(inbuffer + offset))); 00063 this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00064 this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00065 this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00066 offset += sizeof(this->size); 00067 this->stride = ((uint32_t) (*(inbuffer + offset))); 00068 this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00069 this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00070 this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00071 offset += sizeof(this->stride); 00072 return offset; 00073 } 00074 00075 const char * getType(){ return "std_msgs/MultiArrayDimension"; }; 00076 const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; 00077 00078 }; 00079 00080 } 00081 #endif
Generated on Tue Jul 12 2022 17:32:44 by
