Having multiple autos ready to go

hello everyone our team wants to experiment with multiple autos so we can improvise at point according to our alliance’s capabilities (ex: qualification matches where teams are random) anyways i found out that multiple teams use path planner and i am trying to use path planner i have read the wiki but couldn’t figure out how to make it work robot has swerve drive and we want to use event markers with path planner is there any resource you can direct me to or any other method of having multiple autos ready to deploy thank you in advance for your time

This is how we were doing it, but I think I may move the auto chooser back into RobotContainer and follow the more typical code for initializing it, since it may be a reason that it was crashing on second go.
But you may find the pathplanner, eventmap, etc. useful:
https://github.com/frc1108/Robot2023/blob/main/src/main/java/frc/robot/Autos.java

We use this
Sendable Chooser
We simply open the smartdashboard app in the driver station area and strategize with our alliance about which auto to use, and select it from the dropdown.

4 Likes

Our code is at https://github.com/SuperiorRoboworksTeam857/2023ChargedUp/blob/8a380c6b4e6f40d764a707fd03301eaf817b07d2/src/main/java/frc/robot/RobotContainer.java#L209C26-L209C26

On our operator console we have a TI Launchpad with several toggle switches wired to it so we flip whichever combination of switches we need that year to select our auto. At least several years ago some teams were getting burned by dashboard-type solution sometimes not working but this “joystick” method has been very reliable for us.

The autos folder then contains the various auto programs.

The reason it’s crashing on the second run is because in getAutonomousCommand, you’re composing the command from the SendableChooser inside a sequence. A command can only be composed in another command once, so the second time you call getAutonomousCommand, it will throw an exception (and the exception should tell you as much).

If you want to add behavior like that, you’ll have to add it to each Command added to the chooser, or modify the chooser to hold Supplier<Command> so you can construct a new command each time getAutonomousCommand is called.

1 Like

https://www.chiefdelphi.com/t/yet-another-generic-swerve-library-yagsl-beta/425148?u=skeller

1 Like

I even have pathplanner setup in the example code, here is how i generated a path with markers in the example code. I followed a combination of sources but i think this primarily came from PathPlanners docs+their javadoc (which isnt easy to get to) https://github.com/BroncBotz3481/YAGSL-Example/blob/main/src/main/java/frc/robot/commands/swervedrive/auto/Autos.java#L47-L96

A simple thing to add to your Autonomous is a delay, preferably of selectable duration, before your ‘bot moves in Auton. You can avoid collisions with your alliance partners; have the Alliance Captains work it out. One more thing that makes your team desirable in Alliance Selection.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.