[wpimath] Fix units of RamseteController's b and zeta (#3757)

Fixes #3755.
This commit is contained in:
Tyler Veness
2021-12-03 18:21:30 -08:00
committed by GitHub
parent 5da54888f8
commit 04957a6d30
6 changed files with 62 additions and 31 deletions

View File

@@ -5,6 +5,7 @@
#include <frc/kinematics/DifferentialDriveKinematics.h>
#include <frc/trajectory/constraint/DifferentialDriveKinematicsConstraint.h>
#include <units/acceleration.h>
#include <units/angle.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
@@ -62,8 +63,8 @@ constexpr auto kMaxAcceleration = 3_mps_sq;
// Reasonable baseline values for a RAMSETE follower in units of meters and
// seconds
constexpr double kRamseteB = 2;
constexpr double kRamseteZeta = 0.7;
constexpr auto kRamseteB = 2.0 * 1_rad * 1_rad / (1_m * 1_m);
constexpr auto kRamseteZeta = 0.7 / 1_rad;
} // namespace AutoConstants
namespace OIConstants {

View File

@@ -74,8 +74,8 @@ constexpr auto kMaxAcceleration = 3_mps_sq;
// Reasonable baseline values for a RAMSETE follower in units of meters and
// seconds
constexpr double kRamseteB = 2;
constexpr double kRamseteZeta = 0.7;
constexpr auto kRamseteB = 2 * 1_rad * 1_rad / (1_m * 1_m);
constexpr auto kRamseteZeta = 0.7 / 1_rad;
} // namespace AutoConstants
namespace OIConstants {