Open
Description
In ServoImpl#getPosition
,reverse
is called on the unscaled position in getPosition
. While in ServoImpl#setPosition
, reverse
is called on scaled values. This means Servo#getPosition
return incorrect values for reversed scaled servos.
Example
Let's say we have a reversed servo scaled from 0
to 0.5
instead of from 0
to 1
:
Setting:
setPosition(0.5)
-> sets an actual position of0.25
for the servo.
Getting:
ServoController#getServoPosition
returns0.25
(line 178)reverse
reverses the value from0.25
to0.75
(line 179)Range.scale
scales the value from0.75
to1.5
(line 180)Range.clip
clips the value to1
Result
We expect to get 0.5, not 1
Code Screenshot

Metadata
Metadata
Assignees
Labels
No labels