rft
This commit is contained in:
parent
99ce225dc6
commit
fc4607f3c6
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user