commit
db39b5c3db
@ -8,24 +8,34 @@ import edu.wpi.first.math.estimator.KalmanFilter;
|
|||||||
import edu.wpi.first.wpilibj.GenericHID;
|
import edu.wpi.first.wpilibj.GenericHID;
|
||||||
import edu.wpi.first.wpilibj.Joystick;
|
import edu.wpi.first.wpilibj.Joystick;
|
||||||
import edu.wpi.first.wpilibj.XboxController;
|
import edu.wpi.first.wpilibj.XboxController;
|
||||||
|
import edu.wpi.first.wpilibj.XboxController.Button;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||||
|
// subsystems
|
||||||
import frc.robot.subsystems.BasePilotable;
|
import frc.robot.subsystems.BasePilotable;
|
||||||
import frc.robot.subsystems.Poussoir;
|
import frc.robot.subsystems.Poussoir;
|
||||||
import frc.robot.subsystems.Pistonshaker;
|
import frc.robot.subsystems.Pistonshaker;
|
||||||
|
// commands
|
||||||
import frc.robot.commands.Activer_poussoir;
|
import frc.robot.commands.Activer_poussoir;
|
||||||
import frc.robot.commands.ActiverBlockeur;
|
import frc.robot.commands.ActiverBlockeur;
|
||||||
|
<<<<<<< HEAD
|
||||||
import frc.robot.commands.DesactiverBlockeur;
|
import frc.robot.commands.DesactiverBlockeur;
|
||||||
import frc.robot.commands.Reculer;
|
import frc.robot.commands.Reculer;
|
||||||
import frc.robot.commands.TournerDroite;
|
import frc.robot.commands.TournerDroite;
|
||||||
import frc.robot.commands.TournerGauche;
|
import frc.robot.commands.TournerGauche;
|
||||||
import frc.robot.commands.Activershaker;
|
import frc.robot.commands.Activershaker;
|
||||||
import frc.robot.commands.Avancer;
|
import frc.robot.commands.Avancer;
|
||||||
|
=======
|
||||||
|
import frc.robot.commands.Activershaker;
|
||||||
|
import frc.robot.commands.DesactiverBlockeur;
|
||||||
|
>>>>>>> 3d2fed7d28e2c16a03399281bc03d1cf3df4f6d1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import frc.robot.commands.BoutonA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is where the bulk of the robot should be declared. Since Command-based is a
|
* This class is where the bulk of the robot should be declared. Since Command-based is a
|
||||||
* "declarative" paradigm, very little robot logic should actually be handled in the {@link Robot}
|
* "declarative" paradigm, very little robot logic should actually be handled in the {@link Robot}
|
||||||
@ -38,6 +48,13 @@ public class RobotContainer {
|
|||||||
|
|
||||||
BasePilotable basePilotable = new BasePilotable();
|
BasePilotable basePilotable = new BasePilotable();
|
||||||
|
|
||||||
|
private Pistonshaker pistonshaker = new Pistonshaker();
|
||||||
|
private Poussoir poussoir = new Poussoir();
|
||||||
|
|
||||||
|
private Activer_poussoir Activer_poussoir = new Activer_poussoir(poussoir);
|
||||||
|
private ActiverBlockeur ActiverBlockeur = new ActiverBlockeur(poussoir);
|
||||||
|
private Activershaker Activershaker = new Activershaker(pistonshaker);
|
||||||
|
private DesactiverBlockeur DesactiverBlockeur = new DesactiverBlockeur(poussoir);
|
||||||
/** The container for the robot. Contains subsystems, OI devices, and commands. */
|
/** The container for the robot. Contains subsystems, OI devices, and commands. */
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
// Configure the button bindings
|
// Configure the button bindings
|
||||||
@ -56,10 +73,12 @@ public class RobotContainer {
|
|||||||
* edu.wpi.first.wpilibj2.command.button.JoystickButton}.
|
* edu.wpi.first.wpilibj2.command.button.JoystickButton}.
|
||||||
*/
|
*/
|
||||||
private void configureButtonBindings() {
|
private void configureButtonBindings() {
|
||||||
|
JoystickButton buttonA = new JoystickButton(manette, XboxController.Button.kA.value);
|
||||||
|
buttonA.whileHeld(Activer_poussoir);
|
||||||
|
JoystickButton rightbumper = new JoystickButton(manette, XboxController.Button.kLeftBumper.value);
|
||||||
|
rightbumper.whileHeld(Pistonshaker);
|
||||||
|
JoystickButton buttonY = new JoystickButton(manette, XboxController.Button.kY.value);
|
||||||
|
buttonY.whenPressed(DesactiverBlockeur, ActiverBlockeur);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
src/main/java/frc/robot/commands/BoutonA.java
Normal file
35
src/main/java/frc/robot/commands/BoutonA.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (c) FIRST and other WPILib contributors.
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||||
|
import frc.robot.subsystems.Poussoir;
|
||||||
|
import frc.robot.subsystems.Pistonshaker;
|
||||||
|
|
||||||
|
public class BoutonA extends CommandBase {
|
||||||
|
/** Creates a new boutonA. */
|
||||||
|
public BoutonA() {
|
||||||
|
|
||||||
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the command is initially scheduled.
|
||||||
|
@Override
|
||||||
|
public void initialize() {}
|
||||||
|
|
||||||
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
|
@Override
|
||||||
|
public void execute() {}
|
||||||
|
|
||||||
|
// Called once the command ends or is interrupted.
|
||||||
|
@Override
|
||||||
|
public void end(boolean interrupted) {}
|
||||||
|
|
||||||
|
// Returns true when the command should end.
|
||||||
|
@Override
|
||||||
|
public boolean isFinished() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user