This commit is contained in:
samuel desharnais 2024-11-29 12:10:40 -05:00
commit dde21cddfd
2 changed files with 15 additions and 11 deletions

View File

@ -3,6 +3,10 @@
// the WPILib BSD license file in the root directory of this project. // the WPILib BSD license file in the root directory of this project.
package frc.robot; package frc.robot;
import com.pathplanner.lib.auto.AutoBuilder;
import com.pathplanner.lib.auto.NamedCommands;
import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
@ -14,7 +18,7 @@ import frc.robot.Commands.Desaccumuler;
import frc.robot.Commands.FollowAprilTag; import frc.robot.Commands.FollowAprilTag;
import frc.robot.Commands.Lancer; import frc.robot.Commands.Lancer;
import frc.robot.Subsystems.Accumulateur; import frc.robot.Subsystems.Accumulateur;
import frc.robot.Subsystems.Drive; //import frc.robot.Subsystems.Drive;
import frc.robot.Subsystems.Lanceur; import frc.robot.Subsystems.Lanceur;
import frc.robot.Subsystems.Limelight3G; import frc.robot.Subsystems.Limelight3G;
@ -23,12 +27,12 @@ public class RobotContainer {
Lanceur lanceur= new Lanceur(); Lanceur lanceur= new Lanceur();
Accumulateur accumulateur = new Accumulateur(); Accumulateur accumulateur = new Accumulateur();
Limelight3G limelight3G = new Limelight3G(); Limelight3G limelight3G = new Limelight3G();
Drive drive = new Drive(); //Drive drive = new Drive();
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
CommandXboxController manette = new CommandXboxController(0); CommandXboxController manette = new CommandXboxController(0);
public RobotContainer() { public RobotContainer() {
NamedCommands.registerCommand("lancer", new Lancer(lanceur, accumulateur)); NamedCommands.registerCommand("lancer", new Lancer(lanceur, accumulateur));
autoChooser = AutoBuilder.buildAutoChooser(); autoChooser = AutoBuilder.buildAutoChooser();
dashboard.addCamera("limelight3G", "limelight3G","limelight.local:5800") dashboard.addCamera("limelight3G", "limelight3G","limelight.local:5800")
.withSize(3,4) .withSize(3,4)
.withPosition(5,0); .withPosition(5,0);
@ -36,11 +40,11 @@ public class RobotContainer {
.withSize(3,4) .withSize(3,4)
.withPosition(2,0); .withPosition(2,0);
configureBindings(); configureBindings();
drive.setDefaultCommand(new RunCommand(()->{ //drive.setDefaultCommand(new RunCommand(()->{
drive.drive(-MathUtil.applyDeadband(manette.getRightX(),0.2), MathUtil.applyDeadband(-manette.getRightY(),0.2), MathUtil.applyDeadband(-manette.getRightX(), 0.2)); // drive.drive(-MathUtil.applyDeadband(manette.getRightX(),0.2), MathUtil.applyDeadband(-manette.getRightY(),0.2), MathUtil.applyDeadband(-manette.getRightX(), 0.2));
},drive)); //},drive));
dashboard.add("autochooser",autoChooser) dashboard.add("autochooser",autoChooser)
.withSize(1,1) .withSize(1,1)
.withPosition(8,0); .withPosition(8,0);
} }
@ -52,6 +56,6 @@ public class RobotContainer {
} }
public Command getAutonomousCommand() { public Command getAutonomousCommand() {
return null; return autoChooser.getSelected();
} }
} }

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of // Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project. // the WPILib BSD license file in the root directory of this project.
package frc.robot.Subsystems; /*package frc.robot.Subsystems;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import com.ctre.phoenix6.hardware.Pigeon2; import com.ctre.phoenix6.hardware.Pigeon2;
@ -45,4 +45,4 @@ public class Drive extends SubsystemBase {
public void periodic() { public void periodic() {
// This method will be called once per scheduler run // This method will be called once per scheduler run
} }
} }*/