mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
auto paths and heading = 0
This commit is contained in:
@@ -66,9 +66,9 @@ public final class Constants {
|
||||
|
||||
// swerve auto constants
|
||||
public static final PIDController X_CONTROLLER = new PIDController(4.0, 0.0, 0.0);
|
||||
public static final PIDController Y_CONTROLLER = new PIDController(4.0, 0.0, 0.0);
|
||||
public static final PIDController Y_CONTROLLER = new PIDController(0.01, 0.0, 0.0);
|
||||
public static final ProfiledPIDController THETA_CONTROLLER = new ProfiledPIDController(
|
||||
1.0, 0.0, 0.0, new TrapezoidProfile.Constraints(2 * Math.PI, Math.PI));
|
||||
1.0, 0.0, 0.0, new TrapezoidProfile.Constraints(Math.PI, Math.PI));
|
||||
|
||||
// swerve configuration
|
||||
public static final double NEUTRAL_DEADBAND = 0.04;
|
||||
|
||||
@@ -181,7 +181,8 @@ public class RobotContainer {
|
||||
// ppSwerveControllerCommand,
|
||||
// new InstantCommand(() -> m_robotSwerveDrive.stopModules())
|
||||
// );
|
||||
return runAuto("Move Forward", 5.0, 5.0);
|
||||
// return runAuto("Move Forward", 5.0, 5.0);
|
||||
return runAuto("Five Ball", 1.0, 1.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,9 +49,9 @@ public class SwerveModule extends SubsystemBase {
|
||||
angleMotor.configAllSettings(angleTalonFXConfiguration);
|
||||
|
||||
TalonFXConfiguration driveTalonFXConfiguration = new TalonFXConfiguration();
|
||||
driveTalonFXConfiguration.slot0.kP = 1.0;
|
||||
driveTalonFXConfiguration.slot0.kP = 0.15;
|
||||
driveTalonFXConfiguration.slot0.kI = 0.0;
|
||||
driveTalonFXConfiguration.slot0.kD = 0.0;
|
||||
driveTalonFXConfiguration.slot0.kD = 0.5;
|
||||
driveMotor.configAllSettings(driveTalonFXConfiguration);
|
||||
|
||||
CANCoderConfiguration canCoderConfiguration = new CANCoderConfiguration();
|
||||
@@ -89,8 +89,9 @@ public class SwerveModule extends SubsystemBase {
|
||||
}
|
||||
|
||||
|
||||
// double feetPerSecond = Units.metersToFeet(state.speedMetersPerSecond);
|
||||
driveMotor.set(TalonFXControlMode.Velocity, /*angleMotor.get() + */(Units.metersToInches(state.speedMetersPerSecond) * SwerveDriveConstants.TICKS_PER_INCH) / 10);
|
||||
double feetPerSecond = Units.metersToFeet(state.speedMetersPerSecond);
|
||||
// driveMotor.set(TalonFXControlMode.Velocity, /*angleMotor.get() + */(Units.metersToInches(state.speedMetersPerSecond) * SwerveDriveConstants.TICKS_PER_INCH) / 10);
|
||||
driveMotor.set(feetPerSecond / SwerveDriveConstants.MAX_SPEED_FEET_PER_SEC);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user