File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
include/motor-control/core/brushed_motor Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ class BrushedMotorInterruptHandler {
151
151
can::ids::ErrorCode::collision_detected);
152
152
report_position (pulses);
153
153
error_handled = true ;
154
+ hardware.set_motor_state (BrushedMotorState::UNHOMED);
154
155
}
155
156
} else if (motor_state != BrushedMotorState::UNHOMED) {
156
157
auto pulses = hardware.get_encoder_pulses ();
@@ -166,6 +167,7 @@ class BrushedMotorInterruptHandler {
166
167
motor_state == BrushedMotorState::FORCE_CONTROLLING
167
168
? can::ids::ErrorCode::labware_dropped
168
169
: can::ids::ErrorCode::collision_detected;
170
+ hardware.set_motor_state (BrushedMotorState::UNHOMED);
169
171
cancel_and_clear_moves (err);
170
172
report_position (pulses);
171
173
error_handled = true ;
@@ -197,8 +199,10 @@ class BrushedMotorInterruptHandler {
197
199
} else if (estop_triggered ()) {
198
200
in_estop = true ;
199
201
cancel_and_clear_moves (can::ids::ErrorCode::estop_detected);
202
+ hardware.set_motor_state (BrushedMotorState::UNHOMED);
200
203
} else if (hardware.has_cancel_request ()) {
201
- if (!hardware.get_stay_enabled ()) {
204
+ if (!hardware.get_stay_enabled () &&
205
+ hardware.get_motor_state () != BrushedMotorState::UNHOMED) {
202
206
hardware.set_motor_state (BrushedMotorState::STOPPED);
203
207
}
204
208
cancel_and_clear_moves (can::ids::ErrorCode::stop_requested,
You can’t perform that action at this time.
0 commit comments