Skip to content

Commit

Permalink
⬆️3.2.0-beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ssejrog committed Dec 2, 2024
1 parent c3430c4 commit 5fbede5
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 24 deletions.
Binary file not shown.
Binary file modified EZ-Template-Example-Project/firmware/EZ-Template.a
Binary file not shown.
5 changes: 5 additions & 0 deletions EZ-Template-Example-Project/include/EZ-Template/PID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
53 changes: 41 additions & 12 deletions EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<const_and_name> 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<const_and_name> 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},
Expand Down Expand Up @@ -3138,6 +3165,8 @@ class Drive {
double odom_ime_track_width_right = 0.0;

private:
bool is_full_pid_tuner_enabled = false;
std::vector<const_and_name>* used_pid_tuner_pids;
double opcontrol_speed_max = 127.0;
bool arcade_vector_scaling = false;
// odom privates
Expand Down
20 changes: 10 additions & 10 deletions EZ-Template-Example-Project/project.pros
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
"target": "v5",
"templates": {
"EZ-Template": {
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected].7",
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected].8",
"metadata": {
"origin": "local"
},
"name": "EZ-Template",
"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\\[email protected]",
Expand Down
Binary file renamed [email protected][email protected]
Binary file not shown.
Binary file renamed [email protected][email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0-beta.7
3.2.0-beta.8

0 comments on commit 5fbede5

Please sign in to comment.