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


ric_mc
Author(s): RoboTiCan
autogenerated on Fri May 20 2016 03:48:56