This commit is contained in:
legop3
2026-01-26 19:53:19 -05:00
parent f7677a443a
commit 48e4ddd090
3 changed files with 4 additions and 1 deletions
Vendored
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+4 -1
View File
@@ -174,13 +174,16 @@ func (s *CameraServo) rateLimitAngleLocked(target float64) float64 {
now := time.Now()
if s.lastMove.IsZero() {
s.lastMove = now
return target
}
elapsed := now.Sub(s.lastMove).Seconds()
if elapsed <= 0 {
s.lastMove = now
return s.currentAngle
}
maxElapsed := servoStepInterval.Seconds()
if elapsed > maxElapsed {
elapsed = maxElapsed
}
maxDelta := maxServoDegPerSec * elapsed
delta := target - s.currentAngle
if math.Abs(delta) <= maxDelta {