32 std::unique_ptr<BaseController> azimuthMotor;
33 std::unique_ptr<BaseController> driveMotor;
34 frc::Translation2d location;
37 units::kilogram_square_meter_t driveInertia = 0.035_kg_sq_m;
38 units::kilogram_square_meter_t azimuthInertia = 0.01_kg_sq_m;
41 SwerveModule(
Config config, units::meter_t wheelDiameter);
43 frc::SwerveModuleState GetState()
const;
45 constexpr frc::SwerveModuleState GetDesiredState()
const {
return desiredState; }
47 frc::SwerveModulePosition GetPosition()
const;
49 units::meters_per_second_t GetMaxSpeed()
const;
51 frc::Translation2d GetLocation()
const {
return location; }
53 constexpr units::meter_t GetWheelDiameter()
const {
return wheelConversion * 1_tr / std::numbers::pi; }
55 void ApplyRequest(requests::ApplyState);
57 inline BaseController& GetDriveMotor()
const {
return *driveMotor; }
59 inline BaseController& GetAzimuthMotor()
const {
return *azimuthMotor; }
67 void SimulationPeriodic();
70 std::unique_ptr<BaseController> azimuthMotor;
71 std::unique_ptr<BaseController> driveMotor;
73 decltype(1_m / 1_tr) wheelConversion;
74 frc::Translation2d location;
76 frc::sim::DCMotorSim driveSim;
77 frc::sim::DCMotorSim azimuthSim;
79 frc::SwerveModuleState desiredState;