Skip to content

Commit

Permalink
Updated to EZ-Template 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ssejrog committed Dec 14, 2021
1 parent fcaa790 commit d28bc0f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
Binary file renamed [email protected][email protected]
Binary file not shown.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

EZ-Template is a simple plug-and-play PROS template that handles drive base functions for VEX robots.

[EZ-Template Version](https://github.com/EZ-Robotics/EZ-Template): 2.0.0
[Example Project Version](https://github.com/EZ-Robotics/EZ-Template-Example): 1.0.1
[EZ-Template Version](https://github.com/EZ-Robotics/EZ-Template): 2.0.1
[Example Project Version](https://github.com/EZ-Robotics/EZ-Template-Example): 1.1.0

[Autonomous routines that used EZ-Template](https://photos.app.goo.gl/yRwuvmq7hDoM4f6EA)

Expand All @@ -20,7 +20,7 @@ EZ-Template is a simple plug-and-play PROS template that handles drive base func
*Note: this only works for 2.0.0 and beyond. You cannot upgrade from 1.X.X to 2.X.X.*
1) Download the most recent EZ-Template [here](https://github.com/EZ-Robotics/EZ-Template/releases/latest).
2) In your terminal, `cd` into the directory you downloaded the file.
3) Run this command from terminal `prosv5 c fetch [email protected].0.zip`.
3) Run this command from terminal `prosv5 c fetch [email protected].1.zip`.
4) `cd` into your pros project directory in your terminal.
5) Apply the library to the project `prosv5 c apply EZ-Template`.
6) Put `#include "EZ-Template/api.hpp"` in your `include/main.h`.
Expand Down
Binary file modified firmware/EZ-Template.a
Binary file not shown.
2 changes: 1 addition & 1 deletion include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class Drive {
* Set Either the headingPID, turnPID, forwardPID, backwardPID, activeBrakePID, or swingPID
* IF NOT DONE PID WILL DEFAULT TO 0!
*/
void set_pid_constants(PID pid, double p, double i, double d, double p_start_i);
void set_pid_constants(PID* pid, double p, double i, double d, double p_start_i);

/**
* Sets minimum slew speed constants.
Expand Down
2 changes: 2 additions & 0 deletions include/autons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ void combining_movements();
void interfered_example();

void default_constants();
void one_mogo_constants();
void two_mogo_constants();
12 changes: 6 additions & 6 deletions project.pros
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
"target": "v5",
"templates": {
"EZ-Template": {
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected].0",
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected].1",
"metadata": {
"origin": "local"
},
"name": "EZ-Template",
"py/object": "pros.conductor.templates.local_template.LocalTemplate",
"supported_kernels": "^3.5.4",
"system_files": [
"include\\EZ-Template\\auton.hpp",
"include\\EZ-Template\\api.hpp",
"include\\EZ-Template\\auton_selector.hpp",
"include\\EZ-Template\\drive\\drive.hpp",
"include\\EZ-Template\\PID.hpp",
"include\\EZ-Template\\auton_selector.hpp",
"include\\EZ-Template\\auton.hpp",
"firmware\\EZ-Template.a",
"include\\EZ-Template\\util.hpp",
"include\\EZ-Template\\sdcard.hpp",
"firmware\\EZ-Template.a"
"include\\EZ-Template\\sdcard.hpp"
],
"target": "v5",
"user_files": [],
"version": "2.0.0"
"version": "2.0.1"
},
"kernel": {
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected]",
Expand Down
36 changes: 17 additions & 19 deletions src/autons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,33 @@ const int SWING_SPEED = 90;
void default_constants() {
chassis.set_slew_min_power(80, 80);
chassis.set_slew_distance(7, 7);
chassis.set_pid_constants(chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(chassis.swingPID, 7, 0, 45, 0);
chassis.set_pid_constants(&chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(&chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(&chassis.swingPID, 7, 0, 45, 0);
}

/*
void one_mogo_constants() {
chassis.set_slew_min_power(80, 80);
chassis.set_slew_distance(7, 7);
chassis.set_pid_constants(chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(chassis.swingPID, 7, 0, 45, 0);
chassis.set_pid_constants(&chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(&chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(&chassis.swingPID, 7, 0, 45, 0);
}

void two_mogo_constants() {
chassis.set_slew_min_power(80, 80);
chassis.set_slew_distance(7, 7);
chassis.set_pid_constants(chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(chassis.swingPID, 7, 0, 45, 0);
chassis.set_pid_constants(&chassis.headingPID, 11, 0, 20, 0);
chassis.set_pid_constants(&chassis.forward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.backward_drivePID, 0.45, 0, 5, 0);
chassis.set_pid_constants(&chassis.turnPID, 5, 0.003, 35, 15);
chassis.set_pid_constants(&chassis.swingPID, 7, 0, 45, 0);
}
*/




Expand Down Expand Up @@ -212,7 +210,7 @@ void tug (int attempts) {
chassis.set_drive_pid(-2, 20);
pros::delay(1000);
}
// If robot succesfully drove back, return
// If robot successfully drove back, return
else {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void initialize() {
chassis.toggle_modify_curve_with_controller(true); // Enables modifying the controller curve with buttons on the joysticks
chassis.set_active_brake(0); // Sets the active brake kP. We recommend 0.1.
chassis.set_curve_default(0, 0); // Defaults for curve. (Comment this line out if you have an SD card!)
// default_constants(); // Set the drive to your own constants from autons.cpp!
default_constants(); // Set the drive to your own constants from autons.cpp!

// These are already defaulted to these buttons, but you can change the left/right curve buttons here!
// chassis.set_left_curve_buttons (pros::E_CONTROLLER_DIGITAL_LEFT, pros::E_CONTROLLER_DIGITAL_RIGHT);
Expand Down

0 comments on commit d28bc0f

Please sign in to comment.