mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
ug
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user