diff --git a/web/js/motion-effects.js b/web/js/motion-effects.js index c615eaf..043f47b 100644 --- a/web/js/motion-effects.js +++ b/web/js/motion-effects.js @@ -58,10 +58,14 @@ export const MotionEffects = { }, // Called to determine blending behaviour during queue checks - getQueueAction(mode, maxDist, blendThreshold) { - if (mode === 'jumpy') { + getQueueAction(targetMode, nextTargetMode, maxDist, blendThreshold) { + if (nextTargetMode === 'overshoot_settle') { + // Must physically reach the overshoot point before popping the settle command + if (maxDist <= 10) return { action: 'blend' }; + return { action: 'continue' }; + } else if (targetMode === 'jumpy') { if (maxDist <= 5) return { action: 'wait', delay: 100 }; - } else if (mode === 'hesitant') { + } else if (targetMode === 'hesitant') { // Lower blend threshold prevents blasting all speed-change waypoints instantly if (maxDist <= 30) return { action: 'blend' }; } else { @@ -95,7 +99,7 @@ export const MotionEffects = { } else if (mode === 'erratic') { count = Math.max(count, Math.ceil(distance / 20)); // fewer, larger jumps } else if (mode === 'hesitant') { - count = Math.max(count, Math.ceil(distance / 15)); // ensure we get middle waypoints for speed changes + count = Math.max(count, Math.ceil(distance / 15)); // ensure enough waypoints for speed changes } return Math.max(1, count); }, diff --git a/web/js/motion.js b/web/js/motion.js index 1053c7a..68994d9 100644 --- a/web/js/motion.js +++ b/web/js/motion.js @@ -95,7 +95,8 @@ async function executeQueue() { const maxDist = Math.max(dist1, dist2); if (motionQueue.length > 0) { - const queueAction = MotionEffects.getQueueAction(target.mode, maxDist, CONFIG.BLEND_THRESHOLD_STEPS); + const nextTarget = motionQueue[0]; + const queueAction = MotionEffects.getQueueAction(target.mode, nextTarget.mode, maxDist, CONFIG.BLEND_THRESHOLD_STEPS); if (queueAction.action === 'wait') { clearInterval(queueCheckInterval); setTimeout(executeQueue, queueAction.delay);