rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
gazebo_msgs/ODEPhysics.h@0:30537dec6e0b, 2015-02-15 (annotated)
- Committer:
- akashvibhute
- Date:
- Sun Feb 15 10:53:43 2015 +0000
- Revision:
- 0:30537dec6e0b
First commit; Library still need to be debugged, compilation issues with new mbed and modserial updates.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 0:30537dec6e0b | 1 | #ifndef _ROS_gazebo_msgs_ODEPhysics_h |
akashvibhute | 0:30537dec6e0b | 2 | #define _ROS_gazebo_msgs_ODEPhysics_h |
akashvibhute | 0:30537dec6e0b | 3 | |
akashvibhute | 0:30537dec6e0b | 4 | #include <stdint.h> |
akashvibhute | 0:30537dec6e0b | 5 | #include <string.h> |
akashvibhute | 0:30537dec6e0b | 6 | #include <stdlib.h> |
akashvibhute | 0:30537dec6e0b | 7 | #include "ros/msg.h" |
akashvibhute | 0:30537dec6e0b | 8 | |
akashvibhute | 0:30537dec6e0b | 9 | namespace gazebo_msgs |
akashvibhute | 0:30537dec6e0b | 10 | { |
akashvibhute | 0:30537dec6e0b | 11 | |
akashvibhute | 0:30537dec6e0b | 12 | class ODEPhysics : public ros::Msg |
akashvibhute | 0:30537dec6e0b | 13 | { |
akashvibhute | 0:30537dec6e0b | 14 | public: |
akashvibhute | 0:30537dec6e0b | 15 | bool auto_disable_bodies; |
akashvibhute | 0:30537dec6e0b | 16 | uint32_t sor_pgs_precon_iters; |
akashvibhute | 0:30537dec6e0b | 17 | uint32_t sor_pgs_iters; |
akashvibhute | 0:30537dec6e0b | 18 | float sor_pgs_w; |
akashvibhute | 0:30537dec6e0b | 19 | float sor_pgs_rms_error_tol; |
akashvibhute | 0:30537dec6e0b | 20 | float contact_surface_layer; |
akashvibhute | 0:30537dec6e0b | 21 | float contact_max_correcting_vel; |
akashvibhute | 0:30537dec6e0b | 22 | float cfm; |
akashvibhute | 0:30537dec6e0b | 23 | float erp; |
akashvibhute | 0:30537dec6e0b | 24 | uint32_t max_contacts; |
akashvibhute | 0:30537dec6e0b | 25 | |
akashvibhute | 0:30537dec6e0b | 26 | ODEPhysics(): |
akashvibhute | 0:30537dec6e0b | 27 | auto_disable_bodies(0), |
akashvibhute | 0:30537dec6e0b | 28 | sor_pgs_precon_iters(0), |
akashvibhute | 0:30537dec6e0b | 29 | sor_pgs_iters(0), |
akashvibhute | 0:30537dec6e0b | 30 | sor_pgs_w(0), |
akashvibhute | 0:30537dec6e0b | 31 | sor_pgs_rms_error_tol(0), |
akashvibhute | 0:30537dec6e0b | 32 | contact_surface_layer(0), |
akashvibhute | 0:30537dec6e0b | 33 | contact_max_correcting_vel(0), |
akashvibhute | 0:30537dec6e0b | 34 | cfm(0), |
akashvibhute | 0:30537dec6e0b | 35 | erp(0), |
akashvibhute | 0:30537dec6e0b | 36 | max_contacts(0) |
akashvibhute | 0:30537dec6e0b | 37 | { |
akashvibhute | 0:30537dec6e0b | 38 | } |
akashvibhute | 0:30537dec6e0b | 39 | |
akashvibhute | 0:30537dec6e0b | 40 | virtual int serialize(unsigned char *outbuffer) const |
akashvibhute | 0:30537dec6e0b | 41 | { |
akashvibhute | 0:30537dec6e0b | 42 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 43 | union { |
akashvibhute | 0:30537dec6e0b | 44 | bool real; |
akashvibhute | 0:30537dec6e0b | 45 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 46 | } u_auto_disable_bodies; |
akashvibhute | 0:30537dec6e0b | 47 | u_auto_disable_bodies.real = this->auto_disable_bodies; |
akashvibhute | 0:30537dec6e0b | 48 | *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 49 | offset += sizeof(this->auto_disable_bodies); |
akashvibhute | 0:30537dec6e0b | 50 | *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 51 | *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 52 | *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 53 | *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 54 | offset += sizeof(this->sor_pgs_precon_iters); |
akashvibhute | 0:30537dec6e0b | 55 | *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 56 | *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 57 | *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 58 | *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 59 | offset += sizeof(this->sor_pgs_iters); |
akashvibhute | 0:30537dec6e0b | 60 | offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_w); |
akashvibhute | 0:30537dec6e0b | 61 | offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_rms_error_tol); |
akashvibhute | 0:30537dec6e0b | 62 | offset += serializeAvrFloat64(outbuffer + offset, this->contact_surface_layer); |
akashvibhute | 0:30537dec6e0b | 63 | offset += serializeAvrFloat64(outbuffer + offset, this->contact_max_correcting_vel); |
akashvibhute | 0:30537dec6e0b | 64 | offset += serializeAvrFloat64(outbuffer + offset, this->cfm); |
akashvibhute | 0:30537dec6e0b | 65 | offset += serializeAvrFloat64(outbuffer + offset, this->erp); |
akashvibhute | 0:30537dec6e0b | 66 | *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 67 | *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 68 | *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 69 | *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 70 | offset += sizeof(this->max_contacts); |
akashvibhute | 0:30537dec6e0b | 71 | return offset; |
akashvibhute | 0:30537dec6e0b | 72 | } |
akashvibhute | 0:30537dec6e0b | 73 | |
akashvibhute | 0:30537dec6e0b | 74 | virtual int deserialize(unsigned char *inbuffer) |
akashvibhute | 0:30537dec6e0b | 75 | { |
akashvibhute | 0:30537dec6e0b | 76 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 77 | union { |
akashvibhute | 0:30537dec6e0b | 78 | bool real; |
akashvibhute | 0:30537dec6e0b | 79 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 80 | } u_auto_disable_bodies; |
akashvibhute | 0:30537dec6e0b | 81 | u_auto_disable_bodies.base = 0; |
akashvibhute | 0:30537dec6e0b | 82 | u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 83 | this->auto_disable_bodies = u_auto_disable_bodies.real; |
akashvibhute | 0:30537dec6e0b | 84 | offset += sizeof(this->auto_disable_bodies); |
akashvibhute | 0:30537dec6e0b | 85 | this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 86 | this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 87 | this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 88 | this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 89 | offset += sizeof(this->sor_pgs_precon_iters); |
akashvibhute | 0:30537dec6e0b | 90 | this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 91 | this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 92 | this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 93 | this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 94 | offset += sizeof(this->sor_pgs_iters); |
akashvibhute | 0:30537dec6e0b | 95 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_w)); |
akashvibhute | 0:30537dec6e0b | 96 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_rms_error_tol)); |
akashvibhute | 0:30537dec6e0b | 97 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_surface_layer)); |
akashvibhute | 0:30537dec6e0b | 98 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_max_correcting_vel)); |
akashvibhute | 0:30537dec6e0b | 99 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->cfm)); |
akashvibhute | 0:30537dec6e0b | 100 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->erp)); |
akashvibhute | 0:30537dec6e0b | 101 | this->max_contacts = ((uint32_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 102 | this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 103 | this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 104 | this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 105 | offset += sizeof(this->max_contacts); |
akashvibhute | 0:30537dec6e0b | 106 | return offset; |
akashvibhute | 0:30537dec6e0b | 107 | } |
akashvibhute | 0:30537dec6e0b | 108 | |
akashvibhute | 0:30537dec6e0b | 109 | const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; |
akashvibhute | 0:30537dec6e0b | 110 | const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; |
akashvibhute | 0:30537dec6e0b | 111 | |
akashvibhute | 0:30537dec6e0b | 112 | }; |
akashvibhute | 0:30537dec6e0b | 113 | |
akashvibhute | 0:30537dec6e0b | 114 | } |
akashvibhute | 0:30537dec6e0b | 115 | #endif |