Fixed pathplanner

This commit is contained in:
Tyler Wilcox 2026-03-22 08:49:29 -04:00
parent e535f8c4b5
commit 4f0f38a893
4 changed files with 19 additions and 9 deletions

@ -1 +1 @@
Subproject commit eea76939a3cbb76aba47874adf15eaf49a8333de
Subproject commit 30421c381aaa883745985b7852f90da5bc42b624

View File

@ -55,8 +55,9 @@ public class Robot extends LoggedRobot {
@Override
public void robotInit() {
String swVersion = getVersion();
Logger.recordMetadata("ProjectName", "MyProject"); // Set a metadata value
Logger.recordMetadata("Software Version", getVersion());
Logger.recordMetadata("Software Version", swVersion);
if (isReal()) {
Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs")
@ -75,7 +76,9 @@ public class Robot extends LoggedRobot {
Logger.start(); // Start logging! No more data receivers, replay sources, or metadata values may
// be added.
Logger.recordOutput("Software Version", getVersion());
// Print out software version
Logger.recordOutput("Software Version", swVersion);
System.out.println("Robot Software Version: " + swVersion);
// Instantiate our RobotContainer. This will perform all our button bindings,
// and put our

View File

@ -43,8 +43,6 @@ public class RobotContainer {
// private final CommandPS4Controller m_driverController = new CommandPS4Controller(OperatorConstants.kDriverControllerPort);
private final SendableChooser<Command> autoChooser;
public final DriveSubsystem driveSubsystem = new DriveSubsystem(m_driverController);
public final IntakeSubsystem intakeSubsystem = new IntakeSubsystem();
@ -56,9 +54,6 @@ public class RobotContainer {
/** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() {
autoChooser = AutoBuilder.buildAutoChooser();
SmartDashboard.putData("Auto Chooser", autoChooser);
// Configure the trigger bindings
configureBindings();
@ -100,6 +95,6 @@ public class RobotContainer {
*/
public Command getAutonomousCommand() {
// An example command will be run in autonomous
return autoChooser.getSelected();
return driveSubsystem.getAutoCommand();
}
}

View File

@ -16,6 +16,9 @@ import com.pathplanner.lib.controllers.PPHolonomicDriveController;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
@ -23,6 +26,8 @@ import frc.robot.Constants;
public class DriveSubsystem extends TestableSubsystem {
private SendableChooser<Command> autoChooser;
private SwerveBuilder swerveBuilder = new SwerveBuilder();
private SwerveDriveSystem driveSystem;
@ -164,6 +169,9 @@ public class DriveSubsystem extends TestableSubsystem {
},
this);
autoChooser = AutoBuilder.buildAutoChooser();
SmartDashboard.putData("Auto Chooser", autoChooser);
} catch (Exception e) {
e.printStackTrace();
}
@ -182,6 +190,10 @@ public class DriveSubsystem extends TestableSubsystem {
driveSystem.simulationPeriodic();
}
public Command getAutoCommand(){
return autoChooser.getSelected();
}
@PostTest()
public void DriveSubsystem_CanDevicesConnected() {