mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 01:18:52 +08:00
Can heartbeat flags (#711)
* Update heartbeat flags Update heartbeat message to set/send motor, encoder and controller flags if there are errors * Update Firmware/communication/can/can_simple.cpp Co-authored-by: Paul Guenette <Wetmelon@users.noreply.github.com> * Update Firmware/communication/can/can_simple.cpp Co-authored-by: Paul Guenette <Wetmelon@users.noreply.github.com> * Update Firmware/communication/can/can_simple.cpp Co-authored-by: Paul Guenette <Wetmelon@users.noreply.github.com> Co-authored-by: Paul Guenette <Wetmelon@users.noreply.github.com>
This commit is contained in:
@@ -436,13 +436,13 @@ bool CANSimple::send_heartbeat(const Axis& axis) {
|
||||
can_setSignal(txmsg, uint8_t(axis.current_state_), 32, 8, true);
|
||||
|
||||
// Motor flags
|
||||
uint8_t motorFlags = 0; // reserved
|
||||
uint8_t motorFlags = axis.motor_.error_ != 0;
|
||||
|
||||
// Encoder flags
|
||||
uint8_t encoderFlags = 0; // reserved
|
||||
uint8_t encoderFlags = axis.encoder_.error_ != 0;
|
||||
|
||||
// Controller flags
|
||||
uint8_t controllerFlags = 0;
|
||||
uint8_t controllerFlags =axis.controller_.error_ != 0;
|
||||
uint8_t trajDone = uint8_t(axis.controller_.trajectory_done_) << 7;
|
||||
controllerFlags |= trajDone;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user