Skip to content

Commit

Permalink
Improve swerve sim inertias and fix C++ ApplyRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
bhall-ctre committed Nov 4, 2024
1 parent 53fa17b commit 3e50ff7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class TunerConstants {


// These are only used for simulation
static constexpr units::kilogram_square_meter_t kSteerInertia = 0.00001_kg_sq_m;
static constexpr units::kilogram_square_meter_t kDriveInertia = 0.001_kg_sq_m;
static constexpr units::kilogram_square_meter_t kSteerInertia = 0.01_kg_sq_m;
static constexpr units::kilogram_square_meter_t kDriveInertia = 0.01_kg_sq_m;
// Simulated voltage necessary to overcome friction
static constexpr units::volt_t kSteerFrictionVoltage = 0.25_V;
static constexpr units::volt_t kDriveFrictionVoltage = 0.25_V;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class CommandSwerveDrivetrain : public frc2::SubsystemBase, public swerve::Swerv
*/
template <typename RequestSupplier>
requires std::derived_from<
std::invoke_result_t<RequestSupplier>,
std::remove_reference_t<std::invoke_result_t<RequestSupplier>>,
swerve::requests::SwerveRequest>
frc2::CommandPtr ApplyRequest(RequestSupplier request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class TunerConstants {


// These are only used for simulation
static constexpr units::kilogram_square_meter_t kSteerInertia = 0.00001_kg_sq_m;
static constexpr units::kilogram_square_meter_t kDriveInertia = 0.001_kg_sq_m;
static constexpr units::kilogram_square_meter_t kSteerInertia = 0.01_kg_sq_m;
static constexpr units::kilogram_square_meter_t kDriveInertia = 0.01_kg_sq_m;
// Simulated voltage necessary to overcome friction
static constexpr units::volt_t kSteerFrictionVoltage = 0.25_V;
static constexpr units::volt_t kDriveFrictionVoltage = 0.25_V;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CommandSwerveDrivetrain : public frc2::SubsystemBase, public swerve::Swerv
*/
template <typename RequestSupplier>
requires std::derived_from<
std::invoke_result_t<RequestSupplier>,
std::remove_reference_t<std::invoke_result_t<RequestSupplier>>,
swerve::requests::SwerveRequest>
frc2::CommandPtr ApplyRequest(RequestSupplier request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public class TunerConstants {


// These are only used for simulation
private static final double kSteerInertia = 0.00001;
private static final double kDriveInertia = 0.001;
private static final double kSteerInertia = 0.01;
private static final double kDriveInertia = 0.01;
// Simulated voltage necessary to overcome friction
private static final Voltage kSteerFrictionVoltage = Volts.of(0.25);
private static final Voltage kDriveFrictionVoltage = Volts.of(0.25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public class TunerConstants {


// These are only used for simulation
private static final double kSteerInertia = 0.00001;
private static final double kDriveInertia = 0.001;
private static final double kSteerInertia = 0.01;
private static final double kDriveInertia = 0.01;
// Simulated voltage necessary to overcome friction
private static final Voltage kSteerFrictionVoltage = Volts.of(0.25);
private static final Voltage kDriveFrictionVoltage = Volts.of(0.25);
Expand Down
4 changes: 2 additions & 2 deletions python/SwerveWithPathPlanner/generated/tuner_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class TunerConstants:
_pigeon_id = 1

# These are only used for simulation
_steer_inertia: units.kilogram_square_meter = 0.00001
_drive_inertia: units.kilogram_square_meter = 0.001
_steer_inertia: units.kilogram_square_meter = 0.01
_drive_inertia: units.kilogram_square_meter = 0.01
# Simulated voltage necessary to overcome friction
_steer_friction_voltage: units.volt = 0.25
_drive_friction_voltage: units.volt = 0.25
Expand Down

0 comments on commit 3e50ff7

Please sign in to comment.