I’ve been trying to implement three tracking wheel odometry using Okapilib and PROS, and no matter what my robot does not even move. I’ve rewritten the code multiple times and even straight up copy-pasted the tutorial code from here. On top of this, driver control does not work after I try to run the auton, as if the entire program is locked up. Driver will work if I don’t try the auton, but not after I try it.
my code:
I would recommend first setting the default Logger to the terminal. They have a tutorial on how to do that. If Okapi comes across an error that it realizes, then it will say so. Also make sure that you use the builder in the right scope, as the builders delete the objects when the parent task is complete. Also a complete file would make it easier to help.
After changing the scope of the declaration of the chassis builder, it now moves. However, it now does not stop moving.
I put the logger into my program, and the terminal is now outputting: ERROR: ThreeEncoderOdometry: A tick diff (2147483647) was greater than the maximum allowable diff (1000). Skipping this odometry step.
21474836427 is the int max. This suggests that something is wrong with one of the encoders. As such, the robot will probably not think it has gotten to it’s destination. You may want to declare them outside of the builder and pass them through and check to see which one it is.
Passing already declared encoders yielded the same error, and after printing the values of the three encoders to the terminal, they are all at that value. I tested new encoders and a new brain, and the same values occurred.
I have an idea. I’m think I recall seeing sometime back that PROS is only designed to used quad encoders when their first wire is on an odd port (A, C, E, G or 1, 3, 5, 7) with the second wire being on the next port. This may still be the case.