mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
precision camera stuff
This commit is contained in:
@@ -49,6 +49,7 @@ const CONTROL_ACTION_NAMES = [
|
||||
'setServoAngle',
|
||||
'nudgeServo',
|
||||
'goServoHome',
|
||||
'setCameraPrecisionMode',
|
||||
'runMacro',
|
||||
'stopAllMotion',
|
||||
'sendOiCommand',
|
||||
@@ -411,6 +412,15 @@ export function ControlSystemProvider({ children }) {
|
||||
setServoAngle(target);
|
||||
}, [pipeline.servoConfig, setServoAngle]);
|
||||
|
||||
const setCameraPrecisionMode = useCallback((active) => {
|
||||
/*
|
||||
This action only changes how the browser chooses servo increments. The Pi
|
||||
already accepts decimal angle targets, so no server or rover command shape
|
||||
changes are needed for precision camera mode.
|
||||
*/
|
||||
dispatch({ type: 'control/set-camera-precision-mode', payload: Boolean(active) });
|
||||
}, []);
|
||||
|
||||
const runMacro = useCallback(
|
||||
async (macroId) => {
|
||||
const macro = state.macros.find((item) => item.id === macroId) || null;
|
||||
@@ -675,6 +685,7 @@ export function ControlSystemProvider({ children }) {
|
||||
setServoAngle,
|
||||
nudgeServo,
|
||||
goServoHome,
|
||||
setCameraPrecisionMode,
|
||||
runMacro,
|
||||
stopAllMotion,
|
||||
sendOiCommand,
|
||||
@@ -701,6 +712,7 @@ export function ControlSystemProvider({ children }) {
|
||||
setServoAngle,
|
||||
nudgeServo,
|
||||
goServoHome,
|
||||
setCameraPrecisionMode,
|
||||
runMacro,
|
||||
stopAllMotion,
|
||||
sendOiCommand,
|
||||
|
||||
Reference in New Issue
Block a user