Getting Started
Install the toolchain, create your first PROS project, and add the LemLib motion-control library.
Which software/solution to use?
The following (and the rest of my tutorial) focuses on my own design decisions. Don't simply follow the same route I did. Think for yourself, research, and note pros/cons. Document everything behind your decision in the Engineering Notebook!
PROS
PROS is an alternative operating system to the official VEXcode. You can create the same autonomous programs with either software. I chose to use PROS over VEXCode for the following reasons.
PROS gives you:
- More support - in V5, most people use PROS. This means using PROS will make it easier to get help if something doesn't work.
- Easier use - this comes down to preference, but I found PROS more intuitive to use
- Documentation - (in my opinion) the API is more clearly documented than VEXCode's, which makes it easier to implement new functionality
LemLib
LemLib is an open-source motion-control library built on top of PROS.
LemLib gives you:
- Odometry – tracks your robot's X, Y, and heading on the field
- PID movement –
moveToPoint,turnToHeading,swingToHeading - Boomerang – move to target poses (accurate end position & heading)
- Support – LemLib has a big community and its own Discord server. Again, this saves time if you encounter a problem you can't solve.
While I had learned how to code many of these features previously, using a library made it quicker to work on the actual auton routes rather than spending lots of time recreating code that had been written many times before.
IMPORTANT: You cannot legally use a library without having the coding skills to create similar functionality yourself. You should understand a library very well before using it. In the long run, this will make it easier to add your own functions and fix any bugs you encounter.Project Entry Points
PROS defines four callback functions that you fill in:
| Function | When it runs | Typical use |
|---|---|---|
initialize() | Immediately on power-on | Calibrate sensors, start background tasks, show LCD |
disabled() | Robot disabled by FMS/switch | Usually empty |
competition_initialize() | Connected to FMS, before auton | Auton selector |
autonomous() | 15-second auton period (or 60-second skills) | Run the selected auton routine |
opcontrol() | 1:45 driver control period | Read controller, drive motors |