diff --git a/EZ-Template-Example-Project/EZ-Template@3.2.0-beta.7.zip b/EZ-Template-Example-Project/EZ-Template@3.2.0-beta.8.zip similarity index 59% rename from EZ-Template-Example-Project/EZ-Template@3.2.0-beta.7.zip rename to EZ-Template-Example-Project/EZ-Template@3.2.0-beta.8.zip index b447412e..7c8de9b1 100644 Binary files a/EZ-Template-Example-Project/EZ-Template@3.2.0-beta.7.zip and b/EZ-Template-Example-Project/EZ-Template@3.2.0-beta.8.zip differ diff --git a/EZ-Template-Example-Project/firmware/EZ-Template.a b/EZ-Template-Example-Project/firmware/EZ-Template.a index d9cbabf2..c87730fb 100644 Binary files a/EZ-Template-Example-Project/firmware/EZ-Template.a and b/EZ-Template-Example-Project/firmware/EZ-Template.a differ diff --git a/EZ-Template-Example-Project/include/EZ-Template/PID.hpp b/EZ-Template-Example-Project/include/EZ-Template/PID.hpp index 062bffe7..f0f35783 100644 --- a/EZ-Template-Example-Project/include/EZ-Template/PID.hpp +++ b/EZ-Template-Example-Project/include/EZ-Template/PID.hpp @@ -122,6 +122,11 @@ class PID { */ Constants constants_get(); + /** + * Returns true if PID constants are set, returns false if they're all 0 + */ + bool constants_set_check(); + /** * Resets all variables to 0. This does not reset constants. */ diff --git a/EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp b/EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp index 51932737..a4549e1b 100644 --- a/EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp +++ b/EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp @@ -110,13 +110,15 @@ class Drive { */ PID headingPID; PID turnPID; - PID forward_drivePID; PID leftPID; PID rightPID; + PID forward_drivePID; PID backward_drivePID; + PID fwd_rev_drivePID; PID swingPID; PID forward_swingPID; PID backward_swingPID; + PID fwd_rev_swingPID; PID xyPID; PID current_a_odomPID; PID boomerangPID; @@ -338,7 +340,7 @@ class Drive { /** * Sets current mode of drive. */ - void drive_mode_set(e_mode p_mode); + void drive_mode_set(e_mode p_mode, bool stop_drive = true); /** * Returns current mode of drive. @@ -626,12 +628,12 @@ class Drive { * Flips the rotation axis * * \param flip - * true means clockwise is positive, false means counterclockwise is positive + * true means counterclockwise is positive, false means clockwise is positive */ void odom_theta_flip(bool flip = true); /** - * Checks if the rotation axis is flipped. True means clockwise is positive, false means counterclockwise is positive + * Checks if the rotation axis is flipped. True means counterclockwise is positive, false means clockwise is positive */ bool odom_theta_direction_get(); @@ -2363,13 +2365,13 @@ class Drive { */ void pid_wait_until_index_started(int index); - /** - * Lock the code in a while loop until this point has been passed. - * - * \param target - * {x, y} a pose for the robot to pass through before the while loop is released - */ - void pid_wait_until_point(pose target); + /** + * Lock the code in a while loop until this point has been passed. + * + * \param target + * {x, y} a pose for the robot to pass through before the while loop is released + */ + void pid_wait_until_point(pose target); /** * Lock the code in a while loop until this point has been passed, with okapi units. @@ -3089,15 +3091,40 @@ class Drive { */ double pid_tuner_increment_start_i_get(); + /** + * Enables the full PID tuner with unique fwd/rev constants + * + * \param enable + * bool, true will enable the full PID tuner, false will use the simplified PID tuner + */ + void pid_tuner_full_enable(bool enable); + + /** + * Returns if the full PID tuner with unique fwd/rev constants is enabled. + * True means the full PID tuner is enabled, false means the simplified PID tuner is enabled. + */ + bool pid_tuner_full_enabled(); + struct const_and_name { std::string name = ""; PID::Constants* consts; }; /** - * Vector used for PID Tuner + * Vector used for a simplified PID Tuner */ std::vector pid_tuner_pids = { + {"Drive PID Constants", &fwd_rev_drivePID.constants}, + {"Odom Angular PID Constants", &odom_angularPID.constants}, + {"Boomerang Angular PID Constants", &boomerangPID.constants}, + {"Heading PID Constants", &headingPID.constants}, + {"Turn PID Constants", &turnPID.constants}, + {"Swing PID Constants", &fwd_rev_swingPID.constants}}; + + /** + * Vector used for the full PID Tuner + */ + std::vector pid_tuner_full_pids = { {"Drive Forward PID Constants", &forward_drivePID.constants}, {"Drive Backward PID Constants", &backward_drivePID.constants}, {"Odom Angular PID Constants", &odom_angularPID.constants}, @@ -3138,6 +3165,8 @@ class Drive { double odom_ime_track_width_right = 0.0; private: + bool is_full_pid_tuner_enabled = false; + std::vector* used_pid_tuner_pids; double opcontrol_speed_max = 127.0; bool arcade_vector_scaling = false; // odom privates diff --git a/EZ-Template-Example-Project/project.pros b/EZ-Template-Example-Project/project.pros index 6c7f682c..25a26bf6 100644 --- a/EZ-Template-Example-Project/project.pros +++ b/EZ-Template-Example-Project/project.pros @@ -5,7 +5,7 @@ "target": "v5", "templates": { "EZ-Template": { - "location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\EZ-Template@3.2.0-beta.7", + "location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\EZ-Template@3.2.0-beta.8", "metadata": { "origin": "local" }, @@ -13,21 +13,21 @@ "py/object": "pros.conductor.templates.local_template.LocalTemplate", "supported_kernels": "^4.1.1", "system_files": [ - "include\\EZ-Template\\auton_selector.hpp", - "include\\EZ-Template\\api.hpp", + "include\\EZ-Template\\util.hpp", + "include\\EZ-Template\\sdcard.hpp", + "include\\EZ-Template\\tracking_wheel.hpp", + "include\\EZ-Template\\drive\\drive.hpp", + "include\\EZ-Template\\piston.hpp", "include\\EZ-Template\\PID.hpp", "firmware\\EZ-Template.a", + "include\\EZ-Template\\auton_selector.hpp", "include\\EZ-Template\\slew.hpp", - "include\\EZ-Template\\piston.hpp", - "include\\EZ-Template\\util.hpp", - "include\\EZ-Template\\drive\\drive.hpp", - "include\\EZ-Template\\auton.hpp", - "include\\EZ-Template\\tracking_wheel.hpp", - "include\\EZ-Template\\sdcard.hpp" + "include\\EZ-Template\\api.hpp", + "include\\EZ-Template\\auton.hpp" ], "target": "v5", "user_files": [], - "version": "3.2.0-beta.7" + "version": "3.2.0-beta.8" }, "kernel": { "location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\kernel@4.1.1", diff --git a/EZ-Template-Example-Project@3.2.0-beta.7.zip b/EZ-Template-Example-Project@3.2.0-beta.8.zip similarity index 84% rename from EZ-Template-Example-Project@3.2.0-beta.7.zip rename to EZ-Template-Example-Project@3.2.0-beta.8.zip index 9672bfd0..a8bf672f 100644 Binary files a/EZ-Template-Example-Project@3.2.0-beta.7.zip and b/EZ-Template-Example-Project@3.2.0-beta.8.zip differ diff --git a/EZ-Template@3.2.0-beta.7.zip b/EZ-Template@3.2.0-beta.8.zip similarity index 59% rename from EZ-Template@3.2.0-beta.7.zip rename to EZ-Template@3.2.0-beta.8.zip index b447412e..7c8de9b1 100644 Binary files a/EZ-Template@3.2.0-beta.7.zip and b/EZ-Template@3.2.0-beta.8.zip differ diff --git a/Makefile b/Makefile index e5221a29..1aa888f3 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ EXCLUDE_COLD_LIBRARIES:= IS_LIBRARY:=1 # TODO: CHANGE THIS! LIBNAME:=EZ-Template -VERSION:=3.2.0-beta.7 +VERSION:=3.2.0-beta.8 # EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c # this line excludes opcontrol.c and similar files EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/autons $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext))) diff --git a/version b/version index b91f243d..24fa7738 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.2.0-beta.7 \ No newline at end of file +3.2.0-beta.8 \ No newline at end of file