Shifting between positive and negative speeds sometimes (I do not know the frequency) divides the result by 2. It should instead be limited to a delta of Rules.DECELERATION units in either direction.
Some debug code:
Initial velocity: 0.7363067269503052, velocity setting: -1.2636932730496948, expected velocity: -1.2636932730496948, actual velocity: -0.6318466365248474
Initial velocity: 1.0, velocity setting: -1.0, expected velocity: -1.0, actual velocity: -0.5
In the above two exerpts, "Initial velocity" is the previous turn's StatusEvent.getVelocity(), and "velocity setting" is super.getVelocityRate() called after a call to super.setVelocityRate( double ).
Anonymous
Actually, this problem is not specific to RateControlRobot. I took that out of the equation and get the same result. It appears that the speed is being halved, independent of the underlying change in speed, when that change in speed passes through zero. I do not know the frequency of the event, but I can replicate it regularly.