File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
include/motor-control/core Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ class BrushedMotorInterruptHandler {
199
199
cancel_and_clear_moves (can::ids::ErrorCode::estop_detected);
200
200
} else if (hardware.has_cancel_request ()) {
201
201
if (!hardware.get_stay_enabled ()) {
202
- hardware.set_motor_state (BrushedMotorState::UNHOMED );
202
+ hardware.set_motor_state (BrushedMotorState::STOPPED );
203
203
}
204
204
cancel_and_clear_moves (can::ids::ErrorCode::stop_requested,
205
205
can::ids::ErrorSeverity::warning);
Original file line number Diff line number Diff line change @@ -44,5 +44,6 @@ enum class BrushedMotorState : uint8_t {
44
44
UNHOMED = 0x0 ,
45
45
FORCE_CONTROLLING_HOME = 0x1 ,
46
46
FORCE_CONTROLLING = 0x2 ,
47
- POSITION_CONTROLLING = 0x3
48
- };
47
+ POSITION_CONTROLLING = 0x3 ,
48
+ STOPPED = 0x4
49
+ };
Original file line number Diff line number Diff line change @@ -526,10 +526,10 @@ SCENARIO("handler recovers from error state") {
526
526
test_objs.hw .request_cancel ();
527
527
test_objs.handler .run_interrupt ();
528
528
THEN (
529
- " motor state should become un-homed only if stay engaged is "
530
- " falsy " ) {
529
+ " motor state should become stopped only if stay engaged is "
530
+ " false " ) {
531
531
REQUIRE (test_objs.hw .get_motor_state () ==
532
- (!stay_engaged ? BrushedMotorState::UNHOMED
532
+ (!stay_engaged ? BrushedMotorState::STOPPED
533
533
: og_motor_state));
534
534
}
535
535
THEN (" a stop requested warning is issued" ) {
@@ -560,4 +560,4 @@ SCENARIO("handler recovers from error state") {
560
560
}
561
561
}
562
562
}
563
- }
563
+ }
You can’t perform that action at this time.
0 commit comments