motor_message.h
Go to the documentation of this file.
1 
31 #ifndef MOTORMESSAGE_H
32 #define MOTORMESSAGE_H
33 
34 #include <stdint.h>
35 #include <boost/array.hpp>
36 #include <vector>
37 
38 typedef boost::array<uint8_t, 8> RawMotorMessage;
39 
40 // To support enhanced firmware we identify the fw version for new registers
41 // The idea is we do not want to make firmware message requests till a feature is supported
42 #define MIN_FW_RECOMMENDED 32
43 #define MIN_FW_MOT_POW_ACTIVE 32
44 #define MIN_FW_ESTOP_SUPPORT 32
45 #define MIN_FW_HW_VERSION_SET 32
46 #define MIN_FW_MAX_SPEED_AND_PWM 34
47 #define MIN_FW_ENC_6_STATE 35
48 #define MIN_FW_FIRMWARE_DATE 35
49 #define MIN_FW_DEADZONE 35
50 #define MIN_FW_PID_V_TERM 35
51 #define MIN_FW_SELFTESTS_REV1 36
52 #define MIN_FW_BATTERY_WARN 36
53 #define MIN_FW_PID_CONTROL_REV1 37
54 #define MIN_FW_WHEEL_TYPE_THIN 37
55 #define MIN_FW_SYSTEM_EVENTS 37
56 #define MIN_FW_OPTION_SWITCH 37
57 #define MIN_FW_PID_RDY_REGS 37
58 #define MIN_FW_WHEEL_DIRECTION 38
59 #define MIN_FW_WHEEL_NULL_ERROR 38
60 #define MIN_FW_PID_CONTROL_REV2 39
61 #define MIN_FW_DRIVE_TYPE 42 // Separated wheel type from drive type July 2021
62 #define MIN_FW_SUGGESTED 43 // We suggest this as the firmware to use if fw is lower revision
63 
64 // It is CRITICAL that the values in the Registers enum remain in sync with Firmware register numbers.
65 // In fact once a register is defined and released, it should NOT be re-used at a later time for another purpose
66 //
67 class MotorMessage {
68 public:
69  // Using default constructor and destructor
72 
73  // MessageTypes enum in class to avoid global namespace pollution
74  enum MessageTypes {
75  TYPE_READ = 0xA,
76  TYPE_WRITE = 0xB,
78  TYPE_ERROR = 0xD
79  };
80 
81  // Registers enum in class to avoid global namespace pollution
82  enum Registers {
83  REG_STOP_START = 0x00, // Deprecated
85  REG_SYSTEM_EVENTS = 0x02, // Indicates event bits such as a power on has happened. [v37]
86 
87  REG_LEFT_PWM = 0x03, // ReadOnly: Current M1 motor PWM setting. Right wheel, U101 rev 5.2
88  REG_RIGHT_PWM = 0x04, // ReadOnly: Current M2 motor PWM setting Left wheel, U1101 rev 5.2
89 
90  // skip 0x05 and 0x06
91 
92  REG_PWM_BOTH_WHLS = 0x07, // ReadOnly: Both Motor PWM packed as two 16-bit ints. M1 upper word
93  REG_TINT_BOTH_WHLS = 0x08, // ReadOnly: Both Motor Tic Interval packed as two 16-bit ints. M1 upper word
94 
95  REG_09 = 0x09, // Deprecated
96  REG_DRIVE_TYPE = 0x0A, // The type of wheel-motor in use [v42]
97  REG_RIGHT_RAMP = 0x0A, // Deprecated
98 
99  REG_WHEEL_NULL_ERR = 0x0b, // Resets current wheel(s) PID target of by current erro [v38]
100  REG_WHEEL_DIR = 0x0C, // Reverses wheel direction if not zero [v38]
101 
102  REG_DEADMAN = 0x0D, // Deadman timer (VERY TRICKY VALUE, USE WITH CARE!)
103 
104  REG_LEFT_CURRENT = 0x0E, // Electrical Current readback for M1 motor
105  REG_RIGHT_CURRENT = 0x0F, // Electrical Current readback for M2 motor
106 
107  REG_WHEEL_TYPE = 0x10, // Wheel type. Standard or as of 6-2020 Thin [v37]
108  REG_PID_ERROR_CAP = 0x11, // An error term cap used only if out of wack mode is active [v39]
109  REG_OPTION_SWITCH = 0x12, // Option switch bits read by host, returned to here. [v37]
110  REG_PWM_OVERRIDE = 0x13, // Override for PWM setting. Activated by a PID_CONTROL bit. [v36]
111  REG_PID_CONTROL = 0x14, // Control Pid param setup and calculations. [v36]
112 
113  // The PID parameters below are setup without impacting the PID loop then all made active at once
114  REG_PARAM_V_RDY = 0x15, // PID loop V factor being made ready but not in use yet [v37]
115  REG_PARAM_P_RDY = 0x16, // PID loop P factor being made ready but not in use yet [v37]
116  REG_PARAM_I_RDY = 0x17, // PID loop I factor being made ready but not in use yet [v37]
117  REG_PARAM_D_RDY = 0x18, // PID loop D factor being made ready but not in use yet [v37]
118  REG_PARAM_C_RDY = 0x19, // PID loop C factor being made ready but not in use yet [v37]
119 
120  // The PID parameters below are active values and they get set one register at a time
121  REG_PARAM_V = 0x1A, // PID loop V factor
122  REG_PARAM_P = 0x1B, // PID loop P factor
123  REG_PARAM_I = 0x1C, // PID loop I factor
124  REG_PARAM_D = 0x1D, // PID loop D factor
125  REG_PARAM_C = 0x1E, // PID loop C factor
126 
127  REG_LED_1 = 0x1F,
128  REG_LED_2 = 0x20,
129 
130  REG_HARDWARE_VERSION = 0x21, // Hardware version BUT is settable from HOST!
131  REG_FIRMWARE_VERSION = 0x22, // ReadOnly: Firmware version reported to HOST
132 
133  REG_BATTERY_VOLTAGE = 0x23, // Electrical voltage of main battery
134  REG_5V_MAIN_CURRENT = 0x24, // Electrical current in use on 5 Volt Main supply
135  REG_MAINV_TPOINT = 0x25, // TP. Indicates 5V, 12V main power and used for selftests. [v36]
136  REG_12V_MAIN_CURRENT = 0x26, // Electrical current in use on 12 Volt Main supply
137  REG_AUXV_TPOINT = 0x27, // TP. Indicates 5V, 12V aux power and used for selftests. [v36]
138 
139  REG_BATT_VOL_LOW = 0x28, // Battery divider ADC counts when battery is low
140  REG_VBUF_SIZ = 0x29, // Velocity averaging buffer length [v35]
141 
142  REG_BOTH_SPEED_SET = 0x2A, // Speed setting: Two signed 16-bit speeds set by user. Upper=left
143  REG_MOVING_BUF_SIZE = 0x2B, // PID loop moving average count. This caps at 100
144 
145  REG_LIMIT_REACHED = 0x2C, // Holds bits showing if some sort of limit was hit
146  REG_BOTH_ERROR = 0x2D, // Two 16-bit signed error values for PID loop current Error value
147  REG_BOTH_ODOM = 0x30, // Two 16-bit signed ODOM values
148  REG_ROBOT_ID = 0x31, // Type of robot. 0 for Magni or 1 for Loki
149 
150  REG_MOT_PWR_ACTIVE = 0x32, // Indicates if motor power is active (ESTOP not active)
151  REG_ESTOP_ENABLE = 0x33, // Normally non 0. If 0 forces motor controller firmware to NOT all ESTOP logic
152  REG_PID_MAX_ERROR = 0x34, // Used in pre rev 5.0 board crude ESTOP logic only. NOT rev 5
153 
154  REG_MAX_SPEED_FWD = 0x35, // Caps the max forward speed settable by user
155  REG_MAX_SPEED_REV = 0x36, // Caps the max reverse speed settable by user
156  REG_MAX_PWM = 0x37, // Caps max PWM value that will be used due to PID loop
157 
158  REG_HW_OPTIONS = 0x38, // ReadOnly: Shows options such as 3 or 6 state enc [v35]
159  REG_DEADZONE = 0x39, // When non-zero enables speed deadzone at zero speed
160  REG_FIRMWARE_DATE = 0x3a, // Hex encoded daycode such as 20190703 for July 3 2019 [v35]
161  REG_STEST_REQUEST = 0x3b, // Set to non-zero to request tests. Cleared after tests done. [v36]
162  REG_STEST_RESULTS = 0x3c, // Last Selftest result bits are left in this register. 0=ok [v36]
163 
164  DEBUG_50 = 0x50,
165  DEBUG_51 = 0x51,
166  DEBUG_52 = 0x52,
167  DEBUG_53 = 0x53,
168  DEBUG_54 = 0x54,
169  DEBUG_55 = 0x55,
170  DEBUG_56 = 0x56,
171  DEBUG_57 = 0x57,
172  DEBUG_58 = 0x58
173  };
174 
175  // PID Control values used in special register PID_CONTROL
178  PID_CTRL_RESET = 0x001, // Write this to this reg to do null of position error
179  PID_CTRL_PWM_OVERRIDE = 0x002, // When set we can directly set PWM. Used in testing
180  PID_CTRL_P_ONLY_ON_0_VEL = 0x004, // When velocity is zero just use P term for PID
181  PID_CTRL_USE_ONLY_P_TERM = 0x008, // Ignores I and D terms in PID calculations
182  PID_CTRL_SQUARED_ERROR = 0x010, // Use an error squared term for enhanced low error turns
183  PID_CTRL_CAP_POS_SETPOINT = 0x020, // PID ctrl mode that keeps from letting error be too high
184  PID_CTRL_BOOST_P_TERM = 0x040, // Boosts Proportional gain if set
185  PID_CTRL_BOOST_P_TURBO = 0x080, // If in boost mode this sets even higher gain boost
186  PID_CTRL_AUTOSHIFT_TO_SQUARED = 0x100, // Will shift to P squared mode if rotating
187  PID_CTRL_AUTOSHIFT_TO_BOOST_P = 0x200, // Will shift to a higher P factor if rotating
188  PID_CTRL_USE_VELOCITY_TERM = 0x800 // Allow a PID velocity term. IF it is 0 it has no effect
189  };
190 
191  // Bitfield values for hardware options enabled in the firmware
192  enum HwOptions {
194  OPT_WHEEL_TYPE_THIN = 0x02, // As of rev v37 we support a 'thin' wheel type, gearless
195  OPT_WHEEL_DIR_REVERSE = 0x04, // As of rev v38 we support wheels to move in reverse direction
196  OPT_DRIVE_TYPE_4WD = 0x08, // 4WD is separate option as of late July, 2021
197  OPT_WHEEL_TYPE_STANDARD = 0, // Default original, standard wheels
198  OPT_DRIVE_TYPE_STANDARD = 0, // Default original magni, 2 wheel drive
199  OPT_WHEEL_DIR_STANDARD = 0 // Default original, standard wheels
200  };
201 
202  // Bitfield values indicating selftest involved. Most are used in test request and results.
203  // A set bit in STEST_RESULTS indicates failure once tests complete
204  // STEST_IN_PROGRESS appears in RESULTS till tests are done then it goes to zero
205  #define STEST_STATE_SHIFT 24
207  STEST_IDLE = 0x00000000, // Indicates test is done or not requested yet
208  STEST_MAINV = 0x00000001, // Main voltages not in limits for 5V_MAIN or perhaps 12V_MAIN
209  STEST_AUXV = 0x00000002, // Aux voltages not in limits for 5V_AUX or perhaps 12V_AUX
210  STEST_BATTERY = 0x00000004, // Indicates battery state not right or to do selftest
211  STEST_BATTERY_LOW = 0x00000008, // Indicates battery is low (required for low check)
212  STEST_MOT_PWR = 0x00000080, // Indicates motor power
213  STEST_MOTOR_AND_ENCS = 0x00000100, // Move motors back and forth (Will set ENC bits if needed)
214  STEST_MOTOR_POWER_ON = 0x00000400, // If motor power is off this gets set so test with estop off
215  STEST_M1_CURNT = 0x00001000, // Motor 1 current test
216  STEST_M2_CURNT = 0x00002000, // Motor 2 current test
217  STEST_MOT_M1_ENC = 0x00010000, // Left enc not responding to movement (in MOT_MOVE test)
218  STEST_MOT_M2_ENC = 0x00020000, // Right enc not responding to movement (in MOT_MOVE test)
219  STEST_IN_PROGRESS = 0x00800000, // Indicates selftest is in progress
220  STEST_STATE = (0xF << STEST_STATE_SHIFT) // Some tests may require a state
221  };
222 
223  // System Event Bits are set for things such as a power on has happened so host can see that
224  // The host can read this then clear it.
226  SYS_EVENT_POWERON = 0x00000001 // Indicates MCB has had a reset
227  };
228 
229  // Bitfield indicating which limits have been reached
230  enum Limits {
231  LIM_M1_PWM = 0x10,
232  LIM_M2_PWM = 0x01,
238  };
239 
240  // State bits for motor power
241  const static int32_t MOT_POW_ACTIVE = 0x0001;
242 
245 
248 
249  void setData(int32_t data);
250  int32_t getData() const;
251 
252  RawMotorMessage serialize() const;
253 
254 
255  // Error Codes that can be returned by deserializaion
256  enum ErrorCodes {
257  ERR_NONE = 0, // Success code
263  };
264 
266 
267  const static uint8_t delimeter = 0x7E;
268 
269 private:
270  // Type of message should be in MotorMessage::MessageTypes
271  uint8_t type;
272  // Register address should be in MotorMessage::Registers
273  uint8_t register_addr;
274 
275  // 4 bytes of data, numbers should be in big endian format
276  boost::array<uint8_t, 4> data;
277 
278  const static uint8_t protocol_version =
279  0x03; // Hard coded for now, should be parameterized
280 
281  const static uint8_t valid_types[];
282  const static uint8_t valid_registers[];
283 
284  static int verifyType(uint8_t t);
285  static int verifyRegister(uint8_t r);
286 
287  static uint8_t generateChecksum(const std::vector<uint8_t> &data);
288  static uint8_t generateChecksum(const RawMotorMessage &data);
289 };
290 
291 #endif
MotorMessage::REG_TINT_BOTH_WHLS
@ REG_TINT_BOTH_WHLS
Definition: motor_message.h:93
MotorMessage::LIM_M2_MAX_SPD
@ LIM_M2_MAX_SPD
Definition: motor_message.h:236
MotorMessage::StestRequestAndResults
StestRequestAndResults
Definition: motor_message.h:206
MotorMessage::DEBUG_58
@ DEBUG_58
Definition: motor_message.h:172
MotorMessage::OPT_WHEEL_TYPE_STANDARD
@ OPT_WHEEL_TYPE_STANDARD
Definition: motor_message.h:197
MotorMessage::STEST_MAINV
@ STEST_MAINV
Definition: motor_message.h:208
MotorMessage::OPT_ENC_6_STATE
@ OPT_ENC_6_STATE
Definition: motor_message.h:193
MotorMessage::REG_WHEEL_NULL_ERR
@ REG_WHEEL_NULL_ERR
Definition: motor_message.h:99
MotorMessage::REG_DRIVE_TYPE
@ REG_DRIVE_TYPE
Definition: motor_message.h:96
MotorMessage::MOT_POW_ACTIVE
const static int32_t MOT_POW_ACTIVE
Definition: motor_message.h:241
MotorMessage::STEST_M2_CURNT
@ STEST_M2_CURNT
Definition: motor_message.h:216
MotorMessage::REG_BOTH_ODOM
@ REG_BOTH_ODOM
Definition: motor_message.h:147
MotorMessage::REG_09
@ REG_09
Definition: motor_message.h:95
MotorMessage::generateChecksum
static uint8_t generateChecksum(const std::vector< uint8_t > &data)
MotorMessage::OPT_DRIVE_TYPE_4WD
@ OPT_DRIVE_TYPE_4WD
Definition: motor_message.h:196
MotorMessage::REG_PARAM_C
@ REG_PARAM_C
Definition: motor_message.h:125
MotorMessage::STEST_MOT_PWR
@ STEST_MOT_PWR
Definition: motor_message.h:212
MotorMessage::REG_LEFT_CURRENT
@ REG_LEFT_CURRENT
Definition: motor_message.h:104
MotorMessage::deserialize
MotorMessage::ErrorCodes deserialize(const RawMotorMessage &serialized)
Definition: motor_message.cc:151
MotorMessage::REG_5V_MAIN_CURRENT
@ REG_5V_MAIN_CURRENT
Definition: motor_message.h:134
MotorMessage::REG_BATT_VOL_LOW
@ REG_BATT_VOL_LOW
Definition: motor_message.h:139
MotorMessage::ERR_BAD_CHECKSUM
@ ERR_BAD_CHECKSUM
Definition: motor_message.h:260
MotorMessage::TYPE_RESPONSE
@ TYPE_RESPONSE
Definition: motor_message.h:77
MotorMessage::REG_AUXV_TPOINT
@ REG_AUXV_TPOINT
Definition: motor_message.h:137
MotorMessage::REG_DEADMAN
@ REG_DEADMAN
Definition: motor_message.h:102
MotorMessage::delimeter
const static uint8_t delimeter
Definition: motor_message.h:267
MotorMessage::STEST_IN_PROGRESS
@ STEST_IN_PROGRESS
Definition: motor_message.h:219
MotorMessage::getType
MotorMessage::MessageTypes getType() const
Definition: motor_message.cc:112
MotorMessage::REG_DEADZONE
@ REG_DEADZONE
Definition: motor_message.h:159
MotorMessage::REG_PARAM_C_RDY
@ REG_PARAM_C_RDY
Definition: motor_message.h:118
MotorMessage::REG_FIRMWARE_VERSION
@ REG_FIRMWARE_VERSION
Definition: motor_message.h:131
MotorMessage::REG_BOTH_SPEED_SET
@ REG_BOTH_SPEED_SET
Definition: motor_message.h:142
MotorMessage::STEST_MOT_M1_ENC
@ STEST_MOT_M1_ENC
Definition: motor_message.h:217
MotorMessage::valid_registers
const static uint8_t valid_registers[]
Definition: motor_message.h:282
MotorMessage::ERR_UNKNOWN_REGISTER
@ ERR_UNKNOWN_REGISTER
Definition: motor_message.h:262
MotorMessage::REG_STEST_REQUEST
@ REG_STEST_REQUEST
Definition: motor_message.h:161
MotorMessage::PID_CTRL_USE_ONLY_P_TERM
@ PID_CTRL_USE_ONLY_P_TERM
Definition: motor_message.h:181
MotorMessage::REG_PID_MAX_ERROR
@ REG_PID_MAX_ERROR
Definition: motor_message.h:152
MotorMessage::OPT_WHEEL_DIR_REVERSE
@ OPT_WHEEL_DIR_REVERSE
Definition: motor_message.h:195
MotorMessage::REG_VBUF_SIZ
@ REG_VBUF_SIZ
Definition: motor_message.h:140
MotorMessage::REG_OPTION_SWITCH
@ REG_OPTION_SWITCH
Definition: motor_message.h:109
MotorMessage::DEBUG_57
@ DEBUG_57
Definition: motor_message.h:171
upgrade_firmware.r
r
Definition: upgrade_firmware.py:55
MotorMessage::valid_types
const static uint8_t valid_types[]
Definition: motor_message.h:281
MotorMessage::REG_BRAKE_STOP
@ REG_BRAKE_STOP
Definition: motor_message.h:84
MotorMessage::TYPE_ERROR
@ TYPE_ERROR
Definition: motor_message.h:78
MotorMessage::TYPE_READ
@ TYPE_READ
Definition: motor_message.h:75
MotorMessage::DEBUG_50
@ DEBUG_50
Definition: motor_message.h:164
MotorMessage::REG_PARAM_V
@ REG_PARAM_V
Definition: motor_message.h:121
MotorMessage::STEST_AUXV
@ STEST_AUXV
Definition: motor_message.h:209
MotorMessage::REG_HW_OPTIONS
@ REG_HW_OPTIONS
Definition: motor_message.h:158
MotorMessage::DEBUG_51
@ DEBUG_51
Definition: motor_message.h:165
MotorMessage::REG_PARAM_D_RDY
@ REG_PARAM_D_RDY
Definition: motor_message.h:117
MotorMessage::PID_CTRL_CAP_POS_SETPOINT
@ PID_CTRL_CAP_POS_SETPOINT
Definition: motor_message.h:183
MotorMessage::REG_PID_CONTROL
@ REG_PID_CONTROL
Definition: motor_message.h:111
MotorMessage::setData
void setData(int32_t data)
Definition: motor_message.cc:126
MotorMessage::PID_CTRL_USE_VELOCITY_TERM
@ PID_CTRL_USE_VELOCITY_TERM
Definition: motor_message.h:188
MotorMessage::REG_BOTH_ERROR
@ REG_BOTH_ERROR
Definition: motor_message.h:146
MotorMessage::register_addr
uint8_t register_addr
Definition: motor_message.h:273
MotorMessage::REG_WHEEL_TYPE
@ REG_WHEEL_TYPE
Definition: motor_message.h:107
MotorMessage::STEST_MOTOR_AND_ENCS
@ STEST_MOTOR_AND_ENCS
Definition: motor_message.h:213
MotorMessage::MessageTypes
MessageTypes
Definition: motor_message.h:74
MotorMessage::Registers
Registers
Definition: motor_message.h:82
MotorMessage::STEST_MOT_M2_ENC
@ STEST_MOT_M2_ENC
Definition: motor_message.h:218
MotorMessage::REG_RIGHT_PWM
@ REG_RIGHT_PWM
Definition: motor_message.h:88
MotorMessage::REG_HARDWARE_VERSION
@ REG_HARDWARE_VERSION
Definition: motor_message.h:130
MotorMessage::LIM_M1_PWM
@ LIM_M1_PWM
Definition: motor_message.h:231
MotorMessage::OPT_DRIVE_TYPE_STANDARD
@ OPT_DRIVE_TYPE_STANDARD
Definition: motor_message.h:198
MotorMessage::REG_ROBOT_ID
@ REG_ROBOT_ID
Definition: motor_message.h:148
MotorMessage::PID_CTRL_BOOST_P_TERM
@ PID_CTRL_BOOST_P_TERM
Definition: motor_message.h:184
MotorMessage::REG_PARAM_I_RDY
@ REG_PARAM_I_RDY
Definition: motor_message.h:116
MotorMessage::REG_WHEEL_DIR
@ REG_WHEEL_DIR
Definition: motor_message.h:100
MotorMessage::PID_CTRL_BOOST_P_TURBO
@ PID_CTRL_BOOST_P_TURBO
Definition: motor_message.h:185
MotorMessage::MotorMessage
MotorMessage()
Definition: motor_message.h:70
MotorMessage::REG_LIMIT_REACHED
@ REG_LIMIT_REACHED
Definition: motor_message.h:145
MotorMessage::REG_PARAM_D
@ REG_PARAM_D
Definition: motor_message.h:124
MotorMessage::PID_CTRL_P_ONLY_ON_0_VEL
@ PID_CTRL_P_ONLY_ON_0_VEL
Definition: motor_message.h:180
MotorMessage::PID_CTRL_AUTOSHIFT_TO_SQUARED
@ PID_CTRL_AUTOSHIFT_TO_SQUARED
Definition: motor_message.h:186
MotorMessage::REG_PWM_OVERRIDE
@ REG_PWM_OVERRIDE
Definition: motor_message.h:110
MotorMessage::REG_FIRMWARE_DATE
@ REG_FIRMWARE_DATE
Definition: motor_message.h:160
MotorMessage::DEBUG_52
@ DEBUG_52
Definition: motor_message.h:166
MotorMessage::REG_LEFT_PWM
@ REG_LEFT_PWM
Definition: motor_message.h:87
MotorMessage::serialize
RawMotorMessage serialize() const
Definition: motor_message.cc:141
MotorMessage::REG_ESTOP_ENABLE
@ REG_ESTOP_ENABLE
Definition: motor_message.h:151
MotorMessage::REG_MAX_SPEED_FWD
@ REG_MAX_SPEED_FWD
Definition: motor_message.h:154
MotorMessage::REG_STEST_RESULTS
@ REG_STEST_RESULTS
Definition: motor_message.h:162
MotorMessage::STEST_MOTOR_POWER_ON
@ STEST_MOTOR_POWER_ON
Definition: motor_message.h:214
MotorMessage::HwOptions
HwOptions
Definition: motor_message.h:192
MotorMessage::REG_PARAM_P
@ REG_PARAM_P
Definition: motor_message.h:122
MotorMessage::REG_LED_1
@ REG_LED_1
Definition: motor_message.h:127
MotorMessage::TYPE_WRITE
@ TYPE_WRITE
Definition: motor_message.h:76
MotorMessage::REG_MAX_PWM
@ REG_MAX_PWM
Definition: motor_message.h:156
MotorMessage::STEST_BATTERY_LOW
@ STEST_BATTERY_LOW
Definition: motor_message.h:211
MotorMessage::getData
int32_t getData() const
Definition: motor_message.cc:135
MotorMessage::type
uint8_t type
Definition: motor_message.h:271
MotorMessage::~MotorMessage
~MotorMessage()
Definition: motor_message.h:71
MotorMessage::STEST_M1_CURNT
@ STEST_M1_CURNT
Definition: motor_message.h:215
MotorMessage::REG_MAINV_TPOINT
@ REG_MAINV_TPOINT
Definition: motor_message.h:135
MotorMessage::verifyRegister
static int verifyRegister(uint8_t r)
Definition: motor_message.cc:190
MotorMessage::LIM_M2_INTEGRAL
@ LIM_M2_INTEGRAL
Definition: motor_message.h:234
MotorMessage::REG_RIGHT_CURRENT
@ REG_RIGHT_CURRENT
Definition: motor_message.h:105
STEST_STATE_SHIFT
#define STEST_STATE_SHIFT
Definition: motor_message.h:205
MotorMessage::PID_CTRL_SQUARED_ERROR
@ PID_CTRL_SQUARED_ERROR
Definition: motor_message.h:182
MotorMessage::verifyType
static int verifyType(uint8_t t)
Definition: motor_message.cc:181
MotorMessage::OPT_WHEEL_TYPE_THIN
@ OPT_WHEEL_TYPE_THIN
Definition: motor_message.h:194
MotorMessage::OPT_WHEEL_DIR_STANDARD
@ OPT_WHEEL_DIR_STANDARD
Definition: motor_message.h:199
MotorMessage::REG_BATTERY_VOLTAGE
@ REG_BATTERY_VOLTAGE
Definition: motor_message.h:133
MotorMessage::protocol_version
const static uint8_t protocol_version
Definition: motor_message.h:278
MotorMessage::SystemEvents
SystemEvents
Definition: motor_message.h:225
MotorMessage::PID_CTRL_PWM_OVERRIDE
@ PID_CTRL_PWM_OVERRIDE
Definition: motor_message.h:179
MotorMessage::PID_CTRL_RESET
@ PID_CTRL_RESET
Definition: motor_message.h:178
MotorMessage::REG_SYSTEM_EVENTS
@ REG_SYSTEM_EVENTS
Definition: motor_message.h:85
MotorMessage::getRegister
MotorMessage::Registers getRegister() const
Definition: motor_message.cc:122
MotorMessage::STEST_IDLE
@ STEST_IDLE
Definition: motor_message.h:207
MotorMessage::ERR_NONE
@ ERR_NONE
Definition: motor_message.h:257
MotorMessage::REG_MOVING_BUF_SIZE
@ REG_MOVING_BUF_SIZE
Definition: motor_message.h:143
MotorMessage::REG_PID_ERROR_CAP
@ REG_PID_ERROR_CAP
Definition: motor_message.h:108
MotorMessage::SYS_EVENT_POWERON
@ SYS_EVENT_POWERON
Definition: motor_message.h:226
MotorMessage::REG_RIGHT_RAMP
@ REG_RIGHT_RAMP
Definition: motor_message.h:97
MotorMessage::REG_PWM_BOTH_WHLS
@ REG_PWM_BOTH_WHLS
Definition: motor_message.h:92
MotorMessage::STEST_BATTERY
@ STEST_BATTERY
Definition: motor_message.h:210
MotorMessage::data
boost::array< uint8_t, 4 > data
Definition: motor_message.h:276
MotorMessage::LIM_M1_INTEGRAL
@ LIM_M1_INTEGRAL
Definition: motor_message.h:233
MotorMessage::REG_LED_2
@ REG_LED_2
Definition: motor_message.h:128
MotorMessage::LIM_M1_MAX_SPD
@ LIM_M1_MAX_SPD
Definition: motor_message.h:235
MotorMessage::DEBUG_53
@ DEBUG_53
Definition: motor_message.h:167
MotorMessage::PID_CTRL_AUTOSHIFT_TO_BOOST_P
@ PID_CTRL_AUTOSHIFT_TO_BOOST_P
Definition: motor_message.h:187
MotorMessage::ERR_WRONG_PROTOCOL
@ ERR_WRONG_PROTOCOL
Definition: motor_message.h:259
MotorMessage::REG_MOT_PWR_ACTIVE
@ REG_MOT_PWR_ACTIVE
Definition: motor_message.h:150
MotorMessage::REG_STOP_START
@ REG_STOP_START
Definition: motor_message.h:83
MotorMessage::STEST_STATE
@ STEST_STATE
Definition: motor_message.h:220
MotorMessage::ERR_BAD_TYPE
@ ERR_BAD_TYPE
Definition: motor_message.h:261
MotorMessage::REG_12V_MAIN_CURRENT
@ REG_12V_MAIN_CURRENT
Definition: motor_message.h:136
MotorMessage::REG_PARAM_V_RDY
@ REG_PARAM_V_RDY
Definition: motor_message.h:114
MotorMessage::DEBUG_54
@ DEBUG_54
Definition: motor_message.h:168
MotorMessage::PidControlActions
PidControlActions
Definition: motor_message.h:176
RawMotorMessage
boost::array< uint8_t, 8 > RawMotorMessage
Definition: motor_message.h:38
MotorMessage::Limits
Limits
Definition: motor_message.h:230
MotorMessage::DEBUG_56
@ DEBUG_56
Definition: motor_message.h:170
MotorMessage::LIM_PARAM_LIMIT
@ LIM_PARAM_LIMIT
Definition: motor_message.h:237
MotorMessage::LIM_M2_PWM
@ LIM_M2_PWM
Definition: motor_message.h:232
MotorMessage::setRegister
void setRegister(MotorMessage::Registers reg)
Definition: motor_message.cc:116
MotorMessage::REG_PARAM_I
@ REG_PARAM_I
Definition: motor_message.h:123
MotorMessage::ERR_DELIMITER
@ ERR_DELIMITER
Definition: motor_message.h:258
MotorMessage::ErrorCodes
ErrorCodes
Definition: motor_message.h:256
MotorMessage::PID_CTRL_NO_SPECIAL_MODES
@ PID_CTRL_NO_SPECIAL_MODES
Definition: motor_message.h:177
MotorMessage::setType
void setType(MotorMessage::MessageTypes type)
Definition: motor_message.cc:106
MotorMessage::REG_MAX_SPEED_REV
@ REG_MAX_SPEED_REV
Definition: motor_message.h:155
MotorMessage::REG_PARAM_P_RDY
@ REG_PARAM_P_RDY
Definition: motor_message.h:115
MotorMessage
Definition: motor_message.h:67
MotorMessage::DEBUG_55
@ DEBUG_55
Definition: motor_message.h:169


ubiquity_motor
Author(s):
autogenerated on Thu Nov 16 2023 03:30:55