Added configurable heading correction deadband

This commit is contained in:
thenetworkgrinch
2024-01-18 15:37:24 -06:00
parent 83f80a91d7
commit ac980a91b6
108 changed files with 178 additions and 166 deletions

View File

@@ -74,7 +74,7 @@ public class SwerveDrive
/**
* Deadband for speeds in heading correction.
*/
private final double HEADING_CORRECTION_DEADBAND = 0.01;
private double HEADING_CORRECTION_DEADBAND = 0.01;
/**
* Field object.
*/
@@ -314,8 +314,20 @@ public class SwerveDrive
* @param state {@link SwerveDrive#headingCorrection} state.
*/
public void setHeadingCorrection(boolean state)
{
setHeadingCorrection(state, HEADING_CORRECTION_DEADBAND);
}
/**
* Set the heading correction capabilities of YAGSL.
*
* @param state {@link SwerveDrive#headingCorrection} state.
* @param deadband {@link SwerveDrive#HEADING_CORRECTION_DEADBAND} deadband.
*/
public void setHeadingCorrection(boolean state, double deadband)
{
headingCorrection = state;
HEADING_CORRECTION_DEADBAND = deadband;
}
/**