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/ODEJointProperties.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_ODEJointProperties_h |
akashvibhute | 0:30537dec6e0b | 2 | #define _ROS_gazebo_msgs_ODEJointProperties_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 ODEJointProperties : public ros::Msg |
akashvibhute | 0:30537dec6e0b | 13 | { |
akashvibhute | 0:30537dec6e0b | 14 | public: |
akashvibhute | 0:30537dec6e0b | 15 | uint8_t damping_length; |
akashvibhute | 0:30537dec6e0b | 16 | float st_damping; |
akashvibhute | 0:30537dec6e0b | 17 | float * damping; |
akashvibhute | 0:30537dec6e0b | 18 | uint8_t hiStop_length; |
akashvibhute | 0:30537dec6e0b | 19 | float st_hiStop; |
akashvibhute | 0:30537dec6e0b | 20 | float * hiStop; |
akashvibhute | 0:30537dec6e0b | 21 | uint8_t loStop_length; |
akashvibhute | 0:30537dec6e0b | 22 | float st_loStop; |
akashvibhute | 0:30537dec6e0b | 23 | float * loStop; |
akashvibhute | 0:30537dec6e0b | 24 | uint8_t erp_length; |
akashvibhute | 0:30537dec6e0b | 25 | float st_erp; |
akashvibhute | 0:30537dec6e0b | 26 | float * erp; |
akashvibhute | 0:30537dec6e0b | 27 | uint8_t cfm_length; |
akashvibhute | 0:30537dec6e0b | 28 | float st_cfm; |
akashvibhute | 0:30537dec6e0b | 29 | float * cfm; |
akashvibhute | 0:30537dec6e0b | 30 | uint8_t stop_erp_length; |
akashvibhute | 0:30537dec6e0b | 31 | float st_stop_erp; |
akashvibhute | 0:30537dec6e0b | 32 | float * stop_erp; |
akashvibhute | 0:30537dec6e0b | 33 | uint8_t stop_cfm_length; |
akashvibhute | 0:30537dec6e0b | 34 | float st_stop_cfm; |
akashvibhute | 0:30537dec6e0b | 35 | float * stop_cfm; |
akashvibhute | 0:30537dec6e0b | 36 | uint8_t fudge_factor_length; |
akashvibhute | 0:30537dec6e0b | 37 | float st_fudge_factor; |
akashvibhute | 0:30537dec6e0b | 38 | float * fudge_factor; |
akashvibhute | 0:30537dec6e0b | 39 | uint8_t fmax_length; |
akashvibhute | 0:30537dec6e0b | 40 | float st_fmax; |
akashvibhute | 0:30537dec6e0b | 41 | float * fmax; |
akashvibhute | 0:30537dec6e0b | 42 | uint8_t vel_length; |
akashvibhute | 0:30537dec6e0b | 43 | float st_vel; |
akashvibhute | 0:30537dec6e0b | 44 | float * vel; |
akashvibhute | 0:30537dec6e0b | 45 | |
akashvibhute | 0:30537dec6e0b | 46 | ODEJointProperties(): |
akashvibhute | 0:30537dec6e0b | 47 | damping_length(0), damping(NULL), |
akashvibhute | 0:30537dec6e0b | 48 | hiStop_length(0), hiStop(NULL), |
akashvibhute | 0:30537dec6e0b | 49 | loStop_length(0), loStop(NULL), |
akashvibhute | 0:30537dec6e0b | 50 | erp_length(0), erp(NULL), |
akashvibhute | 0:30537dec6e0b | 51 | cfm_length(0), cfm(NULL), |
akashvibhute | 0:30537dec6e0b | 52 | stop_erp_length(0), stop_erp(NULL), |
akashvibhute | 0:30537dec6e0b | 53 | stop_cfm_length(0), stop_cfm(NULL), |
akashvibhute | 0:30537dec6e0b | 54 | fudge_factor_length(0), fudge_factor(NULL), |
akashvibhute | 0:30537dec6e0b | 55 | fmax_length(0), fmax(NULL), |
akashvibhute | 0:30537dec6e0b | 56 | vel_length(0), vel(NULL) |
akashvibhute | 0:30537dec6e0b | 57 | { |
akashvibhute | 0:30537dec6e0b | 58 | } |
akashvibhute | 0:30537dec6e0b | 59 | |
akashvibhute | 0:30537dec6e0b | 60 | virtual int serialize(unsigned char *outbuffer) const |
akashvibhute | 0:30537dec6e0b | 61 | { |
akashvibhute | 0:30537dec6e0b | 62 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 63 | *(outbuffer + offset++) = damping_length; |
akashvibhute | 0:30537dec6e0b | 64 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 65 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 66 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 67 | for( uint8_t i = 0; i < damping_length; i++){ |
akashvibhute | 0:30537dec6e0b | 68 | offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); |
akashvibhute | 0:30537dec6e0b | 69 | } |
akashvibhute | 0:30537dec6e0b | 70 | *(outbuffer + offset++) = hiStop_length; |
akashvibhute | 0:30537dec6e0b | 71 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 72 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 73 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 74 | for( uint8_t i = 0; i < hiStop_length; i++){ |
akashvibhute | 0:30537dec6e0b | 75 | offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); |
akashvibhute | 0:30537dec6e0b | 76 | } |
akashvibhute | 0:30537dec6e0b | 77 | *(outbuffer + offset++) = loStop_length; |
akashvibhute | 0:30537dec6e0b | 78 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 79 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 80 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 81 | for( uint8_t i = 0; i < loStop_length; i++){ |
akashvibhute | 0:30537dec6e0b | 82 | offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); |
akashvibhute | 0:30537dec6e0b | 83 | } |
akashvibhute | 0:30537dec6e0b | 84 | *(outbuffer + offset++) = erp_length; |
akashvibhute | 0:30537dec6e0b | 85 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 86 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 87 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 88 | for( uint8_t i = 0; i < erp_length; i++){ |
akashvibhute | 0:30537dec6e0b | 89 | offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); |
akashvibhute | 0:30537dec6e0b | 90 | } |
akashvibhute | 0:30537dec6e0b | 91 | *(outbuffer + offset++) = cfm_length; |
akashvibhute | 0:30537dec6e0b | 92 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 93 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 94 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 95 | for( uint8_t i = 0; i < cfm_length; i++){ |
akashvibhute | 0:30537dec6e0b | 96 | offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); |
akashvibhute | 0:30537dec6e0b | 97 | } |
akashvibhute | 0:30537dec6e0b | 98 | *(outbuffer + offset++) = stop_erp_length; |
akashvibhute | 0:30537dec6e0b | 99 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 100 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 101 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 102 | for( uint8_t i = 0; i < stop_erp_length; i++){ |
akashvibhute | 0:30537dec6e0b | 103 | offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); |
akashvibhute | 0:30537dec6e0b | 104 | } |
akashvibhute | 0:30537dec6e0b | 105 | *(outbuffer + offset++) = stop_cfm_length; |
akashvibhute | 0:30537dec6e0b | 106 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 107 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 108 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 109 | for( uint8_t i = 0; i < stop_cfm_length; i++){ |
akashvibhute | 0:30537dec6e0b | 110 | offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); |
akashvibhute | 0:30537dec6e0b | 111 | } |
akashvibhute | 0:30537dec6e0b | 112 | *(outbuffer + offset++) = fudge_factor_length; |
akashvibhute | 0:30537dec6e0b | 113 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 114 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 115 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 116 | for( uint8_t i = 0; i < fudge_factor_length; i++){ |
akashvibhute | 0:30537dec6e0b | 117 | offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); |
akashvibhute | 0:30537dec6e0b | 118 | } |
akashvibhute | 0:30537dec6e0b | 119 | *(outbuffer + offset++) = fmax_length; |
akashvibhute | 0:30537dec6e0b | 120 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 121 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 122 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 123 | for( uint8_t i = 0; i < fmax_length; i++){ |
akashvibhute | 0:30537dec6e0b | 124 | offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); |
akashvibhute | 0:30537dec6e0b | 125 | } |
akashvibhute | 0:30537dec6e0b | 126 | *(outbuffer + offset++) = vel_length; |
akashvibhute | 0:30537dec6e0b | 127 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 128 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 129 | *(outbuffer + offset++) = 0; |
akashvibhute | 0:30537dec6e0b | 130 | for( uint8_t i = 0; i < vel_length; i++){ |
akashvibhute | 0:30537dec6e0b | 131 | offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); |
akashvibhute | 0:30537dec6e0b | 132 | } |
akashvibhute | 0:30537dec6e0b | 133 | return offset; |
akashvibhute | 0:30537dec6e0b | 134 | } |
akashvibhute | 0:30537dec6e0b | 135 | |
akashvibhute | 0:30537dec6e0b | 136 | virtual int deserialize(unsigned char *inbuffer) |
akashvibhute | 0:30537dec6e0b | 137 | { |
akashvibhute | 0:30537dec6e0b | 138 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 139 | uint8_t damping_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 140 | if(damping_lengthT > damping_length) |
akashvibhute | 0:30537dec6e0b | 141 | this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 142 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 143 | damping_length = damping_lengthT; |
akashvibhute | 0:30537dec6e0b | 144 | for( uint8_t i = 0; i < damping_length; i++){ |
akashvibhute | 0:30537dec6e0b | 145 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); |
akashvibhute | 0:30537dec6e0b | 146 | memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 147 | } |
akashvibhute | 0:30537dec6e0b | 148 | uint8_t hiStop_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 149 | if(hiStop_lengthT > hiStop_length) |
akashvibhute | 0:30537dec6e0b | 150 | this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 151 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 152 | hiStop_length = hiStop_lengthT; |
akashvibhute | 0:30537dec6e0b | 153 | for( uint8_t i = 0; i < hiStop_length; i++){ |
akashvibhute | 0:30537dec6e0b | 154 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); |
akashvibhute | 0:30537dec6e0b | 155 | memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 156 | } |
akashvibhute | 0:30537dec6e0b | 157 | uint8_t loStop_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 158 | if(loStop_lengthT > loStop_length) |
akashvibhute | 0:30537dec6e0b | 159 | this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 160 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 161 | loStop_length = loStop_lengthT; |
akashvibhute | 0:30537dec6e0b | 162 | for( uint8_t i = 0; i < loStop_length; i++){ |
akashvibhute | 0:30537dec6e0b | 163 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); |
akashvibhute | 0:30537dec6e0b | 164 | memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 165 | } |
akashvibhute | 0:30537dec6e0b | 166 | uint8_t erp_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 167 | if(erp_lengthT > erp_length) |
akashvibhute | 0:30537dec6e0b | 168 | this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 169 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 170 | erp_length = erp_lengthT; |
akashvibhute | 0:30537dec6e0b | 171 | for( uint8_t i = 0; i < erp_length; i++){ |
akashvibhute | 0:30537dec6e0b | 172 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); |
akashvibhute | 0:30537dec6e0b | 173 | memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 174 | } |
akashvibhute | 0:30537dec6e0b | 175 | uint8_t cfm_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 176 | if(cfm_lengthT > cfm_length) |
akashvibhute | 0:30537dec6e0b | 177 | this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 178 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 179 | cfm_length = cfm_lengthT; |
akashvibhute | 0:30537dec6e0b | 180 | for( uint8_t i = 0; i < cfm_length; i++){ |
akashvibhute | 0:30537dec6e0b | 181 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); |
akashvibhute | 0:30537dec6e0b | 182 | memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 183 | } |
akashvibhute | 0:30537dec6e0b | 184 | uint8_t stop_erp_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 185 | if(stop_erp_lengthT > stop_erp_length) |
akashvibhute | 0:30537dec6e0b | 186 | this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 187 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 188 | stop_erp_length = stop_erp_lengthT; |
akashvibhute | 0:30537dec6e0b | 189 | for( uint8_t i = 0; i < stop_erp_length; i++){ |
akashvibhute | 0:30537dec6e0b | 190 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_erp)); |
akashvibhute | 0:30537dec6e0b | 191 | memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 192 | } |
akashvibhute | 0:30537dec6e0b | 193 | uint8_t stop_cfm_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 194 | if(stop_cfm_lengthT > stop_cfm_length) |
akashvibhute | 0:30537dec6e0b | 195 | this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 196 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 197 | stop_cfm_length = stop_cfm_lengthT; |
akashvibhute | 0:30537dec6e0b | 198 | for( uint8_t i = 0; i < stop_cfm_length; i++){ |
akashvibhute | 0:30537dec6e0b | 199 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_cfm)); |
akashvibhute | 0:30537dec6e0b | 200 | memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 201 | } |
akashvibhute | 0:30537dec6e0b | 202 | uint8_t fudge_factor_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 203 | if(fudge_factor_lengthT > fudge_factor_length) |
akashvibhute | 0:30537dec6e0b | 204 | this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 205 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 206 | fudge_factor_length = fudge_factor_lengthT; |
akashvibhute | 0:30537dec6e0b | 207 | for( uint8_t i = 0; i < fudge_factor_length; i++){ |
akashvibhute | 0:30537dec6e0b | 208 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fudge_factor)); |
akashvibhute | 0:30537dec6e0b | 209 | memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 210 | } |
akashvibhute | 0:30537dec6e0b | 211 | uint8_t fmax_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 212 | if(fmax_lengthT > fmax_length) |
akashvibhute | 0:30537dec6e0b | 213 | this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 214 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 215 | fmax_length = fmax_lengthT; |
akashvibhute | 0:30537dec6e0b | 216 | for( uint8_t i = 0; i < fmax_length; i++){ |
akashvibhute | 0:30537dec6e0b | 217 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); |
akashvibhute | 0:30537dec6e0b | 218 | memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 219 | } |
akashvibhute | 0:30537dec6e0b | 220 | uint8_t vel_lengthT = *(inbuffer + offset++); |
akashvibhute | 0:30537dec6e0b | 221 | if(vel_lengthT > vel_length) |
akashvibhute | 0:30537dec6e0b | 222 | this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 223 | offset += 3; |
akashvibhute | 0:30537dec6e0b | 224 | vel_length = vel_lengthT; |
akashvibhute | 0:30537dec6e0b | 225 | for( uint8_t i = 0; i < vel_length; i++){ |
akashvibhute | 0:30537dec6e0b | 226 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_vel)); |
akashvibhute | 0:30537dec6e0b | 227 | memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); |
akashvibhute | 0:30537dec6e0b | 228 | } |
akashvibhute | 0:30537dec6e0b | 229 | return offset; |
akashvibhute | 0:30537dec6e0b | 230 | } |
akashvibhute | 0:30537dec6e0b | 231 | |
akashvibhute | 0:30537dec6e0b | 232 | const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; |
akashvibhute | 0:30537dec6e0b | 233 | const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; |
akashvibhute | 0:30537dec6e0b | 234 | |
akashvibhute | 0:30537dec6e0b | 235 | }; |
akashvibhute | 0:30537dec6e0b | 236 | |
akashvibhute | 0:30537dec6e0b | 237 | } |
akashvibhute | 0:30537dec6e0b | 238 | #endif |