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

Scripted Autonomous Functionality #18

Open
jkleiber opened this issue Dec 22, 2022 · 2 comments
Open

Scripted Autonomous Functionality #18

jkleiber opened this issue Dec 22, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jkleiber
Copy link
Contributor

Summary
In preparation for the 2023 season, we should up our autonomous game. The biggest improvement we can make is by not using hard-coded autonomous C++ files, but rather load dynamically from a script.

In the past I've seen this done via CSV or JSON, but I'd like to try this in TOML using arrays of tables.

Work to Do

  • Define autonomous folder structure
  • Define autonomous schema based on last year's scheme
  • Implement autonomous chooser based on available TOML files
  • Dynamically load command lists via TOML tables
  • Make unit tests to verify this works

Verification

@jkleiber jkleiber added the enhancement New feature or request label Dec 22, 2022
@jkleiber jkleiber self-assigned this Dec 22, 2022
@danielbrownmsm
Copy link
Collaborator

How do you make the step from "command written in TOML" to "actual autonomous code"? Or would the auto just look like some kind of:

public Auto() {
    ArrayList<Command> commandList = new ArrayList<>();
    for command in commands:
        if command.type == SetShooterCommand:
            commandList.append(new SetShooterCommand(*command.args)
        elif command.type == DriveForwardCommand:
            commandList.append(new DriveForwardCommand(*command.args)
    super(commandList);
}

?

@jkleiber
Copy link
Contributor Author

Yeah, so it would probably be something like what you're describing. The TOML side would pass in command type, parameters, and time. Then we'd need to schedule these commands in AutonomousPeriodic based on time elapsed in auto

@danielbrownmsm danielbrownmsm added this to the Enhanced Functionality milestone Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants