rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
pr2_mechanism_msgs/ActuatorStatistics.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_pr2_mechanism_msgs_ActuatorStatistics_h |
akashvibhute | 0:30537dec6e0b | 2 | #define _ROS_pr2_mechanism_msgs_ActuatorStatistics_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 | #include "ros/time.h" |
akashvibhute | 0:30537dec6e0b | 9 | |
akashvibhute | 0:30537dec6e0b | 10 | namespace pr2_mechanism_msgs |
akashvibhute | 0:30537dec6e0b | 11 | { |
akashvibhute | 0:30537dec6e0b | 12 | |
akashvibhute | 0:30537dec6e0b | 13 | class ActuatorStatistics : public ros::Msg |
akashvibhute | 0:30537dec6e0b | 14 | { |
akashvibhute | 0:30537dec6e0b | 15 | public: |
akashvibhute | 0:30537dec6e0b | 16 | const char* name; |
akashvibhute | 0:30537dec6e0b | 17 | int32_t device_id; |
akashvibhute | 0:30537dec6e0b | 18 | ros::Time timestamp; |
akashvibhute | 0:30537dec6e0b | 19 | int32_t encoder_count; |
akashvibhute | 0:30537dec6e0b | 20 | float encoder_offset; |
akashvibhute | 0:30537dec6e0b | 21 | float position; |
akashvibhute | 0:30537dec6e0b | 22 | float encoder_velocity; |
akashvibhute | 0:30537dec6e0b | 23 | float velocity; |
akashvibhute | 0:30537dec6e0b | 24 | bool calibration_reading; |
akashvibhute | 0:30537dec6e0b | 25 | bool calibration_rising_edge_valid; |
akashvibhute | 0:30537dec6e0b | 26 | bool calibration_falling_edge_valid; |
akashvibhute | 0:30537dec6e0b | 27 | float last_calibration_rising_edge; |
akashvibhute | 0:30537dec6e0b | 28 | float last_calibration_falling_edge; |
akashvibhute | 0:30537dec6e0b | 29 | bool is_enabled; |
akashvibhute | 0:30537dec6e0b | 30 | bool halted; |
akashvibhute | 0:30537dec6e0b | 31 | float last_commanded_current; |
akashvibhute | 0:30537dec6e0b | 32 | float last_commanded_effort; |
akashvibhute | 0:30537dec6e0b | 33 | float last_executed_current; |
akashvibhute | 0:30537dec6e0b | 34 | float last_executed_effort; |
akashvibhute | 0:30537dec6e0b | 35 | float last_measured_current; |
akashvibhute | 0:30537dec6e0b | 36 | float last_measured_effort; |
akashvibhute | 0:30537dec6e0b | 37 | float motor_voltage; |
akashvibhute | 0:30537dec6e0b | 38 | int32_t num_encoder_errors; |
akashvibhute | 0:30537dec6e0b | 39 | |
akashvibhute | 0:30537dec6e0b | 40 | ActuatorStatistics(): |
akashvibhute | 0:30537dec6e0b | 41 | name(""), |
akashvibhute | 0:30537dec6e0b | 42 | device_id(0), |
akashvibhute | 0:30537dec6e0b | 43 | timestamp(), |
akashvibhute | 0:30537dec6e0b | 44 | encoder_count(0), |
akashvibhute | 0:30537dec6e0b | 45 | encoder_offset(0), |
akashvibhute | 0:30537dec6e0b | 46 | position(0), |
akashvibhute | 0:30537dec6e0b | 47 | encoder_velocity(0), |
akashvibhute | 0:30537dec6e0b | 48 | velocity(0), |
akashvibhute | 0:30537dec6e0b | 49 | calibration_reading(0), |
akashvibhute | 0:30537dec6e0b | 50 | calibration_rising_edge_valid(0), |
akashvibhute | 0:30537dec6e0b | 51 | calibration_falling_edge_valid(0), |
akashvibhute | 0:30537dec6e0b | 52 | last_calibration_rising_edge(0), |
akashvibhute | 0:30537dec6e0b | 53 | last_calibration_falling_edge(0), |
akashvibhute | 0:30537dec6e0b | 54 | is_enabled(0), |
akashvibhute | 0:30537dec6e0b | 55 | halted(0), |
akashvibhute | 0:30537dec6e0b | 56 | last_commanded_current(0), |
akashvibhute | 0:30537dec6e0b | 57 | last_commanded_effort(0), |
akashvibhute | 0:30537dec6e0b | 58 | last_executed_current(0), |
akashvibhute | 0:30537dec6e0b | 59 | last_executed_effort(0), |
akashvibhute | 0:30537dec6e0b | 60 | last_measured_current(0), |
akashvibhute | 0:30537dec6e0b | 61 | last_measured_effort(0), |
akashvibhute | 0:30537dec6e0b | 62 | motor_voltage(0), |
akashvibhute | 0:30537dec6e0b | 63 | num_encoder_errors(0) |
akashvibhute | 0:30537dec6e0b | 64 | { |
akashvibhute | 0:30537dec6e0b | 65 | } |
akashvibhute | 0:30537dec6e0b | 66 | |
akashvibhute | 0:30537dec6e0b | 67 | virtual int serialize(unsigned char *outbuffer) const |
akashvibhute | 0:30537dec6e0b | 68 | { |
akashvibhute | 0:30537dec6e0b | 69 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 70 | uint32_t length_name = strlen(this->name); |
akashvibhute | 0:30537dec6e0b | 71 | memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); |
akashvibhute | 0:30537dec6e0b | 72 | offset += 4; |
akashvibhute | 0:30537dec6e0b | 73 | memcpy(outbuffer + offset, this->name, length_name); |
akashvibhute | 0:30537dec6e0b | 74 | offset += length_name; |
akashvibhute | 0:30537dec6e0b | 75 | union { |
akashvibhute | 0:30537dec6e0b | 76 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 77 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 78 | } u_device_id; |
akashvibhute | 0:30537dec6e0b | 79 | u_device_id.real = this->device_id; |
akashvibhute | 0:30537dec6e0b | 80 | *(outbuffer + offset + 0) = (u_device_id.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 81 | *(outbuffer + offset + 1) = (u_device_id.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 82 | *(outbuffer + offset + 2) = (u_device_id.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 83 | *(outbuffer + offset + 3) = (u_device_id.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 84 | offset += sizeof(this->device_id); |
akashvibhute | 0:30537dec6e0b | 85 | *(outbuffer + offset + 0) = (this->timestamp.sec >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 86 | *(outbuffer + offset + 1) = (this->timestamp.sec >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 87 | *(outbuffer + offset + 2) = (this->timestamp.sec >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 88 | *(outbuffer + offset + 3) = (this->timestamp.sec >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 89 | offset += sizeof(this->timestamp.sec); |
akashvibhute | 0:30537dec6e0b | 90 | *(outbuffer + offset + 0) = (this->timestamp.nsec >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 91 | *(outbuffer + offset + 1) = (this->timestamp.nsec >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 92 | *(outbuffer + offset + 2) = (this->timestamp.nsec >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 93 | *(outbuffer + offset + 3) = (this->timestamp.nsec >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 94 | offset += sizeof(this->timestamp.nsec); |
akashvibhute | 0:30537dec6e0b | 95 | union { |
akashvibhute | 0:30537dec6e0b | 96 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 97 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 98 | } u_encoder_count; |
akashvibhute | 0:30537dec6e0b | 99 | u_encoder_count.real = this->encoder_count; |
akashvibhute | 0:30537dec6e0b | 100 | *(outbuffer + offset + 0) = (u_encoder_count.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 101 | *(outbuffer + offset + 1) = (u_encoder_count.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 102 | *(outbuffer + offset + 2) = (u_encoder_count.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 103 | *(outbuffer + offset + 3) = (u_encoder_count.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 104 | offset += sizeof(this->encoder_count); |
akashvibhute | 0:30537dec6e0b | 105 | offset += serializeAvrFloat64(outbuffer + offset, this->encoder_offset); |
akashvibhute | 0:30537dec6e0b | 106 | offset += serializeAvrFloat64(outbuffer + offset, this->position); |
akashvibhute | 0:30537dec6e0b | 107 | offset += serializeAvrFloat64(outbuffer + offset, this->encoder_velocity); |
akashvibhute | 0:30537dec6e0b | 108 | offset += serializeAvrFloat64(outbuffer + offset, this->velocity); |
akashvibhute | 0:30537dec6e0b | 109 | union { |
akashvibhute | 0:30537dec6e0b | 110 | bool real; |
akashvibhute | 0:30537dec6e0b | 111 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 112 | } u_calibration_reading; |
akashvibhute | 0:30537dec6e0b | 113 | u_calibration_reading.real = this->calibration_reading; |
akashvibhute | 0:30537dec6e0b | 114 | *(outbuffer + offset + 0) = (u_calibration_reading.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 115 | offset += sizeof(this->calibration_reading); |
akashvibhute | 0:30537dec6e0b | 116 | union { |
akashvibhute | 0:30537dec6e0b | 117 | bool real; |
akashvibhute | 0:30537dec6e0b | 118 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 119 | } u_calibration_rising_edge_valid; |
akashvibhute | 0:30537dec6e0b | 120 | u_calibration_rising_edge_valid.real = this->calibration_rising_edge_valid; |
akashvibhute | 0:30537dec6e0b | 121 | *(outbuffer + offset + 0) = (u_calibration_rising_edge_valid.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 122 | offset += sizeof(this->calibration_rising_edge_valid); |
akashvibhute | 0:30537dec6e0b | 123 | union { |
akashvibhute | 0:30537dec6e0b | 124 | bool real; |
akashvibhute | 0:30537dec6e0b | 125 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 126 | } u_calibration_falling_edge_valid; |
akashvibhute | 0:30537dec6e0b | 127 | u_calibration_falling_edge_valid.real = this->calibration_falling_edge_valid; |
akashvibhute | 0:30537dec6e0b | 128 | *(outbuffer + offset + 0) = (u_calibration_falling_edge_valid.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 129 | offset += sizeof(this->calibration_falling_edge_valid); |
akashvibhute | 0:30537dec6e0b | 130 | offset += serializeAvrFloat64(outbuffer + offset, this->last_calibration_rising_edge); |
akashvibhute | 0:30537dec6e0b | 131 | offset += serializeAvrFloat64(outbuffer + offset, this->last_calibration_falling_edge); |
akashvibhute | 0:30537dec6e0b | 132 | union { |
akashvibhute | 0:30537dec6e0b | 133 | bool real; |
akashvibhute | 0:30537dec6e0b | 134 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 135 | } u_is_enabled; |
akashvibhute | 0:30537dec6e0b | 136 | u_is_enabled.real = this->is_enabled; |
akashvibhute | 0:30537dec6e0b | 137 | *(outbuffer + offset + 0) = (u_is_enabled.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 138 | offset += sizeof(this->is_enabled); |
akashvibhute | 0:30537dec6e0b | 139 | union { |
akashvibhute | 0:30537dec6e0b | 140 | bool real; |
akashvibhute | 0:30537dec6e0b | 141 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 142 | } u_halted; |
akashvibhute | 0:30537dec6e0b | 143 | u_halted.real = this->halted; |
akashvibhute | 0:30537dec6e0b | 144 | *(outbuffer + offset + 0) = (u_halted.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 145 | offset += sizeof(this->halted); |
akashvibhute | 0:30537dec6e0b | 146 | offset += serializeAvrFloat64(outbuffer + offset, this->last_commanded_current); |
akashvibhute | 0:30537dec6e0b | 147 | offset += serializeAvrFloat64(outbuffer + offset, this->last_commanded_effort); |
akashvibhute | 0:30537dec6e0b | 148 | offset += serializeAvrFloat64(outbuffer + offset, this->last_executed_current); |
akashvibhute | 0:30537dec6e0b | 149 | offset += serializeAvrFloat64(outbuffer + offset, this->last_executed_effort); |
akashvibhute | 0:30537dec6e0b | 150 | offset += serializeAvrFloat64(outbuffer + offset, this->last_measured_current); |
akashvibhute | 0:30537dec6e0b | 151 | offset += serializeAvrFloat64(outbuffer + offset, this->last_measured_effort); |
akashvibhute | 0:30537dec6e0b | 152 | offset += serializeAvrFloat64(outbuffer + offset, this->motor_voltage); |
akashvibhute | 0:30537dec6e0b | 153 | union { |
akashvibhute | 0:30537dec6e0b | 154 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 155 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 156 | } u_num_encoder_errors; |
akashvibhute | 0:30537dec6e0b | 157 | u_num_encoder_errors.real = this->num_encoder_errors; |
akashvibhute | 0:30537dec6e0b | 158 | *(outbuffer + offset + 0) = (u_num_encoder_errors.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 159 | *(outbuffer + offset + 1) = (u_num_encoder_errors.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 160 | *(outbuffer + offset + 2) = (u_num_encoder_errors.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 161 | *(outbuffer + offset + 3) = (u_num_encoder_errors.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 162 | offset += sizeof(this->num_encoder_errors); |
akashvibhute | 0:30537dec6e0b | 163 | return offset; |
akashvibhute | 0:30537dec6e0b | 164 | } |
akashvibhute | 0:30537dec6e0b | 165 | |
akashvibhute | 0:30537dec6e0b | 166 | virtual int deserialize(unsigned char *inbuffer) |
akashvibhute | 0:30537dec6e0b | 167 | { |
akashvibhute | 0:30537dec6e0b | 168 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 169 | uint32_t length_name; |
akashvibhute | 0:30537dec6e0b | 170 | memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); |
akashvibhute | 0:30537dec6e0b | 171 | offset += 4; |
akashvibhute | 0:30537dec6e0b | 172 | for(unsigned int k= offset; k< offset+length_name; ++k){ |
akashvibhute | 0:30537dec6e0b | 173 | inbuffer[k-1]=inbuffer[k]; |
akashvibhute | 0:30537dec6e0b | 174 | } |
akashvibhute | 0:30537dec6e0b | 175 | inbuffer[offset+length_name-1]=0; |
akashvibhute | 0:30537dec6e0b | 176 | this->name = (char *)(inbuffer + offset-1); |
akashvibhute | 0:30537dec6e0b | 177 | offset += length_name; |
akashvibhute | 0:30537dec6e0b | 178 | union { |
akashvibhute | 0:30537dec6e0b | 179 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 180 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 181 | } u_device_id; |
akashvibhute | 0:30537dec6e0b | 182 | u_device_id.base = 0; |
akashvibhute | 0:30537dec6e0b | 183 | u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 184 | u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 185 | u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 186 | u_device_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 187 | this->device_id = u_device_id.real; |
akashvibhute | 0:30537dec6e0b | 188 | offset += sizeof(this->device_id); |
akashvibhute | 0:30537dec6e0b | 189 | this->timestamp.sec = ((uint32_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 190 | this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 191 | this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 192 | this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 193 | offset += sizeof(this->timestamp.sec); |
akashvibhute | 0:30537dec6e0b | 194 | this->timestamp.nsec = ((uint32_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 195 | this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 196 | this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 197 | this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 198 | offset += sizeof(this->timestamp.nsec); |
akashvibhute | 0:30537dec6e0b | 199 | union { |
akashvibhute | 0:30537dec6e0b | 200 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 201 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 202 | } u_encoder_count; |
akashvibhute | 0:30537dec6e0b | 203 | u_encoder_count.base = 0; |
akashvibhute | 0:30537dec6e0b | 204 | u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 205 | u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 206 | u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 207 | u_encoder_count.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 208 | this->encoder_count = u_encoder_count.real; |
akashvibhute | 0:30537dec6e0b | 209 | offset += sizeof(this->encoder_count); |
akashvibhute | 0:30537dec6e0b | 210 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_offset)); |
akashvibhute | 0:30537dec6e0b | 211 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); |
akashvibhute | 0:30537dec6e0b | 212 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->encoder_velocity)); |
akashvibhute | 0:30537dec6e0b | 213 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); |
akashvibhute | 0:30537dec6e0b | 214 | union { |
akashvibhute | 0:30537dec6e0b | 215 | bool real; |
akashvibhute | 0:30537dec6e0b | 216 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 217 | } u_calibration_reading; |
akashvibhute | 0:30537dec6e0b | 218 | u_calibration_reading.base = 0; |
akashvibhute | 0:30537dec6e0b | 219 | u_calibration_reading.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 220 | this->calibration_reading = u_calibration_reading.real; |
akashvibhute | 0:30537dec6e0b | 221 | offset += sizeof(this->calibration_reading); |
akashvibhute | 0:30537dec6e0b | 222 | union { |
akashvibhute | 0:30537dec6e0b | 223 | bool real; |
akashvibhute | 0:30537dec6e0b | 224 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 225 | } u_calibration_rising_edge_valid; |
akashvibhute | 0:30537dec6e0b | 226 | u_calibration_rising_edge_valid.base = 0; |
akashvibhute | 0:30537dec6e0b | 227 | u_calibration_rising_edge_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 228 | this->calibration_rising_edge_valid = u_calibration_rising_edge_valid.real; |
akashvibhute | 0:30537dec6e0b | 229 | offset += sizeof(this->calibration_rising_edge_valid); |
akashvibhute | 0:30537dec6e0b | 230 | union { |
akashvibhute | 0:30537dec6e0b | 231 | bool real; |
akashvibhute | 0:30537dec6e0b | 232 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 233 | } u_calibration_falling_edge_valid; |
akashvibhute | 0:30537dec6e0b | 234 | u_calibration_falling_edge_valid.base = 0; |
akashvibhute | 0:30537dec6e0b | 235 | u_calibration_falling_edge_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 236 | this->calibration_falling_edge_valid = u_calibration_falling_edge_valid.real; |
akashvibhute | 0:30537dec6e0b | 237 | offset += sizeof(this->calibration_falling_edge_valid); |
akashvibhute | 0:30537dec6e0b | 238 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_calibration_rising_edge)); |
akashvibhute | 0:30537dec6e0b | 239 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_calibration_falling_edge)); |
akashvibhute | 0:30537dec6e0b | 240 | union { |
akashvibhute | 0:30537dec6e0b | 241 | bool real; |
akashvibhute | 0:30537dec6e0b | 242 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 243 | } u_is_enabled; |
akashvibhute | 0:30537dec6e0b | 244 | u_is_enabled.base = 0; |
akashvibhute | 0:30537dec6e0b | 245 | u_is_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 246 | this->is_enabled = u_is_enabled.real; |
akashvibhute | 0:30537dec6e0b | 247 | offset += sizeof(this->is_enabled); |
akashvibhute | 0:30537dec6e0b | 248 | union { |
akashvibhute | 0:30537dec6e0b | 249 | bool real; |
akashvibhute | 0:30537dec6e0b | 250 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 251 | } u_halted; |
akashvibhute | 0:30537dec6e0b | 252 | u_halted.base = 0; |
akashvibhute | 0:30537dec6e0b | 253 | u_halted.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 254 | this->halted = u_halted.real; |
akashvibhute | 0:30537dec6e0b | 255 | offset += sizeof(this->halted); |
akashvibhute | 0:30537dec6e0b | 256 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_commanded_current)); |
akashvibhute | 0:30537dec6e0b | 257 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_commanded_effort)); |
akashvibhute | 0:30537dec6e0b | 258 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_executed_current)); |
akashvibhute | 0:30537dec6e0b | 259 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_executed_effort)); |
akashvibhute | 0:30537dec6e0b | 260 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_measured_current)); |
akashvibhute | 0:30537dec6e0b | 261 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->last_measured_effort)); |
akashvibhute | 0:30537dec6e0b | 262 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->motor_voltage)); |
akashvibhute | 0:30537dec6e0b | 263 | union { |
akashvibhute | 0:30537dec6e0b | 264 | int32_t real; |
akashvibhute | 0:30537dec6e0b | 265 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 266 | } u_num_encoder_errors; |
akashvibhute | 0:30537dec6e0b | 267 | u_num_encoder_errors.base = 0; |
akashvibhute | 0:30537dec6e0b | 268 | u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 269 | u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 270 | u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 271 | u_num_encoder_errors.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 272 | this->num_encoder_errors = u_num_encoder_errors.real; |
akashvibhute | 0:30537dec6e0b | 273 | offset += sizeof(this->num_encoder_errors); |
akashvibhute | 0:30537dec6e0b | 274 | return offset; |
akashvibhute | 0:30537dec6e0b | 275 | } |
akashvibhute | 0:30537dec6e0b | 276 | |
akashvibhute | 0:30537dec6e0b | 277 | const char * getType(){ return "pr2_mechanism_msgs/ActuatorStatistics"; }; |
akashvibhute | 0:30537dec6e0b | 278 | const char * getMD5(){ return "c37184273b29627de29382f1d3670175"; }; |
akashvibhute | 0:30537dec6e0b | 279 | |
akashvibhute | 0:30537dec6e0b | 280 | }; |
akashvibhute | 0:30537dec6e0b | 281 | |
akashvibhute | 0:30537dec6e0b | 282 | } |
akashvibhute | 0:30537dec6e0b | 283 | #endif |