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 of 0.25 for the servo.
Getting:
ServoController#getServoPosition returns 0.25 (line 178)
reverse reverses the value from 0.25 to 0.75 (line 179)
Range.scale scales the value from 0.75 to 1.5 (line 180)
Range.clip clips the value to 1
Result
We expect to get 0.5, not 1
Code Screenshot

In
ServoImpl#getPosition,reverseis called on the unscaled position ingetPosition. While inServoImpl#setPosition,reverseis called on scaled values. This meansServo#getPositionreturn incorrect values for reversed scaled servos.Example
Let's say we have a reversed servo scaled from
0to0.5instead of from0to1:Setting:
setPosition(0.5)-> sets an actual position of0.25for the servo.Getting:
ServoController#getServoPositionreturns0.25(line 178)reversereverses the value from0.25to0.75(line 179)Range.scalescales the value from0.75to1.5(line 180)Range.clipclips the value to1Result
We expect to get 0.5, not 1
Code Screenshot