From fc4607f3c6d7203a155182eded4626d37f75de5e Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Wed, 8 Mar 2023 19:14:16 -0500 Subject: [PATCH] rft --- src/main/java/frc/robot/RobotContainer.java | 9 ++++----- src/main/java/frc/robot/commands/Apriltag.java | 2 +- src/main/java/frc/robot/commands/Cone.java | 2 +- src/main/java/frc/robot/commands/Cube.java | 2 +- src/main/java/frc/robot/commands/Gyro.java | 10 +++++----- src/main/java/frc/robot/commands/Reculer.java | 2 +- src/main/java/frc/robot/commands/Tape.java | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 669f3f5..3612eaa 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -7,7 +7,6 @@ import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.RunCommand; -import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; //subsystems @@ -25,7 +24,6 @@ import frc.robot.commands.Cone; import frc.robot.commands.GratteBaisser; import frc.robot.commands.GratteMonte; import frc.robot.commands.Gyro; -import frc.robot.commands.Reculer; import frc.robot.commands.bras.FermePince; import frc.robot.commands.bras.OuvrePince; import frc.robot.commands.bras.PivotBrasRentre; @@ -33,7 +31,6 @@ import frc.robot.commands.bras.PivoteBrasBas; import frc.robot.commands.bras.PivoteBrasHaut; import frc.robot.commands.bras.PivoteBrasMilieux; //subsystems -import frc.robot.subsystems.BasePilotable; import frc.robot.commands.bras.PivotChercheBas; import frc.robot.commands.bras.PivotChercheHaut; import frc.robot.commands.Cube; @@ -74,13 +71,15 @@ public RobotContainer() { configureBindings(); CameraServer.startAutomaticCapture(); basePilotable.setDefaultCommand(new RunCommand(() -> { - basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX()); + basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0); },basePilotable)); } private void configureBindings() { - + basePilotable.setDefaultCommand(new RunCommand(() -> { + basePilotable.drive(-manette1.getLeftY(), -manette1.getLeftX(), 0); + },basePilotable)); // manette 1 manette1.povDown().onTrue(pivoteBrasHaut); manette1.povUp().onTrue(pivoteBrasBas); diff --git a/src/main/java/frc/robot/commands/Apriltag.java b/src/main/java/frc/robot/commands/Apriltag.java index 9ef54b3..3ef6b06 100644 --- a/src/main/java/frc/robot/commands/Apriltag.java +++ b/src/main/java/frc/robot/commands/Apriltag.java @@ -32,7 +32,7 @@ public class Apriltag extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw()); + basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw(), 0); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Cone.java b/src/main/java/frc/robot/commands/Cone.java index d780293..8121b19 100644 --- a/src/main/java/frc/robot/commands/Cone.java +++ b/src/main/java/frc/robot/commands/Cone.java @@ -32,7 +32,7 @@ public class Cone extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw()); + basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw(), 0); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Cube.java b/src/main/java/frc/robot/commands/Cube.java index d54839e..2bd023f 100644 --- a/src/main/java/frc/robot/commands/Cube.java +++ b/src/main/java/frc/robot/commands/Cube.java @@ -32,7 +32,7 @@ public class Cube extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw()); + basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw(), 0); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Gyro.java b/src/main/java/frc/robot/commands/Gyro.java index 9665ecb..ffeca0a 100644 --- a/src/main/java/frc/robot/commands/Gyro.java +++ b/src/main/java/frc/robot/commands/Gyro.java @@ -30,20 +30,20 @@ public class Gyro extends CommandBase { public void execute() { if(basePilotable.getpitch()>4) { - basePilotable.drive(0.3*basePilotable.getpitch()/12, 0); + basePilotable.drive(0.3*basePilotable.getpitch()/12, 0, 0); } else if(basePilotable.getpitch()<-4) { - basePilotable.drive(0.3*basePilotable.getpitch()/12, 0); - basePilotable.drive(0.3*basePilotable.getpitch()/15, 0); + basePilotable.drive(0.3*basePilotable.getpitch()/12, 0, 0); + basePilotable.drive(0.3*basePilotable.getpitch()/15, 0, 0); } else if(basePilotable.getpitch()<-4) { - basePilotable.drive(0.3*basePilotable.getpitch()/15, 0); + basePilotable.drive(0.3*basePilotable.getpitch()/15, 0, 0); } else { - basePilotable.drive(0, 0); + basePilotable.drive(0, 0, 0); } } diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index 7ff9989..674ef40 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -27,7 +27,7 @@ public class Reculer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(SmartDashboard.getNumber("vitesse auto", -0.3), 0); + basePilotable.drive(SmartDashboard.getNumber("vitesse auto", -0.3), 0, 0); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Tape.java b/src/main/java/frc/robot/commands/Tape.java index e1346f0..e240da4 100644 --- a/src/main/java/frc/robot/commands/Tape.java +++ b/src/main/java/frc/robot/commands/Tape.java @@ -32,7 +32,7 @@ public class Tape extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw()); + basePilotable.drive(doubleSupplier.getAsDouble(), limelight.getYaw(), 0); } // Called once the command ends or is interrupted.