test path planner

This commit is contained in:
C4llSiqn
2025-01-15 17:37:18 -07:00
parent 9c409f956b
commit a8bfc1543f
6 changed files with 116 additions and 10 deletions
@@ -225,16 +225,16 @@ public class RobotContainer {
public Command getAutonomousCommand() {
//return autoPlayback;
//return new GotoPositionCommand(m_robotSwerveDrive, m_vision);
//try{
// // Load the path you want to follow using its name in the GUI
// return new PathPlannerAuto("Example Auto");
//} catch (Exception e) {
// DriverStation.reportError("Big oops: " + e.getMessage(), e.getStackTrace());
// return Commands.none();
//}
try{
// Load the path you want to follow using its name in the GUI
return new PathPlannerAuto("New Auto");
} catch (Exception e) {
DriverStation.reportError("Big oops: " + e.getMessage(), e.getStackTrace());
return Commands.none();
}
// zach told me to do the below comment
//return new GotoPositionCommand(m_robotSwerveDrive, m_vision);
return new GotoPositionCommand(m_robotSwerveDrive, m_vision, AutoConstants.targetpos);
// return new GotoPositionCommand(m_robotSwerveDrive, m_vision, AutoConstants.targetpos);
}
@@ -70,7 +70,7 @@ public class SwerveDrive extends Subsystem {
config = null;
}
AutoBuilder.configure(
() -> swerveDriveTrain.samplePoseAt(Utils.getCurrentTimeSeconds()).orElse(null), // Robot pose supplier
() -> swerveDriveTrain.samplePoseAt(Utils.getCurrentTimeSeconds()).orElse(new Pose2d()), // Robot pose supplier
swerveDriveTrain::resetPose, // Method to reset odometry (will be called if your auto has a starting pose)
() -> swerveDriveTrain.getState().Speeds, // ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
(speeds, feedforwards) -> swerveDriveTrain.setControl(new SwerveRequest.ApplyRobotSpeeds()
@@ -222,7 +222,7 @@ public class SwerveDrive extends Subsystem {
}
public void stopModules() {
// swerveDriveTrain.setControl(new SwerveRequest.SwerveDriveBrake());
swerveDriveTrain.setControl(new SwerveRequest.SwerveDriveBrake());
}
@Override