Grattedebug

This commit is contained in:
2023-03-21 23:17:59 +00:00
parent d3e305c11a
commit aa420b56af
10 changed files with 38 additions and 45 deletions

View File

@ -28,7 +28,9 @@ public class ActiverLimeLight extends CommandBase {
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}
public void end(boolean interrupted) {
limelight.joueurhumain1();
}
// Returns true when the command should end.
@Override

View File

@ -20,23 +20,23 @@ public class GratteBaisser extends CommandBase {
// Called when the command is initially scheduled.
@Override
public void initialize() {
gratte.setenHaut(false);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(gratte.basd()){
gratte.baiserd(0);
gratte.bougerd(0);
}
else{
gratte.baiserd(0.5);
gratte.bougerd(0.3);
}
if(gratte.basg()){
gratte.baiserg(0);
gratte.bougerg(0);
}
else{
gratte.baiserg(0.5);
gratte.bougerg(0.3);
}
@ -45,8 +45,8 @@ public class GratteBaisser extends CommandBase {
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
gratte.baiserd(0);
gratte.baiserg(0);
gratte.bougerd(0);
gratte.bougerg(0);
}
// Returns true when the command should end.

View File

@ -20,31 +20,30 @@ public class GratteMonte extends CommandBase {
// Called when the command is initially scheduled.
@Override
public void initialize() {
gratte.setenHaut(true);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(gratte.hautd()){
gratte.Leverd(0);
gratte.bougerd(0);
}
else{
gratte.Leverd(0.5);
gratte.bougerd(-0.3);
}
if(gratte.hautg()) {
gratte.Leverg(0);
gratte.bougerg(0);
}
else{
gratte.Leverg(0.5);
gratte.bougerg(-0.3);
}
}
// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
gratte.Leverd(0);
gratte.Leverg(0);
gratte.bougerd(0);
gratte.bougerg(0);
}
// Returns true when the command should end.

View File

@ -18,8 +18,10 @@ public class DescendrePivotBras extends SequentialCommandGroup {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
new Bougerbras(brasTelescopique, distanceBras),
new Bougerpivot(pivot, distancePivot)
);
}
}

View File

@ -4,7 +4,7 @@
package frc.robot.commands.bras;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.subsystems.bras.BrasTelescopique;
@ -13,15 +13,17 @@ import frc.robot.subsystems.bras.Pivot;
// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class MonterPivotBras extends ParallelCommandGroup {
public class MonterPivotBras extends SequentialCommandGroup {
/** Creates a new Sequancepivotbras. */
public MonterPivotBras(BrasTelescopique brasTelescopique, Pivot pivot, double distanceBras, double distancePivot) {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
new SequentialCommandGroup(Commands.waitUntil(()->pivot.distance()>8),new Bougerbras(brasTelescopique, distanceBras)),
new Bougerpivot(pivot, distancePivot)
new Bougerpivot(pivot, 10).unless(()->pivot.distance()>10),
new ParallelCommandGroup(new Bougerpivot(pivot, distancePivot)),
new ParallelCommandGroup(new Bougerbras(brasTelescopique, distanceBras))
);
}

View File

@ -29,11 +29,11 @@ public class PivoteBrasMilieux extends CommandBase {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(brasTelescopique.distance()>-12.5){
if(brasTelescopique.distance()>-11){
brasTelescopique.AvanceRecule(-0.15);
brasTelescopique.fermer();
}
else if(brasTelescopique.distance()<-13.5) {
else if(brasTelescopique.distance()<-13) {
brasTelescopique.AvanceRecule(0.15);
}
else {