From 3b44dbb6a66e45e0f5aeb8781c8fb10c122ec792 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Tue, 6 Feb 2024 19:08:49 -0500 Subject: [PATCH] --- src/main/java/frc/robot/RobotContainer.java | 1 + .../java/frc/robot/command/RobotPixy.java | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/main/java/frc/robot/command/RobotPixy.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9368be5..4ba1d18 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -70,6 +70,7 @@ public class RobotContainer { manette.a().whileTrue(guiderBas); manette.b().whileTrue(guiderHaut); joystick.button(3).toggleOnTrue(balayer); + configureBindings(); drive.setDefaultCommand(new RunCommand(()->{ drive.drive(-MathUtil.applyDeadband(joystick.getY(),0.2), MathUtil.applyDeadband(-joystick.getX(),0.2), MathUtil.applyDeadband(-joystick.getZ(), 0.2)); diff --git a/src/main/java/frc/robot/command/RobotPixy.java b/src/main/java/frc/robot/command/RobotPixy.java new file mode 100644 index 0000000..652c4c3 --- /dev/null +++ b/src/main/java/frc/robot/command/RobotPixy.java @@ -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.command; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystem.Drive; +import frc.robot.subsystem.Pixy; + +public class RobotPixy extends Command { + private Pixy pixy; + private Drive drive; + /** Creates a new RobotPixy. */ + public RobotPixy(Pixy pixy,Drive drive) { + this.drive = drive; + this.pixy = pixy; + addRequirements(drive,pixy); + // 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; + } +}