modif
This commit is contained in:
parent
6535047346
commit
b31ac996ea
src/main/java/frc/robot
@ -100,20 +100,20 @@ public class RobotContainer {
|
|||||||
drivetrain.setDefaultCommand(
|
drivetrain.setDefaultCommand(
|
||||||
// Drivetrain will execute this command periodically
|
// Drivetrain will execute this command periodically
|
||||||
drivetrain.applyRequest(() ->
|
drivetrain.applyRequest(() ->
|
||||||
drive.withVelocityX(MathUtil.applyDeadband(-manette1.getLeftY()*manette1.getLeftY()*MaxSpeed, 0.1)) // Drive forward with negative Y (forward)
|
drive.withVelocityX(MathUtil.applyDeadband(Math.pow(-manette1.getLeftX(), 2)*MaxSpeed, 0.1)) // Drive forward with negative Y (forward)
|
||||||
.withVelocityY(MathUtil.applyDeadband(-manette1.getLeftX()*manette1.getLeftX()*MaxSpeed, 0.10000)) // Drive left with negative X (left)
|
.withVelocityY(MathUtil.applyDeadband(Math.pow(-manette1.getLeftY(), 2)*MaxSpeed, 0.10000)) // Drive left with negative X (left)
|
||||||
.withRotationalRate(MathUtil.applyDeadband(-manette1.getRightX()*manette1.getRightX()*MaxAngularRate, 0.1)) // Drive counterclockwise with negative X (left)
|
.withRotationalRate(MathUtil.applyDeadband(Math.pow(-manette1.getRightX(), 2)*manette1.getRightX()*MaxAngularRate, 0.1)) // Drive counterclockwise with negative X (left)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
// Elevateur manuel
|
// Elevateur manuel
|
||||||
drivetrain.registerTelemetry(logger::telemeterize);
|
drivetrain.registerTelemetry(logger::telemeterize);
|
||||||
elevateur.setDefaultCommand(new RunCommand(()->{
|
elevateur.setDefaultCommand(new RunCommand(()->{
|
||||||
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY(), 0.1));
|
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY(), 0.1));
|
||||||
}, elevateur));
|
}, elevateur));
|
||||||
|
|
||||||
//Pince manuel
|
//Pince manuel
|
||||||
pince.setDefaultCommand(new RunCommand(()->{
|
pince.setDefaultCommand(new RunCommand(()->{
|
||||||
pince.pivote(MathUtil.applyDeadband(manette2.getRightY()*manette2.getRightY(), 0.1));
|
pince.pivote(MathUtil.applyDeadband(manette2.getRightY(), 0.1));
|
||||||
}, pince));
|
}, pince));
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,9 +28,7 @@ public class ElevateurManuel extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(elevateur.limit2()==true){
|
if (elevateur.limit2())
|
||||||
elevateur.vitesse(0);
|
|
||||||
}
|
|
||||||
elevateur.vitesse(doubleSupplier.getAsDouble()/3.5);
|
elevateur.vitesse(doubleSupplier.getAsDouble()/3.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user