Merge branch 'brasTelescoV3' into 'main'

Bras telesco v3

See merge request pls5618/2023/robot!3
This commit is contained in:
Olivier Demers 2023-03-21 23:21:50 +00:00
commit 026c26734a
2 changed files with 7 additions and 7 deletions

View File

@ -115,12 +115,12 @@ public class RobotContainer {
manette1.leftBumper().whileTrue(aprilTag); manette1.leftBumper().whileTrue(aprilTag);
manette1.rightBumper().whileTrue(tape); manette1.rightBumper().whileTrue(tape);
manette1.povUp().whileTrue(creerCommandBras(51, -37)); manette1.povUp().whileTrue(creerCommandBras(51, -37));
manette1.povDown().whileTrue(creerCommandBras(9, -12)); manette1.povDown().whileTrue(creerCommandBras(12, -9));
manette1.povRight().whileTrue(creerCommandBras(45, -13)); manette1.povRight().whileTrue(creerCommandBras(45, -13));
manette1.povLeft().whileTrue(creerCommandBras(0, 0)); manette1.povLeft().whileTrue(creerCommandBras(0, 0));
manette1.y().whileTrue(activerLimeLight); manette1.y().whileTrue(activerLimeLight);
//manette 2 //manette 2
manette2.povDown().whileTrue(creerCommandBras(9, -18)); manette2.povDown().whileTrue(creerCommandBras(5, -12));
manette2.povUp().whileTrue(creerCommandBras(44, 0)); manette2.povUp().whileTrue(creerCommandBras(44, 0));
manette2.rightBumper().whileTrue(cube); manette2.rightBumper().whileTrue(cube);
manette2.leftBumper().whileTrue(cone); manette2.leftBumper().whileTrue(cone);
@ -128,7 +128,6 @@ public class RobotContainer {
manette2.start().onTrue(new InstantCommand(basePilotable::resetGyro)); manette2.start().onTrue(new InstantCommand(basePilotable::resetGyro));
manette2.a().whileTrue(gratteMonte); manette2.a().whileTrue(gratteMonte);
manette2.b().whileTrue(gratteBaisser); manette2.b().whileTrue(gratteBaisser);
} }
private Command creerCommandBras(double distancePivot, double distanceBras) { private Command creerCommandBras(double distancePivot, double distanceBras) {
@ -142,12 +141,13 @@ public class RobotContainer {
chooser.getSelected(); chooser.getSelected();
autobalance.getBoolean(true); autobalance.getBoolean(true);
return Commands.deadline( return Commands.deadline(
Commands.waitSeconds(14),
Commands.waitSeconds(14), Commands.waitSeconds(14),
new SequentialCommandGroup( new SequentialCommandGroup(
Commands.select(Map.ofEntries( Commands.select(Map.ofEntries(
Map.entry(enhaut, creerCommandBras(51, -40)), Map.entry(enhaut, creerCommandBras(51, -40)),
Map.entry(aumilieux, creerCommandBras(9, -14)), Map.entry(aumilieux, creerCommandBras(45, -13)),
Map.entry(enbas, creerCommandBras(44, -17)), Map.entry(enbas, creerCommandBras(12, -9)),
Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected), Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected),
new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)), new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
Commands.waitSeconds(1), Commands.waitSeconds(1),

View File

@ -25,11 +25,11 @@ public class Gyro extends CommandBase {
public void execute() { public void execute() {
if(basePilotable.getpitch()>6) if(basePilotable.getpitch()>6)
{ {
basePilotable.drive(0.3*basePilotable.getpitch()/12, 0); basePilotable.drive(0.4*basePilotable.getpitch()/12, 0);
} }
else if(basePilotable.getpitch()<-6) else if(basePilotable.getpitch()<-6)
{ {
basePilotable.drive(0.3*basePilotable.getpitch()/12, 0); basePilotable.drive(0.4*basePilotable.getpitch()/12, 0);
} }
else else
{ {