This commit is contained in:
legop3
2026-07-17 14:38:47 -04:00
parent c9842d7ba5
commit 955f6f213d
9 changed files with 17 additions and 7 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -78,7 +78,7 @@
<script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script> <script defer src="https://analytics.otter.land/script.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land"></script>
<script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script> <script defer src="https://analytics.otter.land/recorder.js" data-website-id="82dd56a5-db44-4279-bd1e-a4d9fee39af7" data-domains="rover.otter.land" data-sample-rate="0.15" data-mask-level="moderate" data-max-duration="300000"></script>
<title>Roomba Rover</title> <title>Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-DzMZA-qn.js"></script> <script type="module" crossorigin src="/assets/index-3ekGrBk9.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DzqCFmyF.css"> <link rel="stylesheet" crossorigin href="/assets/index-DzqCFmyF.css">
</head> </head>
<body> <body>
@@ -421,6 +421,10 @@ function createOvercurrentProtectionService(options = {}) {
if (state.driveBlocked) return 'stopped'; if (state.driveBlocked) return 'stopped';
const anyLimited = MOTOR_KEYS.some((key) => state.motors[key].cap < 1); const anyLimited = MOTOR_KEYS.some((key) => state.motors[key].cap < 1);
if (anyLimited && anyOvercurrent) return 'limiting'; 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'; if (anyLimited) return 'recovering';
return 'idle'; 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.stress, 0.025);
assert.equal(snapshot.motors.leftWheel.cap, 1); 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', () => { test('persistent stalled-wheel overcurrent scales both wheels and then stops drive', () => {
@@ -40,7 +40,9 @@ function OvercurrentOverlay({ roverId = null, overcurrentLimiter = null, compact
? 'Drive stopped' ? 'Drive stopped'
: status === 'recovering' : status === 'recovering'
? 'Protection recovering' ? 'Protection recovering'
: 'Overcurrent limiting'; : status === 'limiting'
? 'Overcurrent limiting'
: 'Overcurrent detected';
const detail = bypassed const detail = bypassed
? 'Admin bypass' ? 'Admin bypass'
: stopped && protection?.drive?.requiresNeutral : stopped && protection?.drive?.requiresNeutral
@@ -35,6 +35,7 @@ function statusLabel(protection) {
if (protection?.adminImmune) return 'Admin bypass'; if (protection?.adminImmune) return 'Admin bypass';
if (protection?.status === 'stopped') return 'Drive stopped'; if (protection?.status === 'stopped') return 'Drive stopped';
if (protection?.status === 'limiting') return 'Limiting'; if (protection?.status === 'limiting') return 'Limiting';
if (protection?.status === 'overcurrent') return 'Overcurrent detected';
if (protection?.status === 'recovering') return 'Recovering'; if (protection?.status === 'recovering') return 'Recovering';
return 'Ready'; return 'Ready';
} }
+1
View File
@@ -64,6 +64,7 @@ export function useOvercurrentLimiter(roverId) {
}, },
overcurrent: { motors: motorFlags, groups: groupFlags }, overcurrent: { motors: motorFlags, groups: groupFlags },
isActive: protection?.status === 'limiting' isActive: protection?.status === 'limiting'
|| protection?.status === 'overcurrent'
|| protection?.status === 'stopped' || protection?.status === 'stopped'
|| protection?.status === 'recovering', || protection?.status === 'recovering',
adminImmune, adminImmune,