setting up the starter files

This commit is contained in:
Carter committed 2026-07-21 16:25:28 -04:00
1 parent 2c7628bb9f
commit 6be8dd7070
4 files changed
+31 -24

No files matched your search

+2 -2
View File
@@ -26,9 +26,9 @@ extern pros::Controller master;
namespace ez { namespace ez {
/** /**
* Prints our branding all over your pros terminal. * Prints your chooses logo in the terminal
*/ */
void ez_template_print(); void logo_print();
/** /**
* Prints to the brain screen in one string. * Prints to the brain screen in one string.
+6 -9
View File
@@ -14,18 +14,15 @@ pros::Controller master(pros::E_CONTROLLER_MASTER);
namespace ez { namespace ez {
int mode = DISABLE; int mode = DISABLE;
void ez_template_print() { void logo_print() {
std::cout << R"( std::cout << R"(
_________ ________ ____ __
< < /__ \ / ____/ // /\ \/ /
/ // /__/ //___ \/ // /_ \ /
/ // // __/____/ /__ __/ / /
/_//_//____/_____/ /_/ /_/
_____ ______ _____ _ _
| ___|___ / |_ _| | | | |
| |__ / /_____| | ___ _ __ ___ _ __ | | __ _| |_ ___
| __| / /______| |/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \
| |___./ /___ | | __/ | | | | | |_) | | (_| | || __/
\____/\_____/ \_/\___|_| |_| |_| .__/|_|\__,_|\__\___|
| |
|_|
)" << '\n'; )" << '\n';
} }
std::string get_last_word(std::string text) { std::string get_last_word(std::string text) {
+5
View File
@@ -48,6 +48,11 @@ void default_constants() {
chassis.pid_angle_behavior_set(ez::shortest); // Changes the default behavior for turning, this defaults it to the shortest path there chassis.pid_angle_behavior_set(ez::shortest); // Changes the default behavior for turning, this defaults it to the shortest path there
} }
///
// Custom auton routes
//
/// ///
// Drive Example // Drive Example
/// ///
+18 -13
View File
@@ -12,8 +12,8 @@ ez::Drive chassis(
{11, 15, 16, 17}, // Right Chassis Ports (negative port will reverse it!) {11, 15, 16, 17}, // Right Chassis Ports (negative port will reverse it!)
21, // IMU Port 21, // IMU Port
4.125, // Wheel Diameter (Remember, 4" wheels without screw holes are actually 4.125!) 3.25, // Wheel Diameter (Remember, 4" wheels without screw holes are actually 4.125!)
420.0); // Wheel RPM = cartridge * (motor gear / wheel gear) 360.0); // Wheel RPM = cartridge * (motor gear / wheel gear)
// Uncomment the trackers you're using here! // Uncomment the trackers you're using here!
// - `8` and `9` are smart ports (making these negative will reverse the sensor) // - `8` and `9` are smart ports (making these negative will reverse the sensor)
@@ -30,8 +30,8 @@ ez::Drive chassis(
* to keep execution time for this mode under a few seconds. * to keep execution time for this mode under a few seconds.
*/ */
void initialize() { void initialize() {
// Print our branding over your terminal :D // Prints your logo in the terminal
ez::ez_template_print(); ez::logo_print();
pros::delay(500); // Stop the user from doing anything while legacy ports configure pros::delay(500); // Stop the user from doing anything while legacy ports configure
@@ -58,7 +58,10 @@ void initialize() {
// Autonomous Selector using LLEMU // Autonomous Selector using LLEMU
ez::as::auton_selector.autons_add({ ez::as::auton_selector.autons_add({
{"Drive\n\nDrive forward and come back", drive_example}, //Custom autonomouse routes go here.
/*{"Drive\n\nDrive forward and come back", drive_example},
{"Turn\n\nTurn 3 times.", turn_example}, {"Turn\n\nTurn 3 times.", turn_example},
{"Drive and Turn\n\nDrive forward, turn, come back", drive_and_turn}, {"Drive and Turn\n\nDrive forward, turn, come back", drive_and_turn},
{"Drive and Turn\n\nSlow down during drive", wait_until_change_speed}, {"Drive and Turn\n\nSlow down during drive", wait_until_change_speed},
@@ -71,7 +74,7 @@ void initialize() {
{"Pure Pursuit Wait Until\n\nGo to (24, 24) but start running an intake once the robot passes (12, 24)", odom_pure_pursuit_wait_until_example}, {"Pure Pursuit Wait Until\n\nGo to (24, 24) but start running an intake once the robot passes (12, 24)", odom_pure_pursuit_wait_until_example},
{"Boomerang\n\nGo to (0, 24, 45) then come back to (0, 0, 0)", odom_boomerang_example}, {"Boomerang\n\nGo to (0, 24, 45) then come back to (0, 0, 0)", odom_boomerang_example},
{"Boomerang Pure Pursuit\n\nGo to (0, 24, 45) on the way to (24, 24) then come back to (0, 0, 0)", odom_boomerang_injected_pure_pursuit_example}, {"Boomerang Pure Pursuit\n\nGo to (0, 24, 45) on the way to (24, 24) then come back to (0, 0, 0)", odom_boomerang_injected_pure_pursuit_example},
{"Measure Offsets\n\nThis will turn the robot a bunch of times and calculate your offsets for your tracking wheels.", measure_offsets}, {"Measure Offsets\n\nThis will turn the robot a bunch of times and calculate your offsets for your tracking wheels.", measure_offsets},*/
}); });
// Initialize chassis and auton selector // Initialize chassis and auton selector
@@ -169,10 +172,10 @@ void ez_screen_task() {
1); // Don't override the top Page line 1); // Don't override the top Page line
// Display all trackers that are being used // Display all trackers that are being used
screen_print_tracker(chassis.odom_tracker_left, "l", 4); screen_print_tracker(chassis.odom_tracker_left, "L", 4);
screen_print_tracker(chassis.odom_tracker_right, "r", 5); screen_print_tracker(chassis.odom_tracker_right, "R", 5);
screen_print_tracker(chassis.odom_tracker_back, "b", 6); screen_print_tracker(chassis.odom_tracker_back, "B", 6);
screen_print_tracker(chassis.odom_tracker_front, "f", 7); screen_print_tracker(chassis.odom_tracker_front, "F", 7);
} }
} }
} }
@@ -241,14 +244,16 @@ void ez_template_extras() {
*/ */
void opcontrol() { void opcontrol() {
// This is preference to what you like to drive on // This is preference to what you like to drive on
chassis.drive_brake_set(MOTOR_BRAKE_COAST); chassis.drive_brake_set(MOTOR_BRAKE_HOLD);
while (true) { while (true) {
// Gives you some extras to make EZ-Template ezier // Gives you some extras to make EZ-Template ezier
ez_template_extras(); ez_template_extras();
chassis.opcontrol_tank(); // Tank control // Place to call custom functions for driver control
// chassis.opcontrol_arcade_standard(ez::SPLIT); // Standard split arcade
// chassis.opcontrol_tank(); // Tank control
chassis.opcontrol_arcade_standard(ez::SPLIT); // Standard split arcade
// chassis.opcontrol_arcade_standard(ez::SINGLE); // Standard single arcade // chassis.opcontrol_arcade_standard(ez::SINGLE); // Standard single arcade
// chassis.opcontrol_arcade_flipped(ez::SPLIT); // Flipped split arcade // chassis.opcontrol_arcade_flipped(ez::SPLIT); // Flipped split arcade
// chassis.opcontrol_arcade_flipped(ez::SINGLE); // Flipped single arcade // chassis.opcontrol_arcade_flipped(ez::SINGLE); // Flipped single arcade