Working towards recieving twists

Dependencies:   BufferedSerial

Fork of ros_lib_kinetic by Gary Servin

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ODEPhysics.h Source File

ODEPhysics.h

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       typedef bool _auto_disable_bodies_type;
00016       _auto_disable_bodies_type auto_disable_bodies;
00017       typedef uint32_t _sor_pgs_precon_iters_type;
00018       _sor_pgs_precon_iters_type sor_pgs_precon_iters;
00019       typedef uint32_t _sor_pgs_iters_type;
00020       _sor_pgs_iters_type sor_pgs_iters;
00021       typedef double _sor_pgs_w_type;
00022       _sor_pgs_w_type sor_pgs_w;
00023       typedef double _sor_pgs_rms_error_tol_type;
00024       _sor_pgs_rms_error_tol_type sor_pgs_rms_error_tol;
00025       typedef double _contact_surface_layer_type;
00026       _contact_surface_layer_type contact_surface_layer;
00027       typedef double _contact_max_correcting_vel_type;
00028       _contact_max_correcting_vel_type contact_max_correcting_vel;
00029       typedef double _cfm_type;
00030       _cfm_type cfm;
00031       typedef double _erp_type;
00032       _erp_type erp;
00033       typedef uint32_t _max_contacts_type;
00034       _max_contacts_type max_contacts;
00035 
00036     ODEPhysics():
00037       auto_disable_bodies(0),
00038       sor_pgs_precon_iters(0),
00039       sor_pgs_iters(0),
00040       sor_pgs_w(0),
00041       sor_pgs_rms_error_tol(0),
00042       contact_surface_layer(0),
00043       contact_max_correcting_vel(0),
00044       cfm(0),
00045       erp(0),
00046       max_contacts(0)
00047     {
00048     }
00049 
00050     virtual int serialize(unsigned char *outbuffer) const
00051     {
00052       int offset = 0;
00053       union {
00054         bool real;
00055         uint8_t base;
00056       } u_auto_disable_bodies;
00057       u_auto_disable_bodies.real = this->auto_disable_bodies;
00058       *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF;
00059       offset += sizeof(this->auto_disable_bodies);
00060       *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF;
00061       *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF;
00062       *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF;
00063       *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF;
00064       offset += sizeof(this->sor_pgs_precon_iters);
00065       *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF;
00066       *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF;
00067       *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF;
00068       *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF;
00069       offset += sizeof(this->sor_pgs_iters);
00070       union {
00071         double real;
00072         uint64_t base;
00073       } u_sor_pgs_w;
00074       u_sor_pgs_w.real = this->sor_pgs_w;
00075       *(outbuffer + offset + 0) = (u_sor_pgs_w.base >> (8 * 0)) & 0xFF;
00076       *(outbuffer + offset + 1) = (u_sor_pgs_w.base >> (8 * 1)) & 0xFF;
00077       *(outbuffer + offset + 2) = (u_sor_pgs_w.base >> (8 * 2)) & 0xFF;
00078       *(outbuffer + offset + 3) = (u_sor_pgs_w.base >> (8 * 3)) & 0xFF;
00079       *(outbuffer + offset + 4) = (u_sor_pgs_w.base >> (8 * 4)) & 0xFF;
00080       *(outbuffer + offset + 5) = (u_sor_pgs_w.base >> (8 * 5)) & 0xFF;
00081       *(outbuffer + offset + 6) = (u_sor_pgs_w.base >> (8 * 6)) & 0xFF;
00082       *(outbuffer + offset + 7) = (u_sor_pgs_w.base >> (8 * 7)) & 0xFF;
00083       offset += sizeof(this->sor_pgs_w);
00084       union {
00085         double real;
00086         uint64_t base;
00087       } u_sor_pgs_rms_error_tol;
00088       u_sor_pgs_rms_error_tol.real = this->sor_pgs_rms_error_tol;
00089       *(outbuffer + offset + 0) = (u_sor_pgs_rms_error_tol.base >> (8 * 0)) & 0xFF;
00090       *(outbuffer + offset + 1) = (u_sor_pgs_rms_error_tol.base >> (8 * 1)) & 0xFF;
00091       *(outbuffer + offset + 2) = (u_sor_pgs_rms_error_tol.base >> (8 * 2)) & 0xFF;
00092       *(outbuffer + offset + 3) = (u_sor_pgs_rms_error_tol.base >> (8 * 3)) & 0xFF;
00093       *(outbuffer + offset + 4) = (u_sor_pgs_rms_error_tol.base >> (8 * 4)) & 0xFF;
00094       *(outbuffer + offset + 5) = (u_sor_pgs_rms_error_tol.base >> (8 * 5)) & 0xFF;
00095       *(outbuffer + offset + 6) = (u_sor_pgs_rms_error_tol.base >> (8 * 6)) & 0xFF;
00096       *(outbuffer + offset + 7) = (u_sor_pgs_rms_error_tol.base >> (8 * 7)) & 0xFF;
00097       offset += sizeof(this->sor_pgs_rms_error_tol);
00098       union {
00099         double real;
00100         uint64_t base;
00101       } u_contact_surface_layer;
00102       u_contact_surface_layer.real = this->contact_surface_layer;
00103       *(outbuffer + offset + 0) = (u_contact_surface_layer.base >> (8 * 0)) & 0xFF;
00104       *(outbuffer + offset + 1) = (u_contact_surface_layer.base >> (8 * 1)) & 0xFF;
00105       *(outbuffer + offset + 2) = (u_contact_surface_layer.base >> (8 * 2)) & 0xFF;
00106       *(outbuffer + offset + 3) = (u_contact_surface_layer.base >> (8 * 3)) & 0xFF;
00107       *(outbuffer + offset + 4) = (u_contact_surface_layer.base >> (8 * 4)) & 0xFF;
00108       *(outbuffer + offset + 5) = (u_contact_surface_layer.base >> (8 * 5)) & 0xFF;
00109       *(outbuffer + offset + 6) = (u_contact_surface_layer.base >> (8 * 6)) & 0xFF;
00110       *(outbuffer + offset + 7) = (u_contact_surface_layer.base >> (8 * 7)) & 0xFF;
00111       offset += sizeof(this->contact_surface_layer);
00112       union {
00113         double real;
00114         uint64_t base;
00115       } u_contact_max_correcting_vel;
00116       u_contact_max_correcting_vel.real = this->contact_max_correcting_vel;
00117       *(outbuffer + offset + 0) = (u_contact_max_correcting_vel.base >> (8 * 0)) & 0xFF;
00118       *(outbuffer + offset + 1) = (u_contact_max_correcting_vel.base >> (8 * 1)) & 0xFF;
00119       *(outbuffer + offset + 2) = (u_contact_max_correcting_vel.base >> (8 * 2)) & 0xFF;
00120       *(outbuffer + offset + 3) = (u_contact_max_correcting_vel.base >> (8 * 3)) & 0xFF;
00121       *(outbuffer + offset + 4) = (u_contact_max_correcting_vel.base >> (8 * 4)) & 0xFF;
00122       *(outbuffer + offset + 5) = (u_contact_max_correcting_vel.base >> (8 * 5)) & 0xFF;
00123       *(outbuffer + offset + 6) = (u_contact_max_correcting_vel.base >> (8 * 6)) & 0xFF;
00124       *(outbuffer + offset + 7) = (u_contact_max_correcting_vel.base >> (8 * 7)) & 0xFF;
00125       offset += sizeof(this->contact_max_correcting_vel);
00126       union {
00127         double real;
00128         uint64_t base;
00129       } u_cfm;
00130       u_cfm.real = this->cfm;
00131       *(outbuffer + offset + 0) = (u_cfm.base >> (8 * 0)) & 0xFF;
00132       *(outbuffer + offset + 1) = (u_cfm.base >> (8 * 1)) & 0xFF;
00133       *(outbuffer + offset + 2) = (u_cfm.base >> (8 * 2)) & 0xFF;
00134       *(outbuffer + offset + 3) = (u_cfm.base >> (8 * 3)) & 0xFF;
00135       *(outbuffer + offset + 4) = (u_cfm.base >> (8 * 4)) & 0xFF;
00136       *(outbuffer + offset + 5) = (u_cfm.base >> (8 * 5)) & 0xFF;
00137       *(outbuffer + offset + 6) = (u_cfm.base >> (8 * 6)) & 0xFF;
00138       *(outbuffer + offset + 7) = (u_cfm.base >> (8 * 7)) & 0xFF;
00139       offset += sizeof(this->cfm);
00140       union {
00141         double real;
00142         uint64_t base;
00143       } u_erp;
00144       u_erp.real = this->erp;
00145       *(outbuffer + offset + 0) = (u_erp.base >> (8 * 0)) & 0xFF;
00146       *(outbuffer + offset + 1) = (u_erp.base >> (8 * 1)) & 0xFF;
00147       *(outbuffer + offset + 2) = (u_erp.base >> (8 * 2)) & 0xFF;
00148       *(outbuffer + offset + 3) = (u_erp.base >> (8 * 3)) & 0xFF;
00149       *(outbuffer + offset + 4) = (u_erp.base >> (8 * 4)) & 0xFF;
00150       *(outbuffer + offset + 5) = (u_erp.base >> (8 * 5)) & 0xFF;
00151       *(outbuffer + offset + 6) = (u_erp.base >> (8 * 6)) & 0xFF;
00152       *(outbuffer + offset + 7) = (u_erp.base >> (8 * 7)) & 0xFF;
00153       offset += sizeof(this->erp);
00154       *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF;
00155       *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF;
00156       *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF;
00157       *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF;
00158       offset += sizeof(this->max_contacts);
00159       return offset;
00160     }
00161 
00162     virtual int deserialize(unsigned char *inbuffer)
00163     {
00164       int offset = 0;
00165       union {
00166         bool real;
00167         uint8_t base;
00168       } u_auto_disable_bodies;
00169       u_auto_disable_bodies.base = 0;
00170       u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00171       this->auto_disable_bodies = u_auto_disable_bodies.real;
00172       offset += sizeof(this->auto_disable_bodies);
00173       this->sor_pgs_precon_iters =  ((uint32_t) (*(inbuffer + offset)));
00174       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00175       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00176       this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00177       offset += sizeof(this->sor_pgs_precon_iters);
00178       this->sor_pgs_iters =  ((uint32_t) (*(inbuffer + offset)));
00179       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00180       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00181       this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00182       offset += sizeof(this->sor_pgs_iters);
00183       union {
00184         double real;
00185         uint64_t base;
00186       } u_sor_pgs_w;
00187       u_sor_pgs_w.base = 0;
00188       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00189       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00190       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00191       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00192       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00193       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00194       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00195       u_sor_pgs_w.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00196       this->sor_pgs_w = u_sor_pgs_w.real;
00197       offset += sizeof(this->sor_pgs_w);
00198       union {
00199         double real;
00200         uint64_t base;
00201       } u_sor_pgs_rms_error_tol;
00202       u_sor_pgs_rms_error_tol.base = 0;
00203       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00204       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00205       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00206       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00207       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00208       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00209       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00210       u_sor_pgs_rms_error_tol.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00211       this->sor_pgs_rms_error_tol = u_sor_pgs_rms_error_tol.real;
00212       offset += sizeof(this->sor_pgs_rms_error_tol);
00213       union {
00214         double real;
00215         uint64_t base;
00216       } u_contact_surface_layer;
00217       u_contact_surface_layer.base = 0;
00218       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00219       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00220       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00221       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00222       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00223       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00224       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00225       u_contact_surface_layer.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00226       this->contact_surface_layer = u_contact_surface_layer.real;
00227       offset += sizeof(this->contact_surface_layer);
00228       union {
00229         double real;
00230         uint64_t base;
00231       } u_contact_max_correcting_vel;
00232       u_contact_max_correcting_vel.base = 0;
00233       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00234       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00235       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00236       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00237       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00238       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00239       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00240       u_contact_max_correcting_vel.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00241       this->contact_max_correcting_vel = u_contact_max_correcting_vel.real;
00242       offset += sizeof(this->contact_max_correcting_vel);
00243       union {
00244         double real;
00245         uint64_t base;
00246       } u_cfm;
00247       u_cfm.base = 0;
00248       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00249       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00250       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00251       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00252       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00253       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00254       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00255       u_cfm.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00256       this->cfm = u_cfm.real;
00257       offset += sizeof(this->cfm);
00258       union {
00259         double real;
00260         uint64_t base;
00261       } u_erp;
00262       u_erp.base = 0;
00263       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
00264       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
00265       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
00266       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
00267       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
00268       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
00269       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
00270       u_erp.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
00271       this->erp = u_erp.real;
00272       offset += sizeof(this->erp);
00273       this->max_contacts =  ((uint32_t) (*(inbuffer + offset)));
00274       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00275       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00276       this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00277       offset += sizeof(this->max_contacts);
00278      return offset;
00279     }
00280 
00281     const char * getType(){ return "gazebo_msgs/ODEPhysics"; };
00282     const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; };
00283 
00284   };
00285 
00286 }
00287 #endif