ros melodic library with custom message
Dependents: Robot_team1_QEI_Douglas Robot_team1
ros_lib/gazebo_msgs/GetJointProperties.h@3:b964e3f71102, 2019-12-03 (annotated)
- Committer:
- florine_van
- Date:
- Tue Dec 03 09:39:29 2019 +0000
- Revision:
- 3:b964e3f71102
- Parent:
- 0:020db18a476d
Clean code and remove unused lines
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
scarter1 | 0:020db18a476d | 1 | #ifndef _ROS_SERVICE_GetJointProperties_h |
scarter1 | 0:020db18a476d | 2 | #define _ROS_SERVICE_GetJointProperties_h |
scarter1 | 0:020db18a476d | 3 | #include <stdint.h> |
scarter1 | 0:020db18a476d | 4 | #include <string.h> |
scarter1 | 0:020db18a476d | 5 | #include <stdlib.h> |
scarter1 | 0:020db18a476d | 6 | #include "ros/msg.h" |
scarter1 | 0:020db18a476d | 7 | |
scarter1 | 0:020db18a476d | 8 | namespace gazebo_msgs |
scarter1 | 0:020db18a476d | 9 | { |
scarter1 | 0:020db18a476d | 10 | |
scarter1 | 0:020db18a476d | 11 | static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; |
scarter1 | 0:020db18a476d | 12 | |
scarter1 | 0:020db18a476d | 13 | class GetJointPropertiesRequest : public ros::Msg |
scarter1 | 0:020db18a476d | 14 | { |
scarter1 | 0:020db18a476d | 15 | public: |
scarter1 | 0:020db18a476d | 16 | typedef const char* _joint_name_type; |
scarter1 | 0:020db18a476d | 17 | _joint_name_type joint_name; |
scarter1 | 0:020db18a476d | 18 | |
scarter1 | 0:020db18a476d | 19 | GetJointPropertiesRequest(): |
scarter1 | 0:020db18a476d | 20 | joint_name("") |
scarter1 | 0:020db18a476d | 21 | { |
scarter1 | 0:020db18a476d | 22 | } |
scarter1 | 0:020db18a476d | 23 | |
scarter1 | 0:020db18a476d | 24 | virtual int serialize(unsigned char *outbuffer) const |
scarter1 | 0:020db18a476d | 25 | { |
scarter1 | 0:020db18a476d | 26 | int offset = 0; |
scarter1 | 0:020db18a476d | 27 | uint32_t length_joint_name = strlen(this->joint_name); |
scarter1 | 0:020db18a476d | 28 | varToArr(outbuffer + offset, length_joint_name); |
scarter1 | 0:020db18a476d | 29 | offset += 4; |
scarter1 | 0:020db18a476d | 30 | memcpy(outbuffer + offset, this->joint_name, length_joint_name); |
scarter1 | 0:020db18a476d | 31 | offset += length_joint_name; |
scarter1 | 0:020db18a476d | 32 | return offset; |
scarter1 | 0:020db18a476d | 33 | } |
scarter1 | 0:020db18a476d | 34 | |
scarter1 | 0:020db18a476d | 35 | virtual int deserialize(unsigned char *inbuffer) |
scarter1 | 0:020db18a476d | 36 | { |
scarter1 | 0:020db18a476d | 37 | int offset = 0; |
scarter1 | 0:020db18a476d | 38 | uint32_t length_joint_name; |
scarter1 | 0:020db18a476d | 39 | arrToVar(length_joint_name, (inbuffer + offset)); |
scarter1 | 0:020db18a476d | 40 | offset += 4; |
scarter1 | 0:020db18a476d | 41 | for(unsigned int k= offset; k< offset+length_joint_name; ++k){ |
scarter1 | 0:020db18a476d | 42 | inbuffer[k-1]=inbuffer[k]; |
scarter1 | 0:020db18a476d | 43 | } |
scarter1 | 0:020db18a476d | 44 | inbuffer[offset+length_joint_name-1]=0; |
scarter1 | 0:020db18a476d | 45 | this->joint_name = (char *)(inbuffer + offset-1); |
scarter1 | 0:020db18a476d | 46 | offset += length_joint_name; |
scarter1 | 0:020db18a476d | 47 | return offset; |
scarter1 | 0:020db18a476d | 48 | } |
scarter1 | 0:020db18a476d | 49 | |
scarter1 | 0:020db18a476d | 50 | const char * getType(){ return GETJOINTPROPERTIES; }; |
scarter1 | 0:020db18a476d | 51 | const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; |
scarter1 | 0:020db18a476d | 52 | |
scarter1 | 0:020db18a476d | 53 | }; |
scarter1 | 0:020db18a476d | 54 | |
scarter1 | 0:020db18a476d | 55 | class GetJointPropertiesResponse : public ros::Msg |
scarter1 | 0:020db18a476d | 56 | { |
scarter1 | 0:020db18a476d | 57 | public: |
scarter1 | 0:020db18a476d | 58 | typedef uint8_t _type_type; |
scarter1 | 0:020db18a476d | 59 | _type_type type; |
scarter1 | 0:020db18a476d | 60 | uint32_t damping_length; |
scarter1 | 0:020db18a476d | 61 | typedef double _damping_type; |
scarter1 | 0:020db18a476d | 62 | _damping_type st_damping; |
scarter1 | 0:020db18a476d | 63 | _damping_type * damping; |
scarter1 | 0:020db18a476d | 64 | uint32_t position_length; |
scarter1 | 0:020db18a476d | 65 | typedef double _position_type; |
scarter1 | 0:020db18a476d | 66 | _position_type st_position; |
scarter1 | 0:020db18a476d | 67 | _position_type * position; |
scarter1 | 0:020db18a476d | 68 | uint32_t rate_length; |
scarter1 | 0:020db18a476d | 69 | typedef double _rate_type; |
scarter1 | 0:020db18a476d | 70 | _rate_type st_rate; |
scarter1 | 0:020db18a476d | 71 | _rate_type * rate; |
scarter1 | 0:020db18a476d | 72 | typedef bool _success_type; |
scarter1 | 0:020db18a476d | 73 | _success_type success; |
scarter1 | 0:020db18a476d | 74 | typedef const char* _status_message_type; |
scarter1 | 0:020db18a476d | 75 | _status_message_type status_message; |
scarter1 | 0:020db18a476d | 76 | enum { REVOLUTE = 0 }; |
scarter1 | 0:020db18a476d | 77 | enum { CONTINUOUS = 1 }; |
scarter1 | 0:020db18a476d | 78 | enum { PRISMATIC = 2 }; |
scarter1 | 0:020db18a476d | 79 | enum { FIXED = 3 }; |
scarter1 | 0:020db18a476d | 80 | enum { BALL = 4 }; |
scarter1 | 0:020db18a476d | 81 | enum { UNIVERSAL = 5 }; |
scarter1 | 0:020db18a476d | 82 | |
scarter1 | 0:020db18a476d | 83 | GetJointPropertiesResponse(): |
scarter1 | 0:020db18a476d | 84 | type(0), |
scarter1 | 0:020db18a476d | 85 | damping_length(0), damping(NULL), |
scarter1 | 0:020db18a476d | 86 | position_length(0), position(NULL), |
scarter1 | 0:020db18a476d | 87 | rate_length(0), rate(NULL), |
scarter1 | 0:020db18a476d | 88 | success(0), |
scarter1 | 0:020db18a476d | 89 | status_message("") |
scarter1 | 0:020db18a476d | 90 | { |
scarter1 | 0:020db18a476d | 91 | } |
scarter1 | 0:020db18a476d | 92 | |
scarter1 | 0:020db18a476d | 93 | virtual int serialize(unsigned char *outbuffer) const |
scarter1 | 0:020db18a476d | 94 | { |
scarter1 | 0:020db18a476d | 95 | int offset = 0; |
scarter1 | 0:020db18a476d | 96 | *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 97 | offset += sizeof(this->type); |
scarter1 | 0:020db18a476d | 98 | *(outbuffer + offset + 0) = (this->damping_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 99 | *(outbuffer + offset + 1) = (this->damping_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 100 | *(outbuffer + offset + 2) = (this->damping_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 101 | *(outbuffer + offset + 3) = (this->damping_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 102 | offset += sizeof(this->damping_length); |
scarter1 | 0:020db18a476d | 103 | for( uint32_t i = 0; i < damping_length; i++){ |
scarter1 | 0:020db18a476d | 104 | union { |
scarter1 | 0:020db18a476d | 105 | double real; |
scarter1 | 0:020db18a476d | 106 | uint64_t base; |
scarter1 | 0:020db18a476d | 107 | } u_dampingi; |
scarter1 | 0:020db18a476d | 108 | u_dampingi.real = this->damping[i]; |
scarter1 | 0:020db18a476d | 109 | *(outbuffer + offset + 0) = (u_dampingi.base >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 110 | *(outbuffer + offset + 1) = (u_dampingi.base >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 111 | *(outbuffer + offset + 2) = (u_dampingi.base >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 112 | *(outbuffer + offset + 3) = (u_dampingi.base >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 113 | *(outbuffer + offset + 4) = (u_dampingi.base >> (8 * 4)) & 0xFF; |
scarter1 | 0:020db18a476d | 114 | *(outbuffer + offset + 5) = (u_dampingi.base >> (8 * 5)) & 0xFF; |
scarter1 | 0:020db18a476d | 115 | *(outbuffer + offset + 6) = (u_dampingi.base >> (8 * 6)) & 0xFF; |
scarter1 | 0:020db18a476d | 116 | *(outbuffer + offset + 7) = (u_dampingi.base >> (8 * 7)) & 0xFF; |
scarter1 | 0:020db18a476d | 117 | offset += sizeof(this->damping[i]); |
scarter1 | 0:020db18a476d | 118 | } |
scarter1 | 0:020db18a476d | 119 | *(outbuffer + offset + 0) = (this->position_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 120 | *(outbuffer + offset + 1) = (this->position_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 121 | *(outbuffer + offset + 2) = (this->position_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 122 | *(outbuffer + offset + 3) = (this->position_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 123 | offset += sizeof(this->position_length); |
scarter1 | 0:020db18a476d | 124 | for( uint32_t i = 0; i < position_length; i++){ |
scarter1 | 0:020db18a476d | 125 | union { |
scarter1 | 0:020db18a476d | 126 | double real; |
scarter1 | 0:020db18a476d | 127 | uint64_t base; |
scarter1 | 0:020db18a476d | 128 | } u_positioni; |
scarter1 | 0:020db18a476d | 129 | u_positioni.real = this->position[i]; |
scarter1 | 0:020db18a476d | 130 | *(outbuffer + offset + 0) = (u_positioni.base >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 131 | *(outbuffer + offset + 1) = (u_positioni.base >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 132 | *(outbuffer + offset + 2) = (u_positioni.base >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 133 | *(outbuffer + offset + 3) = (u_positioni.base >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 134 | *(outbuffer + offset + 4) = (u_positioni.base >> (8 * 4)) & 0xFF; |
scarter1 | 0:020db18a476d | 135 | *(outbuffer + offset + 5) = (u_positioni.base >> (8 * 5)) & 0xFF; |
scarter1 | 0:020db18a476d | 136 | *(outbuffer + offset + 6) = (u_positioni.base >> (8 * 6)) & 0xFF; |
scarter1 | 0:020db18a476d | 137 | *(outbuffer + offset + 7) = (u_positioni.base >> (8 * 7)) & 0xFF; |
scarter1 | 0:020db18a476d | 138 | offset += sizeof(this->position[i]); |
scarter1 | 0:020db18a476d | 139 | } |
scarter1 | 0:020db18a476d | 140 | *(outbuffer + offset + 0) = (this->rate_length >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 141 | *(outbuffer + offset + 1) = (this->rate_length >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 142 | *(outbuffer + offset + 2) = (this->rate_length >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 143 | *(outbuffer + offset + 3) = (this->rate_length >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 144 | offset += sizeof(this->rate_length); |
scarter1 | 0:020db18a476d | 145 | for( uint32_t i = 0; i < rate_length; i++){ |
scarter1 | 0:020db18a476d | 146 | union { |
scarter1 | 0:020db18a476d | 147 | double real; |
scarter1 | 0:020db18a476d | 148 | uint64_t base; |
scarter1 | 0:020db18a476d | 149 | } u_ratei; |
scarter1 | 0:020db18a476d | 150 | u_ratei.real = this->rate[i]; |
scarter1 | 0:020db18a476d | 151 | *(outbuffer + offset + 0) = (u_ratei.base >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 152 | *(outbuffer + offset + 1) = (u_ratei.base >> (8 * 1)) & 0xFF; |
scarter1 | 0:020db18a476d | 153 | *(outbuffer + offset + 2) = (u_ratei.base >> (8 * 2)) & 0xFF; |
scarter1 | 0:020db18a476d | 154 | *(outbuffer + offset + 3) = (u_ratei.base >> (8 * 3)) & 0xFF; |
scarter1 | 0:020db18a476d | 155 | *(outbuffer + offset + 4) = (u_ratei.base >> (8 * 4)) & 0xFF; |
scarter1 | 0:020db18a476d | 156 | *(outbuffer + offset + 5) = (u_ratei.base >> (8 * 5)) & 0xFF; |
scarter1 | 0:020db18a476d | 157 | *(outbuffer + offset + 6) = (u_ratei.base >> (8 * 6)) & 0xFF; |
scarter1 | 0:020db18a476d | 158 | *(outbuffer + offset + 7) = (u_ratei.base >> (8 * 7)) & 0xFF; |
scarter1 | 0:020db18a476d | 159 | offset += sizeof(this->rate[i]); |
scarter1 | 0:020db18a476d | 160 | } |
scarter1 | 0:020db18a476d | 161 | union { |
scarter1 | 0:020db18a476d | 162 | bool real; |
scarter1 | 0:020db18a476d | 163 | uint8_t base; |
scarter1 | 0:020db18a476d | 164 | } u_success; |
scarter1 | 0:020db18a476d | 165 | u_success.real = this->success; |
scarter1 | 0:020db18a476d | 166 | *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; |
scarter1 | 0:020db18a476d | 167 | offset += sizeof(this->success); |
scarter1 | 0:020db18a476d | 168 | uint32_t length_status_message = strlen(this->status_message); |
scarter1 | 0:020db18a476d | 169 | varToArr(outbuffer + offset, length_status_message); |
scarter1 | 0:020db18a476d | 170 | offset += 4; |
scarter1 | 0:020db18a476d | 171 | memcpy(outbuffer + offset, this->status_message, length_status_message); |
scarter1 | 0:020db18a476d | 172 | offset += length_status_message; |
scarter1 | 0:020db18a476d | 173 | return offset; |
scarter1 | 0:020db18a476d | 174 | } |
scarter1 | 0:020db18a476d | 175 | |
scarter1 | 0:020db18a476d | 176 | virtual int deserialize(unsigned char *inbuffer) |
scarter1 | 0:020db18a476d | 177 | { |
scarter1 | 0:020db18a476d | 178 | int offset = 0; |
scarter1 | 0:020db18a476d | 179 | this->type = ((uint8_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 180 | offset += sizeof(this->type); |
scarter1 | 0:020db18a476d | 181 | uint32_t damping_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 182 | damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 183 | damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 184 | damping_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 185 | offset += sizeof(this->damping_length); |
scarter1 | 0:020db18a476d | 186 | if(damping_lengthT > damping_length) |
scarter1 | 0:020db18a476d | 187 | this->damping = (double*)realloc(this->damping, damping_lengthT * sizeof(double)); |
scarter1 | 0:020db18a476d | 188 | damping_length = damping_lengthT; |
scarter1 | 0:020db18a476d | 189 | for( uint32_t i = 0; i < damping_length; i++){ |
scarter1 | 0:020db18a476d | 190 | union { |
scarter1 | 0:020db18a476d | 191 | double real; |
scarter1 | 0:020db18a476d | 192 | uint64_t base; |
scarter1 | 0:020db18a476d | 193 | } u_st_damping; |
scarter1 | 0:020db18a476d | 194 | u_st_damping.base = 0; |
scarter1 | 0:020db18a476d | 195 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); |
scarter1 | 0:020db18a476d | 196 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 197 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 198 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 199 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); |
scarter1 | 0:020db18a476d | 200 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); |
scarter1 | 0:020db18a476d | 201 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); |
scarter1 | 0:020db18a476d | 202 | u_st_damping.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); |
scarter1 | 0:020db18a476d | 203 | this->st_damping = u_st_damping.real; |
scarter1 | 0:020db18a476d | 204 | offset += sizeof(this->st_damping); |
scarter1 | 0:020db18a476d | 205 | memcpy( &(this->damping[i]), &(this->st_damping), sizeof(double)); |
scarter1 | 0:020db18a476d | 206 | } |
scarter1 | 0:020db18a476d | 207 | uint32_t position_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 208 | position_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 209 | position_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 210 | position_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 211 | offset += sizeof(this->position_length); |
scarter1 | 0:020db18a476d | 212 | if(position_lengthT > position_length) |
scarter1 | 0:020db18a476d | 213 | this->position = (double*)realloc(this->position, position_lengthT * sizeof(double)); |
scarter1 | 0:020db18a476d | 214 | position_length = position_lengthT; |
scarter1 | 0:020db18a476d | 215 | for( uint32_t i = 0; i < position_length; i++){ |
scarter1 | 0:020db18a476d | 216 | union { |
scarter1 | 0:020db18a476d | 217 | double real; |
scarter1 | 0:020db18a476d | 218 | uint64_t base; |
scarter1 | 0:020db18a476d | 219 | } u_st_position; |
scarter1 | 0:020db18a476d | 220 | u_st_position.base = 0; |
scarter1 | 0:020db18a476d | 221 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); |
scarter1 | 0:020db18a476d | 222 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 223 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 224 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 225 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); |
scarter1 | 0:020db18a476d | 226 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); |
scarter1 | 0:020db18a476d | 227 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); |
scarter1 | 0:020db18a476d | 228 | u_st_position.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); |
scarter1 | 0:020db18a476d | 229 | this->st_position = u_st_position.real; |
scarter1 | 0:020db18a476d | 230 | offset += sizeof(this->st_position); |
scarter1 | 0:020db18a476d | 231 | memcpy( &(this->position[i]), &(this->st_position), sizeof(double)); |
scarter1 | 0:020db18a476d | 232 | } |
scarter1 | 0:020db18a476d | 233 | uint32_t rate_lengthT = ((uint32_t) (*(inbuffer + offset))); |
scarter1 | 0:020db18a476d | 234 | rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 235 | rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 236 | rate_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 237 | offset += sizeof(this->rate_length); |
scarter1 | 0:020db18a476d | 238 | if(rate_lengthT > rate_length) |
scarter1 | 0:020db18a476d | 239 | this->rate = (double*)realloc(this->rate, rate_lengthT * sizeof(double)); |
scarter1 | 0:020db18a476d | 240 | rate_length = rate_lengthT; |
scarter1 | 0:020db18a476d | 241 | for( uint32_t i = 0; i < rate_length; i++){ |
scarter1 | 0:020db18a476d | 242 | union { |
scarter1 | 0:020db18a476d | 243 | double real; |
scarter1 | 0:020db18a476d | 244 | uint64_t base; |
scarter1 | 0:020db18a476d | 245 | } u_st_rate; |
scarter1 | 0:020db18a476d | 246 | u_st_rate.base = 0; |
scarter1 | 0:020db18a476d | 247 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); |
scarter1 | 0:020db18a476d | 248 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); |
scarter1 | 0:020db18a476d | 249 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); |
scarter1 | 0:020db18a476d | 250 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); |
scarter1 | 0:020db18a476d | 251 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); |
scarter1 | 0:020db18a476d | 252 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); |
scarter1 | 0:020db18a476d | 253 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); |
scarter1 | 0:020db18a476d | 254 | u_st_rate.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); |
scarter1 | 0:020db18a476d | 255 | this->st_rate = u_st_rate.real; |
scarter1 | 0:020db18a476d | 256 | offset += sizeof(this->st_rate); |
scarter1 | 0:020db18a476d | 257 | memcpy( &(this->rate[i]), &(this->st_rate), sizeof(double)); |
scarter1 | 0:020db18a476d | 258 | } |
scarter1 | 0:020db18a476d | 259 | union { |
scarter1 | 0:020db18a476d | 260 | bool real; |
scarter1 | 0:020db18a476d | 261 | uint8_t base; |
scarter1 | 0:020db18a476d | 262 | } u_success; |
scarter1 | 0:020db18a476d | 263 | u_success.base = 0; |
scarter1 | 0:020db18a476d | 264 | u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
scarter1 | 0:020db18a476d | 265 | this->success = u_success.real; |
scarter1 | 0:020db18a476d | 266 | offset += sizeof(this->success); |
scarter1 | 0:020db18a476d | 267 | uint32_t length_status_message; |
scarter1 | 0:020db18a476d | 268 | arrToVar(length_status_message, (inbuffer + offset)); |
scarter1 | 0:020db18a476d | 269 | offset += 4; |
scarter1 | 0:020db18a476d | 270 | for(unsigned int k= offset; k< offset+length_status_message; ++k){ |
scarter1 | 0:020db18a476d | 271 | inbuffer[k-1]=inbuffer[k]; |
scarter1 | 0:020db18a476d | 272 | } |
scarter1 | 0:020db18a476d | 273 | inbuffer[offset+length_status_message-1]=0; |
scarter1 | 0:020db18a476d | 274 | this->status_message = (char *)(inbuffer + offset-1); |
scarter1 | 0:020db18a476d | 275 | offset += length_status_message; |
scarter1 | 0:020db18a476d | 276 | return offset; |
scarter1 | 0:020db18a476d | 277 | } |
scarter1 | 0:020db18a476d | 278 | |
scarter1 | 0:020db18a476d | 279 | const char * getType(){ return GETJOINTPROPERTIES; }; |
scarter1 | 0:020db18a476d | 280 | const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; |
scarter1 | 0:020db18a476d | 281 | |
scarter1 | 0:020db18a476d | 282 | }; |
scarter1 | 0:020db18a476d | 283 | |
scarter1 | 0:020db18a476d | 284 | class GetJointProperties { |
scarter1 | 0:020db18a476d | 285 | public: |
scarter1 | 0:020db18a476d | 286 | typedef GetJointPropertiesRequest Request; |
scarter1 | 0:020db18a476d | 287 | typedef GetJointPropertiesResponse Response; |
scarter1 | 0:020db18a476d | 288 | }; |
scarter1 | 0:020db18a476d | 289 | |
scarter1 | 0:020db18a476d | 290 | } |
scarter1 | 0:020db18a476d | 291 | #endif |