Added heading angular velocity deadband from 1466

This commit is contained in:
thenetworkgrinch
2023-02-23 22:46:43 -06:00
parent b484ed9bc0
commit 9b699291e8
107 changed files with 197 additions and 130 deletions

View File

@@ -189,4 +189,15 @@ public class SwerveController
config.maxAngularVelocity);
}
/**
* Calculate the angular velocity given the current and target heading angle in radians.
*
* @param currentHeadingAngleRadians The current heading of the robot in radians.
* @param targetHeadingAngleRadians The target heading of the robot in radians.
* @return Angular velocity in radians per second.
*/
public double headingCalculate(double currentHeadingAngleRadians, double targetHeadingAngleRadians)
{
return thetaController.calculate(currentHeadingAngleRadians, targetHeadingAngleRadians) * config.maxAngularVelocity;
}
}