This commit is contained in:
legop3
2026-07-17 02:15:47 -04:00
parent 679563862d
commit 351cb24458
4 changed files with 8 additions and 9 deletions
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/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>
<script type="module" crossorigin src="/assets/index-B056JgJR.js"></script>
<script type="module" crossorigin src="/assets/index-Da9ufxPv.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BcBTKEa5.css">
</head>
<body>
@@ -42,11 +42,10 @@ function centerOfPressure(corners) {
const bottomRight = Math.max(0, finiteNumber(corners.bottomRight) || 0);
const total = topLeft + topRight + bottomLeft + bottomRight;
// An empty board naturally has tiny load-cell noise. Keep the marker centered
// and subdued until there is enough weight for its position to mean anything;
// once loaded, map the normalized left/right and top/bottom balance into the
// safe interior of the load map.
if (total < 0.5) return { left: 50, top: 50, active: false };
// Only an exact zero stays centered because dividing by zero cannot produce a
// position. Every positive reading participates immediately, with no minimum
// weight or center deadzone hiding small shifts reported by the load cells.
if (total === 0) return { left: 50, top: 50, active: false };
const horizontal = ((topRight + bottomRight) - (topLeft + bottomLeft)) / total;
const vertical = ((bottomLeft + bottomRight) - (topLeft + topRight)) / total;
return {