This commit is contained in:
Michael Mikovsky
2026-01-19 15:21:40 -07:00
parent d30c807b07
commit 7c8593a9f7
6 changed files with 7 additions and 155 deletions
@@ -1,19 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "taxi"
}
}
]
}
},
"resetOdom": true,
"folder": null,
"choreoAuto": false
}
@@ -1,20 +0,0 @@
AUTO file format
HEADER static size 0x5
0x00 BYTE NUM AXES: defualts to 6
0x01 BYTE NUM POV: defualts to 1
0x02 BYTE NUM CONTROLLERS: defualts to 2
0x03 SHORT FRAMES: any value greator or equal than one.
FRAME PER CONTROLLER: defualt size 0x34
0x00 DOUBLE AXES[NUM AXES]
0x30 SHORT BUTTONS
0x32 SHORT POVs[NUM POV]
FRAME: size varrys
FRAME PER CONTROLLER[NUM CONTROLLERS]
INT UNIXTIMESTAMP
FILE:
HEADER
FRAME[FRAMES]
@@ -1,107 +0,0 @@
package frc4388.robot.commands.Autos;
import java.util.ArrayList;
import edu.wpi.first.wpilibj.shuffleboard.ComplexWidget;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc4388.robot.commands.Swerve.neoJoystickPlayback;
import frc4388.robot.subsystems.swerve.SwerveDrive;
import frc4388.utility.controller.VirtualController;
public class neoPlaybackChooser {
private final SendableChooser<String> m_teamChosser = new SendableChooser<String>();
private final SendableChooser<String> m_possitionChosser = new SendableChooser<String>();
private final SendableChooser<String> m_autoNameChosser = new SendableChooser<String>();
private final SwerveDrive m_swerve;
private final VirtualController[] m_controllers;
// private final ArrayList<SendableChooser<Command>> m_choosers = new ArrayList<>();
// private SendableChooser<Command> m_playback = null;
private final ArrayList<ComplexWidget> m_widgets = new ArrayList<>();
// private final HashMap<String, Command> m_commandPool = new HashMap<>();
// private final File m_dir = new File("/home/lvuser/autos/");
// private int m_cmdNum = 0;
// commands
private Command m_noAuto = new InstantCommand();
public neoPlaybackChooser(SwerveDrive swerve, VirtualController[] controllers) {
m_teamChosser.addOption("Red", "red");
m_teamChosser.setDefaultOption("Blue", "blue");
m_teamChosser.addOption("Nuetral", "nuetral");
m_possitionChosser.addOption("AMP", "amp");
m_possitionChosser.setDefaultOption("Center", "center");
m_possitionChosser.addOption("Source", "source");
m_swerve = swerve;
m_controllers = controllers;
SmartDashboard.putData("Team Chooser", m_teamChosser);
SmartDashboard.putData("Position Chooser", m_possitionChosser);
SmartDashboard.putData("Auto Name Chooser", m_autoNameChosser);
}
public neoPlaybackChooser addOption(String name, String option) {
m_autoNameChosser.addOption(name, option);
return this;
}
// public PlaybackChooser buildDisplay() {
// for (int i = 0; i < 10; i++) {
// appendCommand();
// }
// m_playback = m_choosers.get(0);
// nextChooser();
// // ! This does not work, why?
// Shuffleboard.getTab("Auto Chooser")
// .add("Add Sequence", new InstantCommand(() -> nextChooser()))
// .withPosition(4, 0);
// return this;
// }
// This will be bound to a button for the time being
// public void render() {
// // var chooser = new SendableChooser<Command>();
// // // chooser.setDefaultOption("No Auto", m_noAuto);
// // m_choosers.add(chooser);
// ComplexWidget widget = Shuffleboard.getTab("Neo Auto Chooser")
// .add("Command: " + m_choosers.size(), chooser)
// .withSize(4, 1)
// .withPosition(0, m_choosers.size() - 1)
// .withWidget(BuiltInWidgets.kSplitButtonChooser)
// .withWidget(BuiltInWidgets.kComboBoxChooser);
// m_widgets.add(widget);
// }
// public void nextChooser() {
// SendableChooser<Command> chooser = m_choosers.get(m_cmdNum++);
// String[] dirs = m_dir.list();
// if(dirs != null){ // Fix funny error
// for (String auto : dirs) {
// chooser.addOption(auto, new JoystickPlayback(m_swerve, auto));
// }
// }
// for (var cmd_name : m_commandPool.keySet()) {
// chooser.addOption(cmd_name, m_commandPool.get(cmd_name));
// }
// }
public String autoName() {
return m_teamChosser.getSelected() + "_" + m_possitionChosser.getSelected() + "_" + m_autoNameChosser.getSelected() + ".auto";
}
public Command getCommand() {
return new neoJoystickPlayback(m_swerve, autoName(), m_controllers, true, true);
}
}