diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index d51921b..d9a4c6c 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -4,6 +4,9 @@ package frc.robot; +import static edu.wpi.first.units.Units.MetersPerSecond; +import static edu.wpi.first.units.Units.RadiansPerSecond; + import org.littletonrobotics.junction.LoggedRobot; import org.littletonrobotics.junction.Logger; @@ -23,6 +26,7 @@ import frc.robot.drivetrain.CommandSwerveDrivetrain; import frc.robot.drivetrain.TunerConstants; import frc.robot.operator.OperatorXbox; +import frc.robot.RobotContainer.*; import static edu.wpi.first.units.Units.*; @@ -119,6 +123,8 @@ public void autonomousInit() { } + + /** * This function is called periodically during autonomous. */ @@ -148,14 +154,7 @@ private Command runDrivetrain() { @Override public void autonomousPeriodic() { - // CommandSwerveDrivetrain.getInstance().applyRequest(() -> - // drive.withVelocityX(5.0 * kMaxVelocity) - // .withVelocityY(0.0) - // .withRotationalRate(0.0) - // ); - - // runDrivetrain(); - + } @Override diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index e82a0ab..1c4011d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -17,6 +17,7 @@ import frc.robot.subsystems.CoralSubsystem; import frc.robot.subsystems.ElevatorSubsystem; + /** * This class is where the bulk of the robot should be declared. Since Command-based is a * "declarative" paradigm, very little robot logic should actually be handled in the {@link Robot} @@ -24,13 +25,13 @@ * subsystems, commands, and trigger mappings) should be declared here. */ public class RobotContainer { - private final double kMaxVelocity = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); - private final double kMaxAngularVelocity = RotationsPerSecond.of(0.75).in(RadiansPerSecond); + public static double kMaxVelocity = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); + public static double kMaxAngularVelocity = RotationsPerSecond.of(0.75).in(RadiansPerSecond); public static boolean modeFast = true; /* Setting up bindings for necessary control of the swerve drive platform */ - private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric() + public static SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric() .withDeadband(kMaxVelocity * 0.1) .withRotationalDeadband(kMaxAngularVelocity * 0.1) // Add a 10% deadband .withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors @@ -41,14 +42,7 @@ public RobotContainer() { setDefaultCommands(); } - // /** - // * Use this to pass the autonomous command to the main {@link Robot} class. - // * - // * @return the command to run in autonomous - // */ - // public Command getAutonomousCommand() { - // return mAutonChooser.getSelected(); - // } + public void setDefaultCommands() { final var driver = DriverXbox.getInstance();