This commit is contained in:
samuel desharnais 2025-02-27 18:06:32 -05:00
commit 04ba179373
10 changed files with 19 additions and 24 deletions

View File

@ -24,16 +24,8 @@ import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.TunerConstants.TunerConstants;
import frc.robot.commands.Algue1Test;
import frc.robot.commands.Algue2Test;
import frc.robot.commands.AlgueExpire;
import frc.robot.commands.Algue_inspire;
import frc.robot.commands.AprilTag3;
import frc.robot.commands.AprilTag3G;
import frc.robot.commands.CorailAspir;
import frc.robot.commands.CorailTest;
import frc.robot.commands.CoralAlgueInspire;
import frc.robot.commands.CoralExpire;
import frc.robot.commands.Depart;
import frc.robot.commands.ElevateurManuel;
import frc.robot.commands.Forme3;
@ -45,6 +37,11 @@ import frc.robot.commands.PinceManuel2;
import frc.robot.commands.RainBow;
import frc.robot.commands.StationPince;
import frc.robot.commands.reset;
import frc.robot.commands.Pince.AlgueExpire;
import frc.robot.commands.Pince.Algue_inspire;
import frc.robot.commands.Pince.CorailAspir;
import frc.robot.commands.Pince.CoralAlgueInspire;
import frc.robot.commands.Pince.CoralExpire;
import frc.robot.subsystems.Bougie;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Elevateur;
@ -100,20 +97,20 @@ public class RobotContainer {
drivetrain.setDefaultCommand(
// Drivetrain will execute this command periodically
drivetrain.applyRequest(() ->
drive.withVelocityX(MathUtil.applyDeadband(-manette1.getLeftY()*manette1.getLeftY()*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)
.withRotationalRate(MathUtil.applyDeadband(-manette1.getRightX()*manette1.getRightX()*MaxAngularRate, 0.1)) // Drive counterclockwise with negative X (left)
drive.withVelocityX(MathUtil.applyDeadband(Math.pow(-manette1.getLeftX(), 2)*MaxSpeed, 0.1)) // Drive forward with negative Y (forward)
.withVelocityY(MathUtil.applyDeadband(Math.pow(-manette1.getLeftY(), 2)*MaxSpeed, 0.10000)) // Drive left 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
drivetrain.registerTelemetry(logger::telemeterize);
elevateur.setDefaultCommand(new RunCommand(()->{
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY()*manette2.getLeftY(), 0.1));
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY(), 0.1));
}, elevateur));
//Pince manuel
pince.setDefaultCommand(new RunCommand(()->{
pince.pivote(MathUtil.applyDeadband(manette2.getRightY()*manette2.getRightY(), 0.1));
pince.pivote(MathUtil.applyDeadband(manette2.getRightY(), 0.1));
}, pince));

View File

@ -28,9 +28,7 @@ public class ElevateurManuel extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if(elevateur.limit2()==true){
elevateur.vitesse(0);
}
if (elevateur.limit2())
elevateur.vitesse(doubleSupplier.getAsDouble()/3.5);
}

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Bougie;

View File

@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot.commands;
package frc.robot.commands.Pince;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Pince;