ODEPhysics.h
Go to the documentation of this file.
00001 #ifndef _ROS_gazebo_msgs_ODEPhysics_h
00002 #define _ROS_gazebo_msgs_ODEPhysics_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 
00009 namespace gazebo_msgs
00010 {
00011 
00012   class ODEPhysics : public ros::Msg
00013   {
00014     public:
00015       bool auto_disable_bodies;
00016       uint32_t sor_pgs_precon_iters;
00017       uint32_t sor_pgs_iters;
00018       float sor_pgs_w;
00019       float sor_pgs_rms_error_tol;
00020       float contact_surface_layer;
00021       float contact_max_correcting_vel;
00022       float cfm;
00023       float erp;
00024       uint32_t max_contacts;
00025 
00026     virtual int serialize(unsigned char *outbuffer) const
00027     {
00028       int offset = 0;
00029       union {
00030         bool real;
00031         uint8_t base;
00032       } u_auto_disable_bodies;
00033       u_auto_disable_bodies.real = this->auto_disable_bodies;
00034       *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF;
00035       offset += sizeof(this->auto_disable_bodies);
00036       *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF;
00037       *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF;
00038       *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF;
00039       *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF;
00040       offset += sizeof(this->sor_pgs_precon_iters);
00041       *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF;
00042       *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF;
00043       *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF;
00044       *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF;
00045       offset += sizeof(this->sor_pgs_iters);
00046       int32_t * val_sor_pgs_w = (int32_t *) &(this->sor_pgs_w);
00047       int32_t exp_sor_pgs_w = (((*val_sor_pgs_w)>>23)&255);
00048       if(exp_sor_pgs_w != 0)
00049         exp_sor_pgs_w += 1023-127;
00050       int32_t sig_sor_pgs_w = *val_sor_pgs_w;
00051       *(outbuffer + offset++) = 0;
00052       *(outbuffer + offset++) = 0;
00053       *(outbuffer + offset++) = 0;
00054       *(outbuffer + offset++) = (sig_sor_pgs_w<<5) & 0xff;
00055       *(outbuffer + offset++) = (sig_sor_pgs_w>>3) & 0xff;
00056       *(outbuffer + offset++) = (sig_sor_pgs_w>>11) & 0xff;
00057       *(outbuffer + offset++) = ((exp_sor_pgs_w<<4) & 0xF0) | ((sig_sor_pgs_w>>19)&0x0F);
00058       *(outbuffer + offset++) = (exp_sor_pgs_w>>4) & 0x7F;
00059       if(this->sor_pgs_w < 0) *(outbuffer + offset -1) |= 0x80;
00060       int32_t * val_sor_pgs_rms_error_tol = (int32_t *) &(this->sor_pgs_rms_error_tol);
00061       int32_t exp_sor_pgs_rms_error_tol = (((*val_sor_pgs_rms_error_tol)>>23)&255);
00062       if(exp_sor_pgs_rms_error_tol != 0)
00063         exp_sor_pgs_rms_error_tol += 1023-127;
00064       int32_t sig_sor_pgs_rms_error_tol = *val_sor_pgs_rms_error_tol;
00065       *(outbuffer + offset++) = 0;
00066       *(outbuffer + offset++) = 0;
00067       *(outbuffer + offset++) = 0;
00068       *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol<<5) & 0xff;
00069       *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol>>3) & 0xff;
00070       *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol>>11) & 0xff;
00071       *(outbuffer + offset++) = ((exp_sor_pgs_rms_error_tol<<4) & 0xF0) | ((sig_sor_pgs_rms_error_tol>>19)&0x0F);
00072       *(outbuffer + offset++) = (exp_sor_pgs_rms_error_tol>>4) & 0x7F;
00073       if(this->sor_pgs_rms_error_tol < 0) *(outbuffer + offset -1) |= 0x80;
00074       int32_t * val_contact_surface_layer = (int32_t *) &(this->contact_surface_layer);
00075       int32_t exp_contact_surface_layer = (((*val_contact_surface_layer)>>23)&255);
00076       if(exp_contact_surface_layer != 0)
00077         exp_contact_surface_layer += 1023-127;
00078       int32_t sig_contact_surface_layer = *val_contact_surface_layer;
00079       *(outbuffer + offset++) = 0;
00080       *(outbuffer + offset++) = 0;
00081       *(outbuffer + offset++) = 0;
00082       *(outbuffer + offset++) = (sig_contact_surface_layer<<5) & 0xff;
00083       *(outbuffer + offset++) = (sig_contact_surface_layer>>3) & 0xff;
00084       *(outbuffer + offset++) = (sig_contact_surface_layer>>11) & 0xff;
00085       *(outbuffer + offset++) = ((exp_contact_surface_layer<<4) & 0xF0) | ((sig_contact_surface_layer>>19)&0x0F);
00086       *(outbuffer + offset++) = (exp_contact_surface_layer>>4) & 0x7F;
00087       if(this->contact_surface_layer < 0) *(outbuffer + offset -1) |= 0x80;
00088       int32_t * val_contact_max_correcting_vel = (int32_t *) &(this->contact_max_correcting_vel);
00089       int32_t exp_contact_max_correcting_vel = (((*val_contact_max_correcting_vel)>>23)&255);
00090       if(exp_contact_max_correcting_vel != 0)
00091         exp_contact_max_correcting_vel += 1023-127;
00092       int32_t sig_contact_max_correcting_vel = *val_contact_max_correcting_vel;
00093       *(outbuffer + offset++) = 0;
00094       *(outbuffer + offset++) = 0;
00095       *(outbuffer + offset++) = 0;
00096       *(outbuffer + offset++) = (sig_contact_max_correcting_vel<<5) & 0xff;
00097       *(outbuffer + offset++) = (sig_contact_max_correcting_vel>>3) & 0xff;
00098       *(outbuffer + offset++) = (sig_contact_max_correcting_vel>>11) & 0xff;
00099       *(outbuffer + offset++) = ((exp_contact_max_correcting_vel<<4) & 0xF0) | ((sig_contact_max_correcting_vel>>19)&0x0F);
00100       *(outbuffer + offset++) = (exp_contact_max_correcting_vel>>4) & 0x7F;
00101       if(this->contact_max_correcting_vel < 0) *(outbuffer + offset -1) |= 0x80;
00102       int32_t * val_cfm = (int32_t *) &(this->cfm);
00103       int32_t exp_cfm = (((*val_cfm)>>23)&255);
00104       if(exp_cfm != 0)
00105         exp_cfm += 1023-127;
00106       int32_t sig_cfm = *val_cfm;
00107       *(outbuffer + offset++) = 0;
00108       *(outbuffer + offset++) = 0;
00109       *(outbuffer + offset++) = 0;
00110       *(outbuffer + offset++) = (sig_cfm<<5) & 0xff;
00111       *(outbuffer + offset++) = (sig_cfm>>3) & 0xff;
00112       *(outbuffer + offset++) = (sig_cfm>>11) & 0xff;
00113       *(outbuffer + offset++) = ((exp_cfm<<4) & 0xF0) | ((sig_cfm>>19)&0x0F);
00114       *(outbuffer + offset++) = (exp_cfm>>4) & 0x7F;
00115       if(this->cfm < 0) *(outbuffer + offset -1) |= 0x80;
00116       int32_t * val_erp = (int32_t *) &(this->erp);
00117       int32_t exp_erp = (((*val_erp)>>23)&255);
00118       if(exp_erp != 0)
00119         exp_erp += 1023-127;
00120       int32_t sig_erp = *val_erp;
00121       *(outbuffer + offset++) = 0;
00122       *(outbuffer + offset++) = 0;
00123       *(outbuffer + offset++) = 0;
00124       *(outbuffer + offset++) = (sig_erp<<5) & 0xff;
00125       *(outbuffer + offset++) = (sig_erp>>3) & 0xff;
00126       *(outbuffer + offset++) = (sig_erp>>11) & 0xff;
00127       *(outbuffer + offset++) = ((exp_erp<<4) & 0xF0) | ((sig_erp>>19)&0x0F);
00128       *(outbuffer + offset++) = (exp_erp>>4) & 0x7F;
00129       if(this->erp < 0) *(outbuffer + offset -1) |= 0x80;
00130       *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF;
00131       *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF;
00132       *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF;
00133       *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF;
00134       offset += sizeof(this->max_contacts);
00135       return offset;
00136     }
00137 
00138     virtual int deserialize(unsigned char *inbuffer)
00139     {
00140       int offset = 0;
00141       union {
00142         bool real;
00143         uint8_t base;
00144       } u_auto_disable_bodies;
00145       u_auto_disable_bodies.base = 0;
00146       u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00147       this->auto_disable_bodies = u_auto_disable_bodies.real;
00148       offset += sizeof(this->auto_disable_bodies);
00149       this->sor_pgs_precon_iters =  ((uint32_t) (*(inbuffer + offset)));
00150       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00151       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00152       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00153       offset += sizeof(this->sor_pgs_precon_iters);
00154       this->sor_pgs_iters =  ((uint32_t) (*(inbuffer + offset)));
00155       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00156       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00157       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00158       offset += sizeof(this->sor_pgs_iters);
00159       uint32_t * val_sor_pgs_w = (uint32_t*) &(this->sor_pgs_w);
00160       offset += 3;
00161       *val_sor_pgs_w = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00162       *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00163       *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00164       *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00165       uint32_t exp_sor_pgs_w = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00166       exp_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00167       if(exp_sor_pgs_w !=0)
00168         *val_sor_pgs_w |= ((exp_sor_pgs_w)-1023+127)<<23;
00169       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->sor_pgs_w = -this->sor_pgs_w;
00170       uint32_t * val_sor_pgs_rms_error_tol = (uint32_t*) &(this->sor_pgs_rms_error_tol);
00171       offset += 3;
00172       *val_sor_pgs_rms_error_tol = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00173       *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00174       *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00175       *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00176       uint32_t exp_sor_pgs_rms_error_tol = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00177       exp_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00178       if(exp_sor_pgs_rms_error_tol !=0)
00179         *val_sor_pgs_rms_error_tol |= ((exp_sor_pgs_rms_error_tol)-1023+127)<<23;
00180       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->sor_pgs_rms_error_tol = -this->sor_pgs_rms_error_tol;
00181       uint32_t * val_contact_surface_layer = (uint32_t*) &(this->contact_surface_layer);
00182       offset += 3;
00183       *val_contact_surface_layer = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00184       *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00185       *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00186       *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00187       uint32_t exp_contact_surface_layer = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00188       exp_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00189       if(exp_contact_surface_layer !=0)
00190         *val_contact_surface_layer |= ((exp_contact_surface_layer)-1023+127)<<23;
00191       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->contact_surface_layer = -this->contact_surface_layer;
00192       uint32_t * val_contact_max_correcting_vel = (uint32_t*) &(this->contact_max_correcting_vel);
00193       offset += 3;
00194       *val_contact_max_correcting_vel = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00195       *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00196       *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00197       *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00198       uint32_t exp_contact_max_correcting_vel = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00199       exp_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00200       if(exp_contact_max_correcting_vel !=0)
00201         *val_contact_max_correcting_vel |= ((exp_contact_max_correcting_vel)-1023+127)<<23;
00202       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->contact_max_correcting_vel = -this->contact_max_correcting_vel;
00203       uint32_t * val_cfm = (uint32_t*) &(this->cfm);
00204       offset += 3;
00205       *val_cfm = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00206       *val_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00207       *val_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00208       *val_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00209       uint32_t exp_cfm = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00210       exp_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00211       if(exp_cfm !=0)
00212         *val_cfm |= ((exp_cfm)-1023+127)<<23;
00213       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->cfm = -this->cfm;
00214       uint32_t * val_erp = (uint32_t*) &(this->erp);
00215       offset += 3;
00216       *val_erp = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07);
00217       *val_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3;
00218       *val_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11;
00219       *val_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19;
00220       uint32_t exp_erp = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4;
00221       exp_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4;
00222       if(exp_erp !=0)
00223         *val_erp |= ((exp_erp)-1023+127)<<23;
00224       if( ((*(inbuffer+offset++)) & 0x80) > 0) this->erp = -this->erp;
00225       this->max_contacts =  ((uint32_t) (*(inbuffer + offset)));
00226       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00227       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00228       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00229       offset += sizeof(this->max_contacts);
00230      return offset;
00231     }
00232 
00233     const char * getType(){ return "gazebo_msgs/ODEPhysics"; };
00234     const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; };
00235 
00236   };
00237 
00238 }
00239 #endif


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