Merge branch 'main' of https://demerso.net/pls5618/2023/betabots
This commit is contained in:
commit
ad2779c462
@ -4,9 +4,11 @@
|
||||
|
||||
package frc.robot;
|
||||
|
||||
import edu.wpi.first.math.estimator.KalmanFilter;
|
||||
import edu.wpi.first.wpilibj.GenericHID;
|
||||
import edu.wpi.first.wpilibj.Joystick;
|
||||
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.RunCommand;
|
||||
import frc.robot.commands.ActiverBlockeur;
|
||||
@ -16,6 +18,9 @@ import frc.robot.commands.DesactiverBlockeur;
|
||||
import frc.robot.subsystems.BasePilotable;
|
||||
import frc.robot.subsystems.Pistonshaker;
|
||||
import frc.robot.subsystems.Poussoir;
|
||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class is where the bulk of the robot should be declared. Since Command-based is a
|
||||
@ -53,7 +58,15 @@ public class RobotContainer {
|
||||
* edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then passing it to a {@link
|
||||
* edu.wpi.first.wpilibj2.command.button.JoystickButton}.
|
||||
*/
|
||||
private void configureButtonBindings() {}
|
||||
private void configureButtonBindings() {
|
||||
JoystickButton buttonA = new JoystickButton(manette, XboxController.Button.kA.value);
|
||||
buttonA.whileHeld(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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to pass the autonomous command to the main {@link Robot} class.
|
||||
|
40
src/main/java/frc/robot/commands/Avancer.java
Normal file
40
src/main/java/frc/robot/commands/Avancer.java
Normal file
@ -0,0 +1,40 @@
|
||||
// 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.BasePilotable;
|
||||
|
||||
public class Avancer extends CommandBase {
|
||||
private BasePilotable basePilotable;
|
||||
/** Creates a new Avancer. */
|
||||
public Avancer(BasePilotable basePilotable) {
|
||||
basePilotable = new BasePilotable();
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(basePilotable);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
basePilotable.drive(0.5, 0.5, 0);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
basePilotable.drive(0, 0, 0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
32
src/main/java/frc/robot/commands/BoutonA.java
Normal file
32
src/main/java/frc/robot/commands/BoutonA.java
Normal file
@ -0,0 +1,32 @@
|
||||
// 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;
|
||||
|
||||
public class BoutonA extends CommandBase {
|
||||
/** Creates a new boutonY. */
|
||||
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;
|
||||
}
|
||||
}
|
41
src/main/java/frc/robot/commands/Reculer.java
Normal file
41
src/main/java/frc/robot/commands/Reculer.java
Normal file
@ -0,0 +1,41 @@
|
||||
// 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.BasePilotable;
|
||||
|
||||
public class Reculer extends CommandBase {
|
||||
private BasePilotable basePilotable;
|
||||
/** Creates a new Reculer. */
|
||||
public Reculer(BasePilotable basePilotable) {
|
||||
basePilotable = new BasePilotable();
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(basePilotable);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
basePilotable.drive(-0.5, -0.5, 0);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
basePilotable.drive(0, 0, 0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
41
src/main/java/frc/robot/commands/TournerDroite.java
Normal file
41
src/main/java/frc/robot/commands/TournerDroite.java
Normal file
@ -0,0 +1,41 @@
|
||||
// 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.BasePilotable;
|
||||
|
||||
public class TournerDroite extends CommandBase {
|
||||
private BasePilotable basePilotable;
|
||||
/** Creates a new Tourner. */
|
||||
public TournerDroite(BasePilotable basePilotable) {
|
||||
basePilotable = new BasePilotable();
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(basePilotable);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
basePilotable.drive(0, 0, 0.5);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
basePilotable.drive(0, 0, 0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
39
src/main/java/frc/robot/commands/TournerGauche.java
Normal file
39
src/main/java/frc/robot/commands/TournerGauche.java
Normal file
@ -0,0 +1,39 @@
|
||||
// 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.BasePilotable;
|
||||
|
||||
public class TournerGauche extends CommandBase {
|
||||
private BasePilotable basePilotable;
|
||||
/** Creates a new TournerGauche. */
|
||||
public TournerGauche(BasePilotable basePilotable) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(basePilotable);
|
||||
}
|
||||
|
||||
// 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() {
|
||||
basePilotable.drive(0, 0, -0.5);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
basePilotable.drive(0, 0, 0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user