EZ-Template
EZ-Template is a simple plug-and-play PROS template that handles drive base functions, autonomous selector, input curves, and active brake with PTO support.
Features
- Simple to setup
- PID for driving, turning, and swing turns
- Speed ramp-up for driving
- Asynchronous PID with blocking functions until settled and until a specific position has come
- Joystick input curves
- Live adjustment of input curves
- Basic autonomous selector
- SD card saving of autonomous selector and joystick curves
- "Tug of war" detection for autonomous
- PID exit conditions for when drive motors overheat
- Tank drive, single stick arcade, and dual stick arcade
- Loading animation during IMU calibration
- 3 wire encoder and rotation sensor support
- Add / remove motors from the drive dynamically to allow for PTO use
- Exposed PID class for use with your other subsystems
Installation
- Download the latest
Example-Project.zip
here. Extract the zip, and open it in PROS. - In
src/main.cpp
, configure drive and IMU ports to what they are on your robot. Be sure to read the comments! - Configure your wheel size and cartridge. Remember that older 4" omni wheels without mounting holes are actually 4.125!
- In
src/main.cpp
, at the bottom invoid opcontrol()
, decide how you'd like to control your robot! Any flavor of arcade or tank! - Turn the robot on and use it in driver control. Make sure the ports are correct and reversed correctly.
- To test the test autonomous modes, plug into a competition switch and select the autonomous mode on the brain screen by pressing the left and right buttons. The current page will be the autonomous that runs. For making new autonomous routines, click here for examples on how to use the drive functions.
Upgrading
warning
This only works for 2.x and beyond. You cannot upgrade from 1.x to 2.x without changing code.
- Download the most recent
EZ-Template@x.x.x.zip
here. - Move the file to your project.
- Open terminal or command prompt, and
cd
into your projects directory. - Run this command from terminal
pros c fetch EZ-Template@x.x.x.zip
replacingx.x.x
with the version number of your file. - Apply the library to the project
pros c apply EZ-Template
.