Skip to content

Commit

Permalink
fixup aimandrange
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 24, 2024
1 parent be53a7f commit 18a374d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ SwerveDriveSim::SwerveDriveSim(
: SwerveDriveSim(
frc::LinearSystem<2, 1, 2>{
(Eigen::MatrixXd(2, 2) << 0.0, 1.0, 0.0,
-driveFF.kV.to<double>() / driveFF.kA.to<double>())
-driveFF.GetKv().to<double>() / driveFF.GetKa().to<double>())
.finished(),
Eigen::Matrix<double, 2, 1>{0.0, 1.0 / driveFF.kA.to<double>()},
Eigen::Matrix<double, 2, 1>{0.0, 1.0 / driveFF.GetKa().to<double>()},
(Eigen::MatrixXd(2, 2) << 1.0, 0.0, 0.0, 1.0).finished(),
Eigen::Matrix<double, 2, 1>{0.0, 0.0}},
driveFF.kS, driveMotor, driveGearing, driveWheelRadius,
driveFF.GetKs(), driveMotor, driveGearing, driveWheelRadius,
frc::LinearSystem<2, 1, 2>{
(Eigen::MatrixXd(2, 2) << 0.0, 1.0, 0.0,
-steerFF.kV.to<double>() / steerFF.kA.to<double>())
-steerFF.GetKv().to<double>() / steerFF.GetKa().to<double>())
.finished(),
Eigen::Matrix<double, 2, 1>{0.0, 1.0 / steerFF.kA.to<double>()},
Eigen::Matrix<double, 2, 1>{0.0, 1.0 / steerFF.GetKa().to<double>()},
(Eigen::MatrixXd(2, 2) << 1.0, 0.0, 0.0, 1.0).finished(),
Eigen::Matrix<double, 2, 1>{0.0, 0.0}},
steerFF.kS, steerMotor, steerGearing, kinematics) {}
steerFF.GetKs(), steerMotor, steerGearing, kinematics) {}

SwerveDriveSim::SwerveDriveSim(
const frc::LinearSystem<2, 1, 2>& drivePlant, units::volt_t driveKs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <frc/geometry/Transform3d.h>
#include <frc/geometry/Translation2d.h>
#include <units/length.h>
#include <units/angular_velocity.h>
#include <units/acceleration.h>
#include <units/velocity.h>
#include <units/angular_acceleration.h>

namespace constants {
namespace Vision {
Expand All @@ -46,6 +50,7 @@ inline const Eigen::Matrix<double, 3, 1> kSingleTagStdDevs{4, 4, 8};
inline const Eigen::Matrix<double, 3, 1> kMultiTagStdDevs{0.5, 0.5, 1};
} // namespace Vision
namespace Swerve {
using namespace units;

inline constexpr units::meter_t kTrackWidth{18.5_in};
inline constexpr units::meter_t kTrackLength{18.5_in};
Expand Down Expand Up @@ -73,6 +78,9 @@ inline constexpr double kSteerKP = 20.0;
inline constexpr double kSteerKI = 0.0;
inline constexpr double kSteerKD = 0.25;


using namespace units;

inline const frc::SimpleMotorFeedforward<units::meters> kDriveFF{
0.25_V, 2.5_V / 1_mps, 0.3_V / 1_mps_sq};

Expand Down

0 comments on commit 18a374d

Please sign in to comment.