trying to fix zoom stopping camera

This commit is contained in:
legop3
2026-07-17 23:33:46 -04:00
parent 512adfc1e0
commit b86eec88f8
2 changed files with 21 additions and 18 deletions
+14 -16
View File
@@ -1223,19 +1223,7 @@ function requestMotionCommands({ fullStop = false, panTilt = false, zoom = false
const zoom = desiredMotion.zoom;
try {
await initialize();
if (!zoom) {
/*
Zero zoom velocity is the axis-local release. The camera's Stop
implementation is over-broad and halts pan/tilt even when the
request includes only Zoom=true.
*/
await callOnvif('continuousMove', {
profileToken: state.profileToken,
zoom: 0,
onlySendZoom: true,
timeout: ZOOM_PULSE_TIMEOUT_MS,
});
} else {
if (zoom) {
/*
The TrackMix does not advertise continuous zoom, but physical
testing showed each accepted zoom-only ContinuousMove advances one
@@ -1290,7 +1278,7 @@ function syncZoomRepeater() {
}, ZOOM_REPEAT_MS);
}
function queueMotionIntent(motion, reason = 'input', options = {}) {
function queueMotionIntent(motion, reason = 'input') {
const nextMotion = normalizeMotionIntent(motion);
const panTiltChanged = !panTiltMatches(nextMotion, desiredMotion);
const zoomChanged = nextMotion.zoom !== desiredMotion.zoom;
@@ -1315,10 +1303,20 @@ function queueMotionIntent(motion, reason = 'input', options = {}) {
either motor scheduler: pan/tilt already has a long continuous command, and
zoom has its own 120 ms axis-only repeater.
*/
const sendPanTilt = panTiltChanged || Boolean(options.forceAxes);
const sendZoom = zoomChanged || Boolean(options.forceAxes);
const sendPanTilt = panTiltChanged;
/*
A live-camera recording proved that both Stop(Zoom=true) and a zero-velocity
zoom ContinuousMove halt pan/tilt on this firmware. Zoom itself is step-based:
each non-zero pulse advances once and then settles. Releasing zoom therefore
means clearing its timer and any coalesced-but-unsent pulse, with no camera
command at all. The last transmitted pulse retains its finite one-second
timeout as a backstop.
*/
if (zoomChanged && !nextMotion.zoom) pendingZoomCommand = false;
const sendZoom = Boolean(nextMotion.zoom) && zoomChanged;
if (sendPanTilt) armPanTiltRenewal();
if (sendZoom) syncZoomRepeater();
if (zoomChanged && !nextMotion.zoom) clearZoomRepeat();
const pending = requestMotionCommands({ panTilt: sendPanTilt, zoom: sendZoom });
pending.catch(() => {});
return { ok: true, motion: desiredMotion, reason };
+7 -2
View File
@@ -1,7 +1,12 @@
1. assign rovers based on battery percentage, give people highest one
2. add admin ui for VIP and private requests instead of only through discord
3. add more background gap themes
4. fix this:
3. add flag in roverd for video aspect ratio
1. either 4:3 or 16:9
2. default is 4:3
3. all it does is tell the web UI to make the rover video 16:9 or 4:3 shaped
1. web UI should default to 4:3 if that rover doesnt yet have that config yet
4. add more background gap themes
5. fix this:
`Jun 18 15:14:18 roombaserver.local node[216731]: /home/daniel/MultiRoombaRover/server/src/services/roverManager/socketHandlers.js:92
Jun 18 15:14:18 roombaserver.local node[216731]: cb({ error: err.message });
Jun 18 15:14:18 roombaserver.local node[216731]: ^