Having multiple motors/motor group objects on one port can lead to issues with get_position(). Motors/motor groups should return the same position regardless of the direction each object is in. I believe that the solution is to use the sign of the motor's port to modify the position/velocity of the move command (not sure exactly how to modify each function). It appears that reversing the motor in the middle of movement causes very weird behavior with VexOS.
Steps to reproduce:
Create two motor group objects on the same port with different directions.
Tell one of the groups to move
Read the value position of the other motor group or both motor groups in a loop. It will not be correct.
Expected Behavior:
Having multiple motors/motor group objects on one port can lead to issues with
get_position()
. Motors/motor groups should return the same position regardless of the direction each object is in. I believe that the solution is to use the sign of the motor's port to modify the position/velocity of the move command (not sure exactly how to modify each function). It appears that reversing the motor in the middle of movement causes very weird behavior with VexOS.Steps to reproduce:
Example:
Relevant Thread:
https://discordapp.com/channels/1025259843763847229/1071283409407709205