Skip to content

Commit

Permalink
Use turns_per_second instead of radians_per_sec to match java
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis-Leyva committed Dec 31, 2024
1 parent 9a4dbb7 commit 3993d00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SwerveSetpointGenerator::SwerveSetpointGenerator() : maxSteerVelocity(
}

SwerveSetpointGenerator::SwerveSetpointGenerator(const RobotConfig &config,
units::radians_per_second_t maxSteerVelocity) : m_robotConfig(config), maxSteerVelocity(
units::turns_per_second_t maxSteerVelocity) : m_robotConfig(config), maxSteerVelocity(
maxSteerVelocity) {
brownoutVoltage = frc::RobotController::GetBrownoutVoltage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ class SwerveSetpointGenerator {
* Create a new swerve setpoint generator
*
* @param config The robot configuration
* @param maxSteerVelocity The maximum rotation velocity of a swerve module, in radians
* per second
* @param maxSteerVelocity The maximum rotation velocity of a swerve module, in turns per second
*/
SwerveSetpointGenerator(const RobotConfig &config,
units::radians_per_second_t maxSteerVelocity);
units::turns_per_second_t maxSteerVelocity);

/**
* Generate a new setpoint with explicit battery voltage. Note: Do not discretize ChassisSpeeds
Expand Down Expand Up @@ -99,7 +98,7 @@ class SwerveSetpointGenerator {
double kEpsilon = 1e-8;

RobotConfig m_robotConfig;
units::radians_per_second_t maxSteerVelocity;
units::turns_per_second_t maxSteerVelocity;
units::volt_t brownoutVoltage;

double findSteeringMaxS(units::meters_per_second_t x_0,
Expand Down

0 comments on commit 3993d00

Please sign in to comment.