Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement framework for scripted autonomous #24

Open
jkleiber opened this issue Jan 15, 2023 · 3 comments
Open

Implement framework for scripted autonomous #24

jkleiber opened this issue Jan 15, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request long-term stuff that we don't necessarily have to do right now

Comments

@jkleiber
Copy link
Contributor

Summary
This year, we would like to have our autonomous commands come in via an external file rather than being hardcoded into the software. This will improve how fast we can tune autonomous routines and keeps the door open for auto-generating autonomous trajectories eventually.

Work

  • Define a format for our autonomous file to read (probably use TOML, but see if that works and how each action should be formatted)
  • Create a framework that reads in some file (default for now, as a parameter) and parses it for autonomous actions
  • Given the parsed actions, execute them as scheduled during autonomous
  • Add unit tests for the parser as appropriate (deferred: loading the file in unit tests until CI can handle external files)

Verification

  • Commands can be scheduled in autonomous via an external file
  • Robot works in autonomous testing using simple commands for now
  • CI passes
@jkleiber jkleiber added the enhancement New feature or request label Jan 15, 2023
@jkleiber jkleiber added this to the Base Actions milestone Jan 15, 2023
@danielbrownmsm
Copy link
Collaborator

TOML supports arrays. I'm thinking maybe an example autonomous would look like:

[master]
autons = [drive_forward_auto, score_cone_auto]

[drive_forward_auto]
commands = [
    ["AutoSwerveCommand", 0, 0, 180],
    ["AutoSwerveCommand", 10, -5, 0]
]

[score_cone_auto]
commands = [
    ["AutoSwerveCommand", 10, 0, 0],
    ["SetArmCommand", 90],
    ["SetArmExtendCommand", 15.2],
    ["SetClawCommand", "open"],
    ["AutoSwerveCommand", 0, 0, 180]
]

@danielbrownmsm
Copy link
Collaborator

but this could also definitely be a pain in the butt to implement

@jkleiber
Copy link
Contributor Author

jkleiber commented Feb 7, 2023

That looks like a good place to start

@danielbrownmsm danielbrownmsm added the long-term stuff that we don't necessarily have to do right now label Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term stuff that we don't necessarily have to do right now
Projects
None yet
Development

No branches or pull requests

2 participants