rosserial library for mbed Inspired by nucho's rosserial library This library is still under development
Dependents: mbed_roshydro_test
Library still under development!
ur_msgs/MasterboardDataMsg.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_ur_msgs_MasterboardDataMsg_h |
akashvibhute | 0:30537dec6e0b | 2 | #define _ROS_ur_msgs_MasterboardDataMsg_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 ur_msgs |
akashvibhute | 0:30537dec6e0b | 10 | { |
akashvibhute | 0:30537dec6e0b | 11 | |
akashvibhute | 0:30537dec6e0b | 12 | class MasterboardDataMsg : public ros::Msg |
akashvibhute | 0:30537dec6e0b | 13 | { |
akashvibhute | 0:30537dec6e0b | 14 | public: |
akashvibhute | 0:30537dec6e0b | 15 | int16_t digital_input_bits; |
akashvibhute | 0:30537dec6e0b | 16 | int16_t digital_output_bits; |
akashvibhute | 0:30537dec6e0b | 17 | int8_t analog_input_range0; |
akashvibhute | 0:30537dec6e0b | 18 | int8_t analog_input_range1; |
akashvibhute | 0:30537dec6e0b | 19 | float analog_input0; |
akashvibhute | 0:30537dec6e0b | 20 | float analog_input1; |
akashvibhute | 0:30537dec6e0b | 21 | int8_t analog_output_domain0; |
akashvibhute | 0:30537dec6e0b | 22 | int8_t analog_output_domain1; |
akashvibhute | 0:30537dec6e0b | 23 | float analog_output0; |
akashvibhute | 0:30537dec6e0b | 24 | float analog_output1; |
akashvibhute | 0:30537dec6e0b | 25 | float masterboard_temperature; |
akashvibhute | 0:30537dec6e0b | 26 | float robot_voltage_48V; |
akashvibhute | 0:30537dec6e0b | 27 | float robot_current; |
akashvibhute | 0:30537dec6e0b | 28 | float master_io_current; |
akashvibhute | 0:30537dec6e0b | 29 | uint8_t master_safety_state; |
akashvibhute | 0:30537dec6e0b | 30 | uint8_t master_onoff_state; |
akashvibhute | 0:30537dec6e0b | 31 | |
akashvibhute | 0:30537dec6e0b | 32 | MasterboardDataMsg(): |
akashvibhute | 0:30537dec6e0b | 33 | digital_input_bits(0), |
akashvibhute | 0:30537dec6e0b | 34 | digital_output_bits(0), |
akashvibhute | 0:30537dec6e0b | 35 | analog_input_range0(0), |
akashvibhute | 0:30537dec6e0b | 36 | analog_input_range1(0), |
akashvibhute | 0:30537dec6e0b | 37 | analog_input0(0), |
akashvibhute | 0:30537dec6e0b | 38 | analog_input1(0), |
akashvibhute | 0:30537dec6e0b | 39 | analog_output_domain0(0), |
akashvibhute | 0:30537dec6e0b | 40 | analog_output_domain1(0), |
akashvibhute | 0:30537dec6e0b | 41 | analog_output0(0), |
akashvibhute | 0:30537dec6e0b | 42 | analog_output1(0), |
akashvibhute | 0:30537dec6e0b | 43 | masterboard_temperature(0), |
akashvibhute | 0:30537dec6e0b | 44 | robot_voltage_48V(0), |
akashvibhute | 0:30537dec6e0b | 45 | robot_current(0), |
akashvibhute | 0:30537dec6e0b | 46 | master_io_current(0), |
akashvibhute | 0:30537dec6e0b | 47 | master_safety_state(0), |
akashvibhute | 0:30537dec6e0b | 48 | master_onoff_state(0) |
akashvibhute | 0:30537dec6e0b | 49 | { |
akashvibhute | 0:30537dec6e0b | 50 | } |
akashvibhute | 0:30537dec6e0b | 51 | |
akashvibhute | 0:30537dec6e0b | 52 | virtual int serialize(unsigned char *outbuffer) const |
akashvibhute | 0:30537dec6e0b | 53 | { |
akashvibhute | 0:30537dec6e0b | 54 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 55 | union { |
akashvibhute | 0:30537dec6e0b | 56 | int16_t real; |
akashvibhute | 0:30537dec6e0b | 57 | uint16_t base; |
akashvibhute | 0:30537dec6e0b | 58 | } u_digital_input_bits; |
akashvibhute | 0:30537dec6e0b | 59 | u_digital_input_bits.real = this->digital_input_bits; |
akashvibhute | 0:30537dec6e0b | 60 | *(outbuffer + offset + 0) = (u_digital_input_bits.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 61 | *(outbuffer + offset + 1) = (u_digital_input_bits.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 62 | offset += sizeof(this->digital_input_bits); |
akashvibhute | 0:30537dec6e0b | 63 | union { |
akashvibhute | 0:30537dec6e0b | 64 | int16_t real; |
akashvibhute | 0:30537dec6e0b | 65 | uint16_t base; |
akashvibhute | 0:30537dec6e0b | 66 | } u_digital_output_bits; |
akashvibhute | 0:30537dec6e0b | 67 | u_digital_output_bits.real = this->digital_output_bits; |
akashvibhute | 0:30537dec6e0b | 68 | *(outbuffer + offset + 0) = (u_digital_output_bits.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 69 | *(outbuffer + offset + 1) = (u_digital_output_bits.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 70 | offset += sizeof(this->digital_output_bits); |
akashvibhute | 0:30537dec6e0b | 71 | union { |
akashvibhute | 0:30537dec6e0b | 72 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 73 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 74 | } u_analog_input_range0; |
akashvibhute | 0:30537dec6e0b | 75 | u_analog_input_range0.real = this->analog_input_range0; |
akashvibhute | 0:30537dec6e0b | 76 | *(outbuffer + offset + 0) = (u_analog_input_range0.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 77 | offset += sizeof(this->analog_input_range0); |
akashvibhute | 0:30537dec6e0b | 78 | union { |
akashvibhute | 0:30537dec6e0b | 79 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 80 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 81 | } u_analog_input_range1; |
akashvibhute | 0:30537dec6e0b | 82 | u_analog_input_range1.real = this->analog_input_range1; |
akashvibhute | 0:30537dec6e0b | 83 | *(outbuffer + offset + 0) = (u_analog_input_range1.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 84 | offset += sizeof(this->analog_input_range1); |
akashvibhute | 0:30537dec6e0b | 85 | offset += serializeAvrFloat64(outbuffer + offset, this->analog_input0); |
akashvibhute | 0:30537dec6e0b | 86 | offset += serializeAvrFloat64(outbuffer + offset, this->analog_input1); |
akashvibhute | 0:30537dec6e0b | 87 | union { |
akashvibhute | 0:30537dec6e0b | 88 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 89 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 90 | } u_analog_output_domain0; |
akashvibhute | 0:30537dec6e0b | 91 | u_analog_output_domain0.real = this->analog_output_domain0; |
akashvibhute | 0:30537dec6e0b | 92 | *(outbuffer + offset + 0) = (u_analog_output_domain0.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 93 | offset += sizeof(this->analog_output_domain0); |
akashvibhute | 0:30537dec6e0b | 94 | union { |
akashvibhute | 0:30537dec6e0b | 95 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 96 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 97 | } u_analog_output_domain1; |
akashvibhute | 0:30537dec6e0b | 98 | u_analog_output_domain1.real = this->analog_output_domain1; |
akashvibhute | 0:30537dec6e0b | 99 | *(outbuffer + offset + 0) = (u_analog_output_domain1.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 100 | offset += sizeof(this->analog_output_domain1); |
akashvibhute | 0:30537dec6e0b | 101 | offset += serializeAvrFloat64(outbuffer + offset, this->analog_output0); |
akashvibhute | 0:30537dec6e0b | 102 | offset += serializeAvrFloat64(outbuffer + offset, this->analog_output1); |
akashvibhute | 0:30537dec6e0b | 103 | union { |
akashvibhute | 0:30537dec6e0b | 104 | float real; |
akashvibhute | 0:30537dec6e0b | 105 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 106 | } u_masterboard_temperature; |
akashvibhute | 0:30537dec6e0b | 107 | u_masterboard_temperature.real = this->masterboard_temperature; |
akashvibhute | 0:30537dec6e0b | 108 | *(outbuffer + offset + 0) = (u_masterboard_temperature.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 109 | *(outbuffer + offset + 1) = (u_masterboard_temperature.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 110 | *(outbuffer + offset + 2) = (u_masterboard_temperature.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 111 | *(outbuffer + offset + 3) = (u_masterboard_temperature.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 112 | offset += sizeof(this->masterboard_temperature); |
akashvibhute | 0:30537dec6e0b | 113 | union { |
akashvibhute | 0:30537dec6e0b | 114 | float real; |
akashvibhute | 0:30537dec6e0b | 115 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 116 | } u_robot_voltage_48V; |
akashvibhute | 0:30537dec6e0b | 117 | u_robot_voltage_48V.real = this->robot_voltage_48V; |
akashvibhute | 0:30537dec6e0b | 118 | *(outbuffer + offset + 0) = (u_robot_voltage_48V.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 119 | *(outbuffer + offset + 1) = (u_robot_voltage_48V.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 120 | *(outbuffer + offset + 2) = (u_robot_voltage_48V.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 121 | *(outbuffer + offset + 3) = (u_robot_voltage_48V.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 122 | offset += sizeof(this->robot_voltage_48V); |
akashvibhute | 0:30537dec6e0b | 123 | union { |
akashvibhute | 0:30537dec6e0b | 124 | float real; |
akashvibhute | 0:30537dec6e0b | 125 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 126 | } u_robot_current; |
akashvibhute | 0:30537dec6e0b | 127 | u_robot_current.real = this->robot_current; |
akashvibhute | 0:30537dec6e0b | 128 | *(outbuffer + offset + 0) = (u_robot_current.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 129 | *(outbuffer + offset + 1) = (u_robot_current.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 130 | *(outbuffer + offset + 2) = (u_robot_current.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 131 | *(outbuffer + offset + 3) = (u_robot_current.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 132 | offset += sizeof(this->robot_current); |
akashvibhute | 0:30537dec6e0b | 133 | union { |
akashvibhute | 0:30537dec6e0b | 134 | float real; |
akashvibhute | 0:30537dec6e0b | 135 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 136 | } u_master_io_current; |
akashvibhute | 0:30537dec6e0b | 137 | u_master_io_current.real = this->master_io_current; |
akashvibhute | 0:30537dec6e0b | 138 | *(outbuffer + offset + 0) = (u_master_io_current.base >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 139 | *(outbuffer + offset + 1) = (u_master_io_current.base >> (8 * 1)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 140 | *(outbuffer + offset + 2) = (u_master_io_current.base >> (8 * 2)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 141 | *(outbuffer + offset + 3) = (u_master_io_current.base >> (8 * 3)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 142 | offset += sizeof(this->master_io_current); |
akashvibhute | 0:30537dec6e0b | 143 | *(outbuffer + offset + 0) = (this->master_safety_state >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 144 | offset += sizeof(this->master_safety_state); |
akashvibhute | 0:30537dec6e0b | 145 | *(outbuffer + offset + 0) = (this->master_onoff_state >> (8 * 0)) & 0xFF; |
akashvibhute | 0:30537dec6e0b | 146 | offset += sizeof(this->master_onoff_state); |
akashvibhute | 0:30537dec6e0b | 147 | return offset; |
akashvibhute | 0:30537dec6e0b | 148 | } |
akashvibhute | 0:30537dec6e0b | 149 | |
akashvibhute | 0:30537dec6e0b | 150 | virtual int deserialize(unsigned char *inbuffer) |
akashvibhute | 0:30537dec6e0b | 151 | { |
akashvibhute | 0:30537dec6e0b | 152 | int offset = 0; |
akashvibhute | 0:30537dec6e0b | 153 | union { |
akashvibhute | 0:30537dec6e0b | 154 | int16_t real; |
akashvibhute | 0:30537dec6e0b | 155 | uint16_t base; |
akashvibhute | 0:30537dec6e0b | 156 | } u_digital_input_bits; |
akashvibhute | 0:30537dec6e0b | 157 | u_digital_input_bits.base = 0; |
akashvibhute | 0:30537dec6e0b | 158 | u_digital_input_bits.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 159 | u_digital_input_bits.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 160 | this->digital_input_bits = u_digital_input_bits.real; |
akashvibhute | 0:30537dec6e0b | 161 | offset += sizeof(this->digital_input_bits); |
akashvibhute | 0:30537dec6e0b | 162 | union { |
akashvibhute | 0:30537dec6e0b | 163 | int16_t real; |
akashvibhute | 0:30537dec6e0b | 164 | uint16_t base; |
akashvibhute | 0:30537dec6e0b | 165 | } u_digital_output_bits; |
akashvibhute | 0:30537dec6e0b | 166 | u_digital_output_bits.base = 0; |
akashvibhute | 0:30537dec6e0b | 167 | u_digital_output_bits.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 168 | u_digital_output_bits.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 169 | this->digital_output_bits = u_digital_output_bits.real; |
akashvibhute | 0:30537dec6e0b | 170 | offset += sizeof(this->digital_output_bits); |
akashvibhute | 0:30537dec6e0b | 171 | union { |
akashvibhute | 0:30537dec6e0b | 172 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 173 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 174 | } u_analog_input_range0; |
akashvibhute | 0:30537dec6e0b | 175 | u_analog_input_range0.base = 0; |
akashvibhute | 0:30537dec6e0b | 176 | u_analog_input_range0.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 177 | this->analog_input_range0 = u_analog_input_range0.real; |
akashvibhute | 0:30537dec6e0b | 178 | offset += sizeof(this->analog_input_range0); |
akashvibhute | 0:30537dec6e0b | 179 | union { |
akashvibhute | 0:30537dec6e0b | 180 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 181 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 182 | } u_analog_input_range1; |
akashvibhute | 0:30537dec6e0b | 183 | u_analog_input_range1.base = 0; |
akashvibhute | 0:30537dec6e0b | 184 | u_analog_input_range1.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 185 | this->analog_input_range1 = u_analog_input_range1.real; |
akashvibhute | 0:30537dec6e0b | 186 | offset += sizeof(this->analog_input_range1); |
akashvibhute | 0:30537dec6e0b | 187 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->analog_input0)); |
akashvibhute | 0:30537dec6e0b | 188 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->analog_input1)); |
akashvibhute | 0:30537dec6e0b | 189 | union { |
akashvibhute | 0:30537dec6e0b | 190 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 191 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 192 | } u_analog_output_domain0; |
akashvibhute | 0:30537dec6e0b | 193 | u_analog_output_domain0.base = 0; |
akashvibhute | 0:30537dec6e0b | 194 | u_analog_output_domain0.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 195 | this->analog_output_domain0 = u_analog_output_domain0.real; |
akashvibhute | 0:30537dec6e0b | 196 | offset += sizeof(this->analog_output_domain0); |
akashvibhute | 0:30537dec6e0b | 197 | union { |
akashvibhute | 0:30537dec6e0b | 198 | int8_t real; |
akashvibhute | 0:30537dec6e0b | 199 | uint8_t base; |
akashvibhute | 0:30537dec6e0b | 200 | } u_analog_output_domain1; |
akashvibhute | 0:30537dec6e0b | 201 | u_analog_output_domain1.base = 0; |
akashvibhute | 0:30537dec6e0b | 202 | u_analog_output_domain1.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 203 | this->analog_output_domain1 = u_analog_output_domain1.real; |
akashvibhute | 0:30537dec6e0b | 204 | offset += sizeof(this->analog_output_domain1); |
akashvibhute | 0:30537dec6e0b | 205 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->analog_output0)); |
akashvibhute | 0:30537dec6e0b | 206 | offset += deserializeAvrFloat64(inbuffer + offset, &(this->analog_output1)); |
akashvibhute | 0:30537dec6e0b | 207 | union { |
akashvibhute | 0:30537dec6e0b | 208 | float real; |
akashvibhute | 0:30537dec6e0b | 209 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 210 | } u_masterboard_temperature; |
akashvibhute | 0:30537dec6e0b | 211 | u_masterboard_temperature.base = 0; |
akashvibhute | 0:30537dec6e0b | 212 | u_masterboard_temperature.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 213 | u_masterboard_temperature.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 214 | u_masterboard_temperature.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 215 | u_masterboard_temperature.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 216 | this->masterboard_temperature = u_masterboard_temperature.real; |
akashvibhute | 0:30537dec6e0b | 217 | offset += sizeof(this->masterboard_temperature); |
akashvibhute | 0:30537dec6e0b | 218 | union { |
akashvibhute | 0:30537dec6e0b | 219 | float real; |
akashvibhute | 0:30537dec6e0b | 220 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 221 | } u_robot_voltage_48V; |
akashvibhute | 0:30537dec6e0b | 222 | u_robot_voltage_48V.base = 0; |
akashvibhute | 0:30537dec6e0b | 223 | u_robot_voltage_48V.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 224 | u_robot_voltage_48V.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 225 | u_robot_voltage_48V.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 226 | u_robot_voltage_48V.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 227 | this->robot_voltage_48V = u_robot_voltage_48V.real; |
akashvibhute | 0:30537dec6e0b | 228 | offset += sizeof(this->robot_voltage_48V); |
akashvibhute | 0:30537dec6e0b | 229 | union { |
akashvibhute | 0:30537dec6e0b | 230 | float real; |
akashvibhute | 0:30537dec6e0b | 231 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 232 | } u_robot_current; |
akashvibhute | 0:30537dec6e0b | 233 | u_robot_current.base = 0; |
akashvibhute | 0:30537dec6e0b | 234 | u_robot_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 235 | u_robot_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 236 | u_robot_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 237 | u_robot_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 238 | this->robot_current = u_robot_current.real; |
akashvibhute | 0:30537dec6e0b | 239 | offset += sizeof(this->robot_current); |
akashvibhute | 0:30537dec6e0b | 240 | union { |
akashvibhute | 0:30537dec6e0b | 241 | float real; |
akashvibhute | 0:30537dec6e0b | 242 | uint32_t base; |
akashvibhute | 0:30537dec6e0b | 243 | } u_master_io_current; |
akashvibhute | 0:30537dec6e0b | 244 | u_master_io_current.base = 0; |
akashvibhute | 0:30537dec6e0b | 245 | u_master_io_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
akashvibhute | 0:30537dec6e0b | 246 | u_master_io_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
akashvibhute | 0:30537dec6e0b | 247 | u_master_io_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
akashvibhute | 0:30537dec6e0b | 248 | u_master_io_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
akashvibhute | 0:30537dec6e0b | 249 | this->master_io_current = u_master_io_current.real; |
akashvibhute | 0:30537dec6e0b | 250 | offset += sizeof(this->master_io_current); |
akashvibhute | 0:30537dec6e0b | 251 | this->master_safety_state = ((uint8_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 252 | offset += sizeof(this->master_safety_state); |
akashvibhute | 0:30537dec6e0b | 253 | this->master_onoff_state = ((uint8_t) (*(inbuffer + offset))); |
akashvibhute | 0:30537dec6e0b | 254 | offset += sizeof(this->master_onoff_state); |
akashvibhute | 0:30537dec6e0b | 255 | return offset; |
akashvibhute | 0:30537dec6e0b | 256 | } |
akashvibhute | 0:30537dec6e0b | 257 | |
akashvibhute | 0:30537dec6e0b | 258 | const char * getType(){ return "ur_msgs/MasterboardDataMsg"; }; |
akashvibhute | 0:30537dec6e0b | 259 | const char * getMD5(){ return "a4aa4d8ccbd10a18ef4008b679f6ccbe"; }; |
akashvibhute | 0:30537dec6e0b | 260 | |
akashvibhute | 0:30537dec6e0b | 261 | }; |
akashvibhute | 0:30537dec6e0b | 262 | |
akashvibhute | 0:30537dec6e0b | 263 | } |
akashvibhute | 0:30537dec6e0b | 264 | #endif |