Skip to content

Commit

Permalink
more pathplanner updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xorbotz committed Feb 6, 2024
1 parent 3a12ed9 commit 53cee99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.Robot.ControlMode;
import frc.robot.commands.TeleopSwerve;
import frc.robot.subsystems.*;
import frc.robot.util.*;
Expand Down Expand Up @@ -89,8 +90,14 @@ private void configureButtonBindings() {
new RunCommand(() -> ShooterSubsystem.ampShot(true), ShooterSubsystem));

}
public Command getAutonomousCommand() {
// Load the path you want to follow using its name in the GUI
PathPlannerPath path = PathPlannerPath.fromPathFile("Path 1");

public Command getAutonomousCommand() {
// Create a path following command using AutoBuilder. This will also trigger event markers.
return AutoBuilder.followPathWithEvents(path);}

/*public Command getAutonomousCommand() {
return AutonomousManager.getCommand();
}
}*/
}
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/SwerveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import com.ctre.phoenix6.hardware.Pigeon2;
import com.ctre.phoenix6.configs.Pigeon2Configuration;

import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.util.PathPlannerLogging;


public class SwerveSubsystem extends SubsystemBase {
public Pigeon2 gyro = new Pigeon2(Constants.Swerve.PIGEON2_ID, "rio");
private SwerveDriveOdometry swerveOdometry; // Odometry class helps track where the robot is relative to where it started
Expand Down

0 comments on commit 53cee99

Please sign in to comment.