mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 00:37:59 -06:00
autos directory
This commit is contained in:
@@ -37,6 +37,7 @@ import frc4388.robot.Constants.SwerveDriveConstants.PIDConstants;
|
|||||||
import frc4388.robot.commands.AutoBalance;
|
import frc4388.robot.commands.AutoBalance;
|
||||||
import frc4388.robot.commands.JoystickPlayback;
|
import frc4388.robot.commands.JoystickPlayback;
|
||||||
import frc4388.robot.commands.JoystickRecorder;
|
import frc4388.robot.commands.JoystickRecorder;
|
||||||
|
import frc4388.robot.commands.PlaybackChooser;
|
||||||
import frc4388.robot.subsystems.SwerveDrive;
|
import frc4388.robot.subsystems.SwerveDrive;
|
||||||
import frc4388.utility.controller.DeadbandedXboxController;
|
import frc4388.utility.controller.DeadbandedXboxController;
|
||||||
import frc4388.utility.controller.XboxController;
|
import frc4388.utility.controller.XboxController;
|
||||||
@@ -103,8 +104,6 @@ public class RobotContainer {
|
|||||||
|
|
||||||
chooser.addOption("Taxi", taxi);
|
chooser.addOption("Taxi", taxi);
|
||||||
|
|
||||||
SmartDashboard.putData(chooser);
|
|
||||||
|
|
||||||
PlaybackChooser playbackChooser = new PlaybackChooser(m_robotSwerveDrive,
|
PlaybackChooser playbackChooser = new PlaybackChooser(m_robotSwerveDrive,
|
||||||
"Balance", new AutoBalance(m_robotMap.gyro, m_robotSwerveDrive));
|
"Balance", new AutoBalance(m_robotMap.gyro, m_robotSwerveDrive));
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class JoystickPlayback extends CommandBase {
|
|||||||
playbackTime = 0;
|
playbackTime = 0;
|
||||||
lastIndex = 0;
|
lastIndex = 0;
|
||||||
try {
|
try {
|
||||||
input = new Scanner(new File("/home/lvuser/" + filename));
|
input = new Scanner(new File("/home/lvuser/autos/" + filename));
|
||||||
|
|
||||||
String line = "";
|
String line = "";
|
||||||
while (input.hasNextLine()) {
|
while (input.hasNextLine()) {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class JoystickRecorder extends CommandBase {
|
|||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {
|
||||||
File output = new File("/home/lvuser/" + filename);
|
File output = new File("/home/lvuser/autos/" + filename);
|
||||||
|
|
||||||
try (PrintWriter writer = new PrintWriter(output)) {
|
try (PrintWriter writer = new PrintWriter(output)) {
|
||||||
for (var input : outputs) {
|
for (var input : outputs) {
|
||||||
|
|||||||
+2
-3
@@ -1,4 +1,4 @@
|
|||||||
package frc4388.robot;
|
package frc4388.robot.commands;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -8,7 +8,6 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
|||||||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||||
import frc4388.robot.commands.JoystickPlayback;
|
|
||||||
import frc4388.robot.subsystems.SwerveDrive;
|
import frc4388.robot.subsystems.SwerveDrive;
|
||||||
|
|
||||||
public class PlaybackChooser {
|
public class PlaybackChooser {
|
||||||
@@ -39,7 +38,7 @@ public class PlaybackChooser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_choosers.add(m_playback);
|
m_choosers.add(m_playback);
|
||||||
SmartDashboard.putData(m_playback);
|
SmartDashboard.putData("Command: 0", m_playback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will be bound to a button for the time being
|
// This will be bound to a button for the time being
|
||||||
Reference in New Issue
Block a user