OKAPI AsyncPositionController Bad Observed Behavior

Good Day,

In testing the AsyncPosition controller I’ve noticed a behavior that I do not understand.

I have a external encoder (Rotation Sensor) that I am using for an arm’s true position. In testing I’ve noticed that on startup of the robot code if the arm’s true position is greater than the zero position at all the arm will attempt to travel 360 the long way around to arrive back to zero…instead of traveling the shorter path backwards. Both AsyncPositionController devices you see defined in the code have done this bad behavior.

Is this an error in the code you see attached or…?

MAikenMagic1102/1102X_TestCode (github.com)

It seems to me that this is happening because the rotation sensor counts up to 360 degrees then resets to 0 and the library is not coded to understand this.

Probably best to report a ticket to the OkapiLib github page for this

2 Likes