idifjkeakjfo h

This commit is contained in:
samuel desharnais 2023-05-03 19:30:01 -04:00
parent 59a7c30154
commit a73b9c7374
3 changed files with 21 additions and 18 deletions

View File

@ -6,7 +6,6 @@ package frc.robot;
import java.util.Map; import java.util.Map;
import edu.wpi.first.cameraserver.CameraServer; import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
@ -50,6 +49,7 @@ import frc.robot.commands.bras.MonterPivotBras;
import frc.robot.commands.bras.OuvrePince; import frc.robot.commands.bras.OuvrePince;
import frc.robot.commands.bras.PivotManuel; import frc.robot.commands.bras.PivotManuel;
import frc.robot.commands.ActiverLimeLight; import frc.robot.commands.ActiverLimeLight;
public class RobotContainer { public class RobotContainer {
CommandXboxController manette1 = new CommandXboxController(0); CommandXboxController manette1 = new CommandXboxController(0);
@ -156,14 +156,17 @@ public class RobotContainer {
Map.entry(aumilieux, creerCommandBras(45, -13)), Map.entry(aumilieux, creerCommandBras(45, -13)),
Map.entry(enbas, creerCommandBras(12, -9)), Map.entry(enbas, creerCommandBras(12, -9)),
Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected), Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected),
//creerCommandBras(50, -40).unless(() -> !chooser.getSelected().equals(enhaut)), // creerCommandBras(50, -40).unless(() ->
//creerCommandBras(51, -40).unless(() -> !chooser.getSelected().equals(enhaut)), // !chooser.getSelected().equals(enhaut)),
// creerCommandBras(51, -40).unless(() ->
// !chooser.getSelected().equals(enhaut)),
new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)), new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
Commands.waitSeconds(1), Commands.waitSeconds(1),
new FermePince(pince).unless(() -> chooser.getSelected().equals(nulpart)), new FermePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
new ParallelCommandGroup(creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)), new ParallelCommandGroup(creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)),
Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true))), Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true))),
new Avancer(basePilotable, () -> avancerdistance.getDouble(0),()->avancerforce.getDouble(0)).unless(() -> !autosortir.getBoolean(true) || !autobalance.getBoolean(false)), new Avancer(basePilotable, () -> avancerdistance.getDouble(0), () -> avancerforce.getDouble(0))
.unless(() -> !autosortir.getBoolean(true) || !autobalance.getBoolean(false)),
Commands.either(gyro, Commands.none(), () -> autobalance.getBoolean(true)))) Commands.either(gyro, Commands.none(), () -> autobalance.getBoolean(true))))
.andThen(brakeOuvre); .andThen(brakeOuvre);

View File

@ -30,11 +30,11 @@ public class Bougerbras extends CommandBase {
@Override @Override
public void execute() { public void execute() {
if(brasTelescopique.distance()>distance+0.5 ) { if(brasTelescopique.distance()>distance+0.5 ) {
brasTelescopique.AvanceRecule(0.35); brasTelescopique.AvanceRecule(-0.35);
} }
else if(brasTelescopique.distance()<distance-0.5) { else if(brasTelescopique.distance()<distance-0.5) {
brasTelescopique.AvanceRecule(-0.35); brasTelescopique.AvanceRecule(0.35);
} }
else { else {
brasTelescopique.AvanceRecule(0); brasTelescopique.AvanceRecule(0);

View File

@ -27,10 +27,10 @@ public class Bougerpivot extends CommandBase {
@Override @Override
public void execute() { public void execute() {
if(pivot.distance()>distance+0.5 ) { if(pivot.distance()>distance+0.5 ) {
pivot.monteDescendre(0.5); pivot.monteDescendre(-0.5);
} }
else if(pivot.distance()<distance-0.5) { else if(pivot.distance()<distance-0.5) {
pivot.monteDescendre(-0.5); pivot.monteDescendre(0.5);
} }
else { else {
pivot.monteDescendre(0); pivot.monteDescendre(0);