Last updated
Last updated
A basic full op-mode example is at the page.
Here is a full op-mode example of a state machine in combination with the Roadrunner Library:
This machine will check if more than 9 seconds have elapsed in the state without completing the trajectory, and if the trajectory has not been completed, go back to the start of the trajectory to try again. This use of fallback and pointer states allows for a more adaptive autonomous that will try to compensate for disturbances or errors.
To run a machine that uses Roadrunner, you would simply add drive.update()
to the loop that you are calling machine.update()
in. This example also uses telemetry
, so it would be necessary to add telemetry.update()
to the loop as well.
The machine shown above is relatively basic. It will follow the first trajectory sequence, and when that is done, follow the second. We can make this machine more adaptive by using functions covered in .
Another full op-mode example is located at the end of the section.
Useful examples of combination with other libraries and common use cases.