catchrobo2022 mbed LPC1768 メインプログラム
Dependencies: mbed
DepthCalibrationParameter.h
00001 #ifndef _ROS_jsk_recognition_msgs_DepthCalibrationParameter_h 00002 #define _ROS_jsk_recognition_msgs_DepthCalibrationParameter_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 00009 namespace jsk_recognition_msgs 00010 { 00011 00012 class DepthCalibrationParameter : public ros::Msg 00013 { 00014 public: 00015 uint32_t coefficients2_length; 00016 typedef double _coefficients2_type; 00017 _coefficients2_type st_coefficients2; 00018 _coefficients2_type * coefficients2; 00019 uint32_t coefficients1_length; 00020 typedef double _coefficients1_type; 00021 _coefficients1_type st_coefficients1; 00022 _coefficients1_type * coefficients1; 00023 uint32_t coefficients0_length; 00024 typedef double _coefficients0_type; 00025 _coefficients0_type st_coefficients0; 00026 _coefficients0_type * coefficients0; 00027 typedef bool _use_abs_type; 00028 _use_abs_type use_abs; 00029 00030 DepthCalibrationParameter(): 00031 coefficients2_length(0), coefficients2(NULL), 00032 coefficients1_length(0), coefficients1(NULL), 00033 coefficients0_length(0), coefficients0(NULL), 00034 use_abs(0) 00035 { 00036 } 00037 00038 virtual int serialize(unsigned char *outbuffer) const 00039 { 00040 int offset = 0; 00041 *(outbuffer + offset + 0) = (this->coefficients2_length >> (8 * 0)) & 0xFF; 00042 *(outbuffer + offset + 1) = (this->coefficients2_length >> (8 * 1)) & 0xFF; 00043 *(outbuffer + offset + 2) = (this->coefficients2_length >> (8 * 2)) & 0xFF; 00044 *(outbuffer + offset + 3) = (this->coefficients2_length >> (8 * 3)) & 0xFF; 00045 offset += sizeof(this->coefficients2_length); 00046 for( uint32_t i = 0; i < coefficients2_length; i++){ 00047 union { 00048 double real; 00049 uint64_t base; 00050 } u_coefficients2i; 00051 u_coefficients2i.real = this->coefficients2[i]; 00052 *(outbuffer + offset + 0) = (u_coefficients2i.base >> (8 * 0)) & 0xFF; 00053 *(outbuffer + offset + 1) = (u_coefficients2i.base >> (8 * 1)) & 0xFF; 00054 *(outbuffer + offset + 2) = (u_coefficients2i.base >> (8 * 2)) & 0xFF; 00055 *(outbuffer + offset + 3) = (u_coefficients2i.base >> (8 * 3)) & 0xFF; 00056 *(outbuffer + offset + 4) = (u_coefficients2i.base >> (8 * 4)) & 0xFF; 00057 *(outbuffer + offset + 5) = (u_coefficients2i.base >> (8 * 5)) & 0xFF; 00058 *(outbuffer + offset + 6) = (u_coefficients2i.base >> (8 * 6)) & 0xFF; 00059 *(outbuffer + offset + 7) = (u_coefficients2i.base >> (8 * 7)) & 0xFF; 00060 offset += sizeof(this->coefficients2[i]); 00061 } 00062 *(outbuffer + offset + 0) = (this->coefficients1_length >> (8 * 0)) & 0xFF; 00063 *(outbuffer + offset + 1) = (this->coefficients1_length >> (8 * 1)) & 0xFF; 00064 *(outbuffer + offset + 2) = (this->coefficients1_length >> (8 * 2)) & 0xFF; 00065 *(outbuffer + offset + 3) = (this->coefficients1_length >> (8 * 3)) & 0xFF; 00066 offset += sizeof(this->coefficients1_length); 00067 for( uint32_t i = 0; i < coefficients1_length; i++){ 00068 union { 00069 double real; 00070 uint64_t base; 00071 } u_coefficients1i; 00072 u_coefficients1i.real = this->coefficients1[i]; 00073 *(outbuffer + offset + 0) = (u_coefficients1i.base >> (8 * 0)) & 0xFF; 00074 *(outbuffer + offset + 1) = (u_coefficients1i.base >> (8 * 1)) & 0xFF; 00075 *(outbuffer + offset + 2) = (u_coefficients1i.base >> (8 * 2)) & 0xFF; 00076 *(outbuffer + offset + 3) = (u_coefficients1i.base >> (8 * 3)) & 0xFF; 00077 *(outbuffer + offset + 4) = (u_coefficients1i.base >> (8 * 4)) & 0xFF; 00078 *(outbuffer + offset + 5) = (u_coefficients1i.base >> (8 * 5)) & 0xFF; 00079 *(outbuffer + offset + 6) = (u_coefficients1i.base >> (8 * 6)) & 0xFF; 00080 *(outbuffer + offset + 7) = (u_coefficients1i.base >> (8 * 7)) & 0xFF; 00081 offset += sizeof(this->coefficients1[i]); 00082 } 00083 *(outbuffer + offset + 0) = (this->coefficients0_length >> (8 * 0)) & 0xFF; 00084 *(outbuffer + offset + 1) = (this->coefficients0_length >> (8 * 1)) & 0xFF; 00085 *(outbuffer + offset + 2) = (this->coefficients0_length >> (8 * 2)) & 0xFF; 00086 *(outbuffer + offset + 3) = (this->coefficients0_length >> (8 * 3)) & 0xFF; 00087 offset += sizeof(this->coefficients0_length); 00088 for( uint32_t i = 0; i < coefficients0_length; i++){ 00089 union { 00090 double real; 00091 uint64_t base; 00092 } u_coefficients0i; 00093 u_coefficients0i.real = this->coefficients0[i]; 00094 *(outbuffer + offset + 0) = (u_coefficients0i.base >> (8 * 0)) & 0xFF; 00095 *(outbuffer + offset + 1) = (u_coefficients0i.base >> (8 * 1)) & 0xFF; 00096 *(outbuffer + offset + 2) = (u_coefficients0i.base >> (8 * 2)) & 0xFF; 00097 *(outbuffer + offset + 3) = (u_coefficients0i.base >> (8 * 3)) & 0xFF; 00098 *(outbuffer + offset + 4) = (u_coefficients0i.base >> (8 * 4)) & 0xFF; 00099 *(outbuffer + offset + 5) = (u_coefficients0i.base >> (8 * 5)) & 0xFF; 00100 *(outbuffer + offset + 6) = (u_coefficients0i.base >> (8 * 6)) & 0xFF; 00101 *(outbuffer + offset + 7) = (u_coefficients0i.base >> (8 * 7)) & 0xFF; 00102 offset += sizeof(this->coefficients0[i]); 00103 } 00104 union { 00105 bool real; 00106 uint8_t base; 00107 } u_use_abs; 00108 u_use_abs.real = this->use_abs; 00109 *(outbuffer + offset + 0) = (u_use_abs.base >> (8 * 0)) & 0xFF; 00110 offset += sizeof(this->use_abs); 00111 return offset; 00112 } 00113 00114 virtual int deserialize(unsigned char *inbuffer) 00115 { 00116 int offset = 0; 00117 uint32_t coefficients2_lengthT = ((uint32_t) (*(inbuffer + offset))); 00118 coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00119 coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00120 coefficients2_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00121 offset += sizeof(this->coefficients2_length); 00122 if(coefficients2_lengthT > coefficients2_length) 00123 this->coefficients2 = (double*)realloc(this->coefficients2, coefficients2_lengthT * sizeof(double)); 00124 coefficients2_length = coefficients2_lengthT; 00125 for( uint32_t i = 0; i < coefficients2_length; i++){ 00126 union { 00127 double real; 00128 uint64_t base; 00129 } u_st_coefficients2; 00130 u_st_coefficients2.base = 0; 00131 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00132 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00133 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00134 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00135 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00136 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00137 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00138 u_st_coefficients2.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00139 this->st_coefficients2 = u_st_coefficients2.real; 00140 offset += sizeof(this->st_coefficients2); 00141 memcpy( &(this->coefficients2[i]), &(this->st_coefficients2), sizeof(double)); 00142 } 00143 uint32_t coefficients1_lengthT = ((uint32_t) (*(inbuffer + offset))); 00144 coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00145 coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00146 coefficients1_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00147 offset += sizeof(this->coefficients1_length); 00148 if(coefficients1_lengthT > coefficients1_length) 00149 this->coefficients1 = (double*)realloc(this->coefficients1, coefficients1_lengthT * sizeof(double)); 00150 coefficients1_length = coefficients1_lengthT; 00151 for( uint32_t i = 0; i < coefficients1_length; i++){ 00152 union { 00153 double real; 00154 uint64_t base; 00155 } u_st_coefficients1; 00156 u_st_coefficients1.base = 0; 00157 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00158 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00159 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00160 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00161 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00162 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00163 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00164 u_st_coefficients1.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00165 this->st_coefficients1 = u_st_coefficients1.real; 00166 offset += sizeof(this->st_coefficients1); 00167 memcpy( &(this->coefficients1[i]), &(this->st_coefficients1), sizeof(double)); 00168 } 00169 uint32_t coefficients0_lengthT = ((uint32_t) (*(inbuffer + offset))); 00170 coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); 00171 coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); 00172 coefficients0_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); 00173 offset += sizeof(this->coefficients0_length); 00174 if(coefficients0_lengthT > coefficients0_length) 00175 this->coefficients0 = (double*)realloc(this->coefficients0, coefficients0_lengthT * sizeof(double)); 00176 coefficients0_length = coefficients0_lengthT; 00177 for( uint32_t i = 0; i < coefficients0_length; i++){ 00178 union { 00179 double real; 00180 uint64_t base; 00181 } u_st_coefficients0; 00182 u_st_coefficients0.base = 0; 00183 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); 00184 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); 00185 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); 00186 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); 00187 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); 00188 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); 00189 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); 00190 u_st_coefficients0.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); 00191 this->st_coefficients0 = u_st_coefficients0.real; 00192 offset += sizeof(this->st_coefficients0); 00193 memcpy( &(this->coefficients0[i]), &(this->st_coefficients0), sizeof(double)); 00194 } 00195 union { 00196 bool real; 00197 uint8_t base; 00198 } u_use_abs; 00199 u_use_abs.base = 0; 00200 u_use_abs.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); 00201 this->use_abs = u_use_abs.real; 00202 offset += sizeof(this->use_abs); 00203 return offset; 00204 } 00205 00206 virtual const char * getType(){ return "jsk_recognition_msgs/DepthCalibrationParameter"; }; 00207 virtual const char * getMD5(){ return "d8318983ee0a76ad66ecf4b504350888"; }; 00208 00209 }; 00210 00211 } 00212 #endif
Generated on Mon Sep 26 2022 13:47:00 by
1.7.2