servo fix

This commit is contained in:
legop3
2025-11-20 14:12:06 -05:00
parent 400054ae58
commit ff0bf30eac
4 changed files with 17 additions and 14 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
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>webui</title>
<script type="module" crossorigin src="/assets/index-DBNvZqXA.js"></script>
<script type="module" crossorigin src="/assets/index-tDRd6DNO.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DP0zs3Oi.css">
</head>
<body>
+5 -2
View File
@@ -53,11 +53,14 @@ export function ControlSystemProvider({ children }) {
const min = typeof config.minAngle === 'number' ? config.minAngle : -45;
const max = typeof config.maxAngle === 'number' ? config.maxAngle : 45;
const base = typeof config.homeAngle === 'number' ? config.homeAngle : (min + max) / 2;
const preserved =
typeof servoAngleRef.current === 'number' ? clamp(servoAngleRef.current, min, max) : null;
const angle = preserved != null ? preserved : clamp(base, min, max);
dispatch({
type: 'control/set-camera-config',
payload: { config, angle: clamp(base, min, max) },
payload: { config, angle },
});
servoAngleRef.current = clamp(base, min, max);
servoAngleRef.current = angle;
}, [pipeline.servoConfig]);
useEffect(() => {