Go to the documentation of this file.00001 #ifndef _ROS_SERVICE_GetLinkProperties_h
00002 #define _ROS_SERVICE_GetLinkProperties_h
00003 #include <stdint.h>
00004 #include <string.h>
00005 #include <stdlib.h>
00006 #include "ros/msg.h"
00007 #include "geometry_msgs/Pose.h"
00008
00009 namespace gazebo_msgs
00010 {
00011
00012 static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties";
00013
00014 class GetLinkPropertiesRequest : public ros::Msg
00015 {
00016 public:
00017 const char* link_name;
00018
00019 virtual int serialize(unsigned char *outbuffer) const
00020 {
00021 int offset = 0;
00022 uint32_t length_link_name = strlen(this->link_name);
00023 memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t));
00024 offset += 4;
00025 memcpy(outbuffer + offset, this->link_name, length_link_name);
00026 offset += length_link_name;
00027 return offset;
00028 }
00029
00030 virtual int deserialize(unsigned char *inbuffer)
00031 {
00032 int offset = 0;
00033 uint32_t length_link_name;
00034 memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t));
00035 offset += 4;
00036 for(unsigned int k= offset; k< offset+length_link_name; ++k){
00037 inbuffer[k-1]=inbuffer[k];
00038 }
00039 inbuffer[offset+length_link_name-1]=0;
00040 this->link_name = (char *)(inbuffer + offset-1);
00041 offset += length_link_name;
00042 return offset;
00043 }
00044
00045 const char * getType(){ return GETLINKPROPERTIES; };
00046 const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; };
00047
00048 };
00049
00050 class GetLinkPropertiesResponse : public ros::Msg
00051 {
00052 public:
00053 geometry_msgs::Pose com;
00054 bool gravity_mode;
00055 float mass;
00056 float ixx;
00057 float ixy;
00058 float ixz;
00059 float iyy;
00060 float iyz;
00061 float izz;
00062 bool success;
00063 const char* status_message;
00064
00065 virtual int serialize(unsigned char *outbuffer) const
00066 {
00067 int offset = 0;
00068 offset += this->com.serialize(outbuffer + offset);
00069 union {
00070 bool real;
00071 uint8_t base;
00072 } u_gravity_mode;
00073 u_gravity_mode.real = this->gravity_mode;
00074 *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF;
00075 offset += sizeof(this->gravity_mode);
00076 int32_t * val_mass = (int32_t *) &(this->mass);
00077 int32_t exp_mass = (((*val_mass)>>23)&255);
00078 if(exp_mass != 0)
00079 exp_mass += 1023-127;
00080 int32_t sig_mass = *val_mass;
00081 *(outbuffer + offset++) = 0;
00082 *(outbuffer + offset++) = 0;
00083 *(outbuffer + offset++) = 0;
00084 *(outbuffer + offset++) = (sig_mass<<5) & 0xff;
00085 *(outbuffer + offset++) = (sig_mass>>3) & 0xff;
00086 *(outbuffer + offset++) = (sig_mass>>11) & 0xff;
00087 *(outbuffer + offset++) = ((exp_mass<<4) & 0xF0) | ((sig_mass>>19)&0x0F);
00088 *(outbuffer + offset++) = (exp_mass>>4) & 0x7F;
00089 if(this->mass < 0) *(outbuffer + offset -1) |= 0x80;
00090 int32_t * val_ixx = (int32_t *) &(this->ixx);
00091 int32_t exp_ixx = (((*val_ixx)>>23)&255);
00092 if(exp_ixx != 0)
00093 exp_ixx += 1023-127;
00094 int32_t sig_ixx = *val_ixx;
00095 *(outbuffer + offset++) = 0;
00096 *(outbuffer + offset++) = 0;
00097 *(outbuffer + offset++) = 0;
00098 *(outbuffer + offset++) = (sig_ixx<<5) & 0xff;
00099 *(outbuffer + offset++) = (sig_ixx>>3) & 0xff;
00100 *(outbuffer + offset++) = (sig_ixx>>11) & 0xff;
00101 *(outbuffer + offset++) = ((exp_ixx<<4) & 0xF0) | ((sig_ixx>>19)&0x0F);
00102 *(outbuffer + offset++) = (exp_ixx>>4) & 0x7F;
00103 if(this->ixx < 0) *(outbuffer + offset -1) |= 0x80;
00104 int32_t * val_ixy = (int32_t *) &(this->ixy);
00105 int32_t exp_ixy = (((*val_ixy)>>23)&255);
00106 if(exp_ixy != 0)
00107 exp_ixy += 1023-127;
00108 int32_t sig_ixy = *val_ixy;
00109 *(outbuffer + offset++) = 0;
00110 *(outbuffer + offset++) = 0;
00111 *(outbuffer + offset++) = 0;
00112 *(outbuffer + offset++) = (sig_ixy<<5) & 0xff;
00113 *(outbuffer + offset++) = (sig_ixy>>3) & 0xff;
00114 *(outbuffer + offset++) = (sig_ixy>>11) & 0xff;
00115 *(outbuffer + offset++) = ((exp_ixy<<4) & 0xF0) | ((sig_ixy>>19)&0x0F);
00116 *(outbuffer + offset++) = (exp_ixy>>4) & 0x7F;
00117 if(this->ixy < 0) *(outbuffer + offset -1) |= 0x80;
00118 int32_t * val_ixz = (int32_t *) &(this->ixz);
00119 int32_t exp_ixz = (((*val_ixz)>>23)&255);
00120 if(exp_ixz != 0)
00121 exp_ixz += 1023-127;
00122 int32_t sig_ixz = *val_ixz;
00123 *(outbuffer + offset++) = 0;
00124 *(outbuffer + offset++) = 0;
00125 *(outbuffer + offset++) = 0;
00126 *(outbuffer + offset++) = (sig_ixz<<5) & 0xff;
00127 *(outbuffer + offset++) = (sig_ixz>>3) & 0xff;
00128 *(outbuffer + offset++) = (sig_ixz>>11) & 0xff;
00129 *(outbuffer + offset++) = ((exp_ixz<<4) & 0xF0) | ((sig_ixz>>19)&0x0F);
00130 *(outbuffer + offset++) = (exp_ixz>>4) & 0x7F;
00131 if(this->ixz < 0) *(outbuffer + offset -1) |= 0x80;
00132 int32_t * val_iyy = (int32_t *) &(this->iyy);
00133 int32_t exp_iyy = (((*val_iyy)>>23)&255);
00134 if(exp_iyy != 0)
00135 exp_iyy += 1023-127;
00136 int32_t sig_iyy = *val_iyy;
00137 *(outbuffer + offset++) = 0;
00138 *(outbuffer + offset++) = 0;
00139 *(outbuffer + offset++) = 0;
00140 *(outbuffer + offset++) = (sig_iyy<<5) & 0xff;
00141 *(outbuffer + offset++) = (sig_iyy>>3) & 0xff;
00142 *(outbuffer + offset++) = (sig_iyy>>11) & 0xff;
00143 *(outbuffer + offset++) = ((exp_iyy<<4) & 0xF0) | ((sig_iyy>>19)&0x0F);
00144 *(outbuffer + offset++) = (exp_iyy>>4) & 0x7F;
00145 if(this->iyy < 0) *(outbuffer + offset -1) |= 0x80;
00146 int32_t * val_iyz = (int32_t *) &(this->iyz);
00147 int32_t exp_iyz = (((*val_iyz)>>23)&255);
00148 if(exp_iyz != 0)
00149 exp_iyz += 1023-127;
00150 int32_t sig_iyz = *val_iyz;
00151 *(outbuffer + offset++) = 0;
00152 *(outbuffer + offset++) = 0;
00153 *(outbuffer + offset++) = 0;
00154 *(outbuffer + offset++) = (sig_iyz<<5) & 0xff;
00155 *(outbuffer + offset++) = (sig_iyz>>3) & 0xff;
00156 *(outbuffer + offset++) = (sig_iyz>>11) & 0xff;
00157 *(outbuffer + offset++) = ((exp_iyz<<4) & 0xF0) | ((sig_iyz>>19)&0x0F);
00158 *(outbuffer + offset++) = (exp_iyz>>4) & 0x7F;
00159 if(this->iyz < 0) *(outbuffer + offset -1) |= 0x80;
00160 int32_t * val_izz = (int32_t *) &(this->izz);
00161 int32_t exp_izz = (((*val_izz)>>23)&255);
00162 if(exp_izz != 0)
00163 exp_izz += 1023-127;
00164 int32_t sig_izz = *val_izz;
00165 *(outbuffer + offset++) = 0;
00166 *(outbuffer + offset++) = 0;
00167 *(outbuffer + offset++) = 0;
00168 *(outbuffer + offset++) = (sig_izz<<5) & 0xff;
00169 *(outbuffer + offset++) = (sig_izz>>3) & 0xff;
00170 *(outbuffer + offset++) = (sig_izz>>11) & 0xff;
00171 *(outbuffer + offset++) = ((exp_izz<<4) & 0xF0) | ((sig_izz>>19)&0x0F);
00172 *(outbuffer + offset++) = (exp_izz>>4) & 0x7F;
00173 if(this->izz < 0) *(outbuffer + offset -1) |= 0x80;
00174 union {
00175 bool real;
00176 uint8_t base;
00177 } u_success;
00178 u_success.real = this->success;
00179 *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
00180 offset += sizeof(this->success);
00181 uint32_t length_status_message = strlen(this->status_message);
00182 memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t));
00183 offset += 4;
00184 memcpy(outbuffer + offset, this->status_message, length_status_message);
00185 offset += length_status_message;
00186 return offset;
00187 }
00188
00189 virtual int deserialize(unsigned char *inbuffer)
00190 {
00191 int offset = 0;
00192 offset += this->com.deserialize(inbuffer + offset);
00193 union {
00194 bool real;
00195 uint8_t base;
00196 } u_gravity_mode;
00197 u_gravity_mode.base = 0;
00198 u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00199 this->gravity_mode = u_gravity_mode.real;
00200 offset += sizeof(this->gravity_mode);
00201 uint32_t * val_mass = (uint32_t*) &(this->mass);
00202 offset += 3;
00203 *val_mass = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00204 *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00205 *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00206 *val_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00207 uint32_t exp_mass = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00208 exp_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00209 if(exp_mass !=0)
00210 *val_mass |= ((exp_mass)-1023+127)<<23;
00211 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->mass = -this->mass;
00212 uint32_t * val_ixx = (uint32_t*) &(this->ixx);
00213 offset += 3;
00214 *val_ixx = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00215 *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00216 *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00217 *val_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00218 uint32_t exp_ixx = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00219 exp_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00220 if(exp_ixx !=0)
00221 *val_ixx |= ((exp_ixx)-1023+127)<<23;
00222 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixx = -this->ixx;
00223 uint32_t * val_ixy = (uint32_t*) &(this->ixy);
00224 offset += 3;
00225 *val_ixy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00226 *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00227 *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00228 *val_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00229 uint32_t exp_ixy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00230 exp_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00231 if(exp_ixy !=0)
00232 *val_ixy |= ((exp_ixy)-1023+127)<<23;
00233 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixy = -this->ixy;
00234 uint32_t * val_ixz = (uint32_t*) &(this->ixz);
00235 offset += 3;
00236 *val_ixz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00237 *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00238 *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00239 *val_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00240 uint32_t exp_ixz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00241 exp_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00242 if(exp_ixz !=0)
00243 *val_ixz |= ((exp_ixz)-1023+127)<<23;
00244 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixz = -this->ixz;
00245 uint32_t * val_iyy = (uint32_t*) &(this->iyy);
00246 offset += 3;
00247 *val_iyy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00248 *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00249 *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00250 *val_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00251 uint32_t exp_iyy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00252 exp_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00253 if(exp_iyy !=0)
00254 *val_iyy |= ((exp_iyy)-1023+127)<<23;
00255 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyy = -this->iyy;
00256 uint32_t * val_iyz = (uint32_t*) &(this->iyz);
00257 offset += 3;
00258 *val_iyz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00259 *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00260 *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00261 *val_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00262 uint32_t exp_iyz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00263 exp_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00264 if(exp_iyz !=0)
00265 *val_iyz |= ((exp_iyz)-1023+127)<<23;
00266 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyz = -this->iyz;
00267 uint32_t * val_izz = (uint32_t*) &(this->izz);
00268 offset += 3;
00269 *val_izz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00270 *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00271 *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00272 *val_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00273 uint32_t exp_izz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00274 exp_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00275 if(exp_izz !=0)
00276 *val_izz |= ((exp_izz)-1023+127)<<23;
00277 if( ((*(inbuffer+offset++)) & 0x80) > 0) this->izz = -this->izz;
00278 union {
00279 bool real;
00280 uint8_t base;
00281 } u_success;
00282 u_success.base = 0;
00283 u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00284 this->success = u_success.real;
00285 offset += sizeof(this->success);
00286 uint32_t length_status_message;
00287 memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t));
00288 offset += 4;
00289 for(unsigned int k= offset; k< offset+length_status_message; ++k){
00290 inbuffer[k-1]=inbuffer[k];
00291 }
00292 inbuffer[offset+length_status_message-1]=0;
00293 this->status_message = (char *)(inbuffer + offset-1);
00294 offset += length_status_message;
00295 return offset;
00296 }
00297
00298 const char * getType(){ return GETLINKPROPERTIES; };
00299 const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; };
00300
00301 };
00302
00303 class GetLinkProperties {
00304 public:
00305 typedef GetLinkPropertiesRequest Request;
00306 typedef GetLinkPropertiesResponse Response;
00307 };
00308
00309 }
00310 #endif