mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
slop
This commit is contained in:
@@ -421,6 +421,10 @@ function createOvercurrentProtectionService(options = {}) {
|
||||
if (state.driveBlocked) return 'stopped';
|
||||
const anyLimited = MOTOR_KEYS.some((key) => state.motors[key].cap < 1);
|
||||
if (anyLimited && anyOvercurrent) return 'limiting';
|
||||
// The raw Roomba flag is useful operator information even while stress is
|
||||
// still inside the transient grace region. Reporting it separately keeps
|
||||
// HUD visibility immediate without falsely claiming output is being scaled.
|
||||
if (anyOvercurrent) return 'overcurrent';
|
||||
if (anyLimited) return 'recovering';
|
||||
return 'idle';
|
||||
}
|
||||
|
||||
@@ -50,7 +50,9 @@ test('a short stalled-wheel spike remains inside the grace region', () => {
|
||||
|
||||
assert.equal(snapshot.motors.leftWheel.stress, 0.025);
|
||||
assert.equal(snapshot.motors.leftWheel.cap, 1);
|
||||
assert.equal(snapshot.status, 'idle');
|
||||
// The hardware event is visible immediately even though the grace region
|
||||
// correctly leaves the command cap at full output.
|
||||
assert.equal(snapshot.status, 'overcurrent');
|
||||
});
|
||||
|
||||
test('persistent stalled-wheel overcurrent scales both wheels and then stops drive', () => {
|
||||
|
||||
Reference in New Issue
Block a user