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.
DoubleParameter.h
00001 #ifndef _ROS_dynamic_reconfigure_DoubleParameter_h 00002 #define _ROS_dynamic_reconfigure_DoubleParameter_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace dynamic_reconfigure 00010 { 00011 00012 class DoubleParameter : public ros::Msg 00013 { 00014 public: 00015 typedef const char* _name_type; 00016 _name_type name; 00017 typedef double _value_type; 00018 _value_type value; 00019 00020 DoubleParameter(): 00021 name(""), 00022 value(0) 00023 { 00024 } 00025 00026 virtual int serialize(unsigned char *outbuffer) const 00027 { 00028 int offset = 0; 00029 uint32_t length_name = strlen(this->name); 00030 varToArr(outbuffer + offset, length_name); 00031 offset += 4; 00032 memcpy(outbuffer + offset, this->name, length_name); 00033 offset += length_name; 00034 union { 00035 double real; 00036 uint64_t base; 00037 } u_value; 00038 u_value.real = this->value; 00039 *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; 00040 *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; 00041 *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; 00042 *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; 00043 *(outbuffer + offset + 4) = (u_value.base >> (8 * 4)) & 0xFF; 00044 *(outbuffer + offset + 5) = (u_value.base >> (8 * 5)) & 0xFF; 00045 *(outbuffer + offset + 6) = (u_value.base >> (8 * 6)) & 0xFF; 00046 *(outbuffer + offset + 7) = (u_value.base >> (8 * 7)) & 0xFF; 00047 offset += sizeof(this->value); 00048 return offset; 00049 } 00050 00051 virtual int deserialize(unsigned char *inbuffer) 00052 { 00053 int offset = 0; 00054 uint32_t length_name; 00055 arrToVar(length_name, (inbuffer + offset)); 00056 offset += 4; 00057 for(unsigned int k= offset; k< offset+length_name; ++k){ 00058 inbuffer[k-1]=inbuffer[k]; 00059 } 00060 inbuffer[offset+length_name-1]=0; 00061 this->name = (char *)(inbuffer + offset-1); 00062 offset += length_name; 00063 union { 00064 double real; 00065 uint64_t base; 00066 } u_value; 00067 u_value.base = 0; 00068 u_value.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00069 u_value.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00070 u_value.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00071 u_value.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00072 u_value.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00073 u_value.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00074 u_value.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00075 u_value.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00076 this->value = u_value.real; 00077 offset += sizeof(this->value); 00078 return offset; 00079 } 00080 00081 const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; 00082 const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; 00083 00084 }; 00085 00086 } 00087 #endif
Generated on Wed Jul 13 2022 23:30:17 by
