Team-OKC-Robotics / FRC-2023

The FRC team #2718 Team OKC Robotics code for the 2023 season
Other
2 stars 0 forks source link

Implement framework for scripted autonomous #24

Open jkleiber opened 1 year ago

jkleiber commented 1 year ago

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

Verification

danielbrownmsm commented 1 year ago

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 commented 1 year ago

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

jkleiber commented 1 year ago

That looks like a good place to start