From 5ed7e59ccb6da75396c04c94e5ccf611533e0d01 Mon Sep 17 00:00:00 2001 From: Michael Mikovsky <77305074+Astatin3@users.noreply.github.com> Date: Fri, 24 Jan 2025 20:41:09 -0700 Subject: [PATCH] Created New Autos --- .../deploy/pathplanner/autos/Mira's Auto.auto | 61 +++++++++++++++++++ .../paths/Center Barge to Reef.path | 20 +++--- src/main/deploy/pathplanner/paths/Taxi.path | 20 +++--- .../java/frc4388/robot/RobotContainer.java | 20 ++++++ 4 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/Mira's Auto.auto diff --git a/src/main/deploy/pathplanner/autos/Mira's Auto.auto b/src/main/deploy/pathplanner/autos/Mira's Auto.auto new file mode 100644 index 0000000..3acc852 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Mira's Auto.auto @@ -0,0 +1,61 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Top Blue Cage to Reef" + } + }, + { + "type": "named", + "data": { + "name": "april-allign" + } + }, + { + "type": "named", + "data": { + "name": "place-coral" + } + }, + { + "type": "path", + "data": { + "pathName": "Top Reef to Feed" + } + }, + { + "type": "named", + "data": { + "name": "grab-coral" + } + }, + { + "type": "path", + "data": { + "pathName": "Top Feed to Reef" + } + }, + { + "type": "named", + "data": { + "name": "april-allign" + } + }, + { + "type": "named", + "data": { + "name": "place-coral" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Center Barge to Reef.path b/src/main/deploy/pathplanner/paths/Center Barge to Reef.path index 4bd51e2..9e36d9d 100644 --- a/src/main/deploy/pathplanner/paths/Center Barge to Reef.path +++ b/src/main/deploy/pathplanner/paths/Center Barge to Reef.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 15.106960227272728, - "y": 2.120426136363636 + "x": 7.565467171717171, + "y": 4.045328282828282 }, "prevControl": null, "nextControl": { - "x": 15.101585096858368, - "y": 2.396686756913594 + "x": 8.114457611671098, + "y": 4.043616195025507 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 15.106960227272728, - "y": 4.005056818181817 + "x": 5.979861111111112, + "y": 4.045328282828282 }, "prevControl": { - "x": 15.10799254912145, - "y": 3.6525397317875603 + "x": 5.5035379766577375, + "y": 4.0462802990619195 }, "nextControl": null, "isLocked": false, @@ -42,13 +42,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": -179.09061955080082 + "rotation": 179.65844947344297 }, "reversed": false, "folder": null, "idealStartingState": { "velocity": 0, - "rotation": 178.99491399474587 + "rotation": 180.0 }, "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Taxi.path b/src/main/deploy/pathplanner/paths/Taxi.path index f5b4725..8ff7750 100644 --- a/src/main/deploy/pathplanner/paths/Taxi.path +++ b/src/main/deploy/pathplanner/paths/Taxi.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 7.576229508196722, - "y": 7.273668032786885 + "x": 7.565467171717171, + "y": 7.348674242424242 }, "prevControl": null, "nextControl": { - "x": 8.050548646741815, - "y": 7.2681295199500715 + "x": 7.8906231049309685, + "y": 7.339915637757156 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 6.137704918032787, - "y": 7.273668032786885 + "x": 6.305113636363636, + "y": 7.348674242424242 }, "prevControl": { - "x": 5.88773585280021, - "y": 7.277600770605731 + "x": 5.928529040722133, + "y": 7.353679406601922 }, "nextControl": null, "isLocked": false, @@ -42,13 +42,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": 0.0 + "rotation": 179.47479945510887 }, "reversed": false, "folder": null, "idealStartingState": { "velocity": 0, - "rotation": 0.0 + "rotation": 177.6140559696112 }, "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index f705983..7735d99 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -30,6 +30,8 @@ import edu.wpi.first.wpilibj2.command.button.Trigger; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.InstantCommand; import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import edu.wpi.first.wpilibj2.command.WaitCommand; import edu.wpi.first.wpilibj2.command.Commands; // Autos @@ -100,6 +102,21 @@ public class RobotContainer { new VirtualController[]{getVirtualDriverController(), getVirtualOperatorController()}, true, false); private Command AutoGotoPosition = new GotoPositionCommand(m_robotSwerveDrive, m_vision); + + private Command placeCoral = new SequentialCommandGroup( + new InstantCommand(() -> System.out.println("Placing Some Coral")), + new WaitCommand(3) + ); + + private Command aprilAlign = new SequentialCommandGroup( + new InstantCommand(() -> System.out.println("Aligning...")), + new WaitCommand(1) + ); + + private Command grabCoral = new SequentialCommandGroup( + new InstantCommand(() -> System.out.println("Yoinking some coral...")), + new WaitCommand(2) + ); /** * The container for the robot. Contains subsystems, OI devices, and commands. @@ -107,6 +124,9 @@ public class RobotContainer { public RobotContainer() { NamedCommands.registerCommand("AutoGotoPosition", AutoGotoPosition); + NamedCommands.registerCommand("april-allign", aprilAlign); + NamedCommands.registerCommand("place-coral", placeCoral); + NamedCommands.registerCommand("grab-coral", grabCoral); configureButtonBindings(); configureVirtualButtonBindings();