Skip to content

Commit

Permalink
⬆️3.2.1
Browse files Browse the repository at this point in the history
Merge pull request #236 from EZ-Robotics/dev
  • Loading branch information
ssejrog authored Dec 17, 2024
2 parents bf917d3 + 3899970 commit 8e08987
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 37 deletions.
Binary file modified EZ-Template-Example-Project.zip
Binary file not shown.
Binary file not shown.
Binary file modified EZ-Template-Example-Project/firmware/EZ-Template.a
Binary file not shown.
12 changes: 6 additions & 6 deletions EZ-Template-Example-Project/include/EZ-Template/PID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class PID {
double compute(double current);

/**
* Computes PID, but you compute the error yourself.
*
* Computes PID, but you compute the error yourself.
*
* Current is only used here for calculative derivative to solve derivative kick.
*
* \param err
Expand Down Expand Up @@ -247,8 +247,8 @@ class PID {
std::string name_get();

/**
* Enables / disables i resetting when sgn of error changes.
*
* Enables / disables i resetting when sgn of error changes.
*
* True resets, false doesn't.
*
* \param toggle
Expand All @@ -257,8 +257,8 @@ class PID {
void i_reset_toggle(bool toggle);

/**
* Returns if i will reset when sgn of error changes.
*
* Returns if i will reset when sgn of error changes.
*
* True resets, false doesn't.
*/
bool i_reset_get();
Expand Down
38 changes: 31 additions & 7 deletions EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ class Drive {

/**
* Adds/removes motors from drive.
*
*
* You cannot add the first index because it's used for autonomous.
*
* \param pto_list
Expand Down Expand Up @@ -2069,6 +2069,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior);

Expand All @@ -2081,6 +2083,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, bool slew_on);

Expand All @@ -2093,6 +2097,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2135,6 +2141,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, bool slew_on);

Expand All @@ -2149,6 +2157,10 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on);

Expand All @@ -2161,8 +2173,6 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed);

Expand All @@ -2175,8 +2185,8 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior);

Expand All @@ -2189,6 +2199,8 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, bool slew_on);

Expand All @@ -2201,6 +2213,10 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2229,6 +2245,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior);

Expand All @@ -2243,6 +2261,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, bool slew_on);

Expand All @@ -2257,6 +2277,10 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2617,7 +2641,7 @@ class Drive {
* Changes max speed during a drive motion.
*
* \param speed
* new clipped speed, between 0 and 127
* new clipped speed, between 0 and 127
*/
void pid_speed_max_set(int speed);

Expand Down Expand Up @@ -3228,7 +3252,7 @@ class Drive {

/**
* Checks if PID Tuner is enabled.
*
*
* True is enabled, false is disabled.
*/
bool pid_tuner_enabled();
Expand Down
16 changes: 8 additions & 8 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].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": "^4.1.1",
"system_files": [
"include\\EZ-Template\\auton.hpp",
"include\\EZ-Template\\drive\\drive.hpp",
"include\\EZ-Template\\slew.hpp",
"include\\EZ-Template\\piston.hpp",
"include\\EZ-Template\\tracking_wheel.hpp",
"include\\EZ-Template\\api.hpp",
"include\\EZ-Template\\PID.hpp",
"include\\EZ-Template\\util.hpp",
"include\\EZ-Template\\slew.hpp",
"include\\EZ-Template\\auton_selector.hpp",
"include\\EZ-Template\\sdcard.hpp",
"include\\EZ-Template\\tracking_wheel.hpp",
"include\\EZ-Template\\auton.hpp",
"include\\EZ-Template\\PID.hpp",
"include\\EZ-Template\\util.hpp",
"include\\EZ-Template\\drive\\drive.hpp",
"firmware\\EZ-Template.a"
],
"target": "v5",
"user_files": [],
"version": "3.2.0"
"version": "3.2.1"
},
"kernel": {
"location": "C:\\Users\\union\\AppData\\Roaming\\PROS\\templates\\[email protected]",
Expand Down
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
VERSION:=3.2.1
# 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
12 changes: 6 additions & 6 deletions include/EZ-Template/PID.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class PID {
double compute(double current);

/**
* Computes PID, but you compute the error yourself.
*
* Computes PID, but you compute the error yourself.
*
* Current is only used here for calculative derivative to solve derivative kick.
*
* \param err
Expand Down Expand Up @@ -247,8 +247,8 @@ class PID {
std::string name_get();

/**
* Enables / disables i resetting when sgn of error changes.
*
* Enables / disables i resetting when sgn of error changes.
*
* True resets, false doesn't.
*
* \param toggle
Expand All @@ -257,8 +257,8 @@ class PID {
void i_reset_toggle(bool toggle);

/**
* Returns if i will reset when sgn of error changes.
*
* Returns if i will reset when sgn of error changes.
*
* True resets, false doesn't.
*/
bool i_reset_get();
Expand Down
38 changes: 31 additions & 7 deletions include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ class Drive {

/**
* Adds/removes motors from drive.
*
*
* You cannot add the first index because it's used for autonomous.
*
* \param pto_list
Expand Down Expand Up @@ -2069,6 +2069,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior);

Expand All @@ -2081,6 +2083,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, bool slew_on);

Expand All @@ -2093,6 +2097,8 @@ class Drive {
* target value as a double, unit is degrees
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2135,6 +2141,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, bool slew_on);

Expand All @@ -2149,6 +2157,10 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on);

Expand All @@ -2161,8 +2173,6 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed);

Expand All @@ -2175,8 +2185,8 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior);

Expand All @@ -2189,6 +2199,8 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, bool slew_on);

Expand All @@ -2201,6 +2213,10 @@ class Drive {
* target value in okapi angle units
* \param speed
* 0 to 127, max speed during motion
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2229,6 +2245,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior);

Expand All @@ -2243,6 +2261,8 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, bool slew_on);

Expand All @@ -2257,6 +2277,10 @@ class Drive {
* 0 to 127, max speed during motion
* \param opposite_speed
* -127 to 127, max speed of the opposite side of the drive during the swing. this is used for arcs, and is defaulted to 0
* \param behavior
* changes what direction the robot will turn. can be left, right, shortest, longest, raw
* \param slew_on
* ramp up from a lower speed to your target speed
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed, e_angle_behavior behavior, bool slew_on);

Expand Down Expand Up @@ -2617,7 +2641,7 @@ class Drive {
* Changes max speed during a drive motion.
*
* \param speed
* new clipped speed, between 0 and 127
* new clipped speed, between 0 and 127
*/
void pid_speed_max_set(int speed);

Expand Down Expand Up @@ -3228,7 +3252,7 @@ class Drive {

/**
* Checks if PID Tuner is enabled.
*
*
* True is enabled, false is disabled.
*/
bool pid_tuner_enabled();
Expand Down
Loading

0 comments on commit 8e08987

Please sign in to comment.