mettre des choses dans le Dashboard

This commit is contained in:
Olivier Dubois 2023-12-02 11:33:28 -05:00
parent f53490a1cd
commit e665ff63b7
3 changed files with 36 additions and 2 deletions

View File

@ -4,13 +4,25 @@
package frc.robot.commands; package frc.robot.commands;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.CommandBase; import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.Drive; import frc.robot.subsystems.Drive;
public class Avancer extends CommandBase { public class Avancer extends CommandBase {
private Drive drive; private Drive drive;
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout avancer = Shuffleboard.getTab("Dashboard")
.getLayout("Avancer", BuiltInLayouts.kList)
.withSize(3, 3);
/** Creates a new Avancer. */ /** Creates a new Avancer. */
public Avancer(Drive drive) { public Avancer(Drive drive) {
avancer.add("x", 1);
avancer.add("y", 2);
avancer.add("z", 3);
this.drive = drive; this.drive = drive;
addRequirements(drive); addRequirements(drive);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.

View File

@ -4,13 +4,24 @@
package frc.robot.commands; package frc.robot.commands;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.CommandBase; import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.subsystems.Drive; import frc.robot.subsystems.Drive;
public class Reculer extends CommandBase { public class Reculer extends CommandBase {
private Drive drive; private Drive drive;
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
ShuffleboardLayout reculer = Shuffleboard.getTab("Dashboard")
.getLayout("Reculer", BuiltInLayouts.kList)
.withSize(3, 3);
/** Creates a new Reculer. */ /** Creates a new Reculer. */
public Reculer(Drive drive) { public Reculer(Drive drive) {
reculer.add("x", 1);
reculer.add("y", 2);
reculer.add("z", 3);
this.drive = drive; this.drive = drive;
addRequirements(drive); addRequirements(drive);
// Use addRequirements() here to declare subsystem dependencies. // Use addRequirements() here to declare subsystem dependencies.

View File

@ -7,12 +7,23 @@ package frc.robot.subsystems;
import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants; import frc.robot.Constants;
public class Lanceur extends SubsystemBase { public class Lanceur extends SubsystemBase {
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
public Lanceur(){} ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard")
.getLayout("Pid", BuiltInLayouts.kList)
.withSize(3, 7);
public Lanceur(){
pid.add("p", 1);
pid.add("i", 2);
pid.add("d", 3);
}
final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless);
public void lancer(double vitesse){ public void lancer(double vitesse){