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

Added filtering for buildAutoSendable() #726

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

ThePhoenixFox
Copy link
Contributor

SendableChooser references a map of all of the auto commands
Filter provides access to auto command (const) and auto's path
Allows multiple SendableChooser
Allows commands to be updated to latest in pathplanner/auto directory (regenerateSendableReferences())
Provided wiki info for filtering

SendableChooser references a map of all of the auto commands
Filter provides access to auto command (const) and auto's path
Allows multiple SendableChooser
Allows commands to be updated to latest in pathplanner/auto directory (regenerateSendableReferences())
Provided wiki info for filtering
@github-actions github-actions bot added PathPlannerLib Changes to PathPlannerLib documentation Pull requests that update the documentation site files labels Sep 22, 2024
Make sure that regenerateSendableReferences() isn't called every time buildAutoChooser() is called
Change map of commands key to path instead of string
Make sure that wiki on directory filter is correct
Hopefully allows to compile on all platforms
@mjansen4857
Copy link
Owner

Out of curiosity, what's the use case for the regenerateSendableReferences method? Add new autos to the chooser if you manually copy them to the rio or something?

@ThePhoenixFox
Copy link
Contributor Author

ThePhoenixFox commented Sep 23, 2024

Initially, it generates the map of all of the auto commands that are in "deploy/pathplanner/autos" which get used when someone generates a sendableChooser. The map gets referenced everytime a buildAutoChooser() is called.

If a team uploads new autos or modifies autos without deploying (like filezilla), they can use regenerateSendableReferences() to update the commands that are in the map to match the most recent in filesystem which the sendableChoosers' references. This also affects all previously generated sendableChooser to match to most recent since to the best of my knowledge, map iterators/references don't get invalidated from a insert_or_assign operation.

The map in question:

static std::map<std::filesystem::path, frc2::CommandPtr> m_autoCommands;

Also got another commit, the directory filter example isn't correct.

@mjansen4857
Copy link
Owner

Could you remove the

push:
    branches: [main]

trigger for the publish-docs.yml actions workflow? I want to stop pushing docs updates unless the features in the docs are actually released. I would do it myself but don't want to make you merge main for such a minor change.

@github-actions github-actions bot added the workflows Changes to the GitHub Actions workflows label Sep 23, 2024
@mjansen4857 mjansen4857 merged commit ebd2657 into mjansen4857:main Sep 23, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests that update the documentation site files PathPlannerLib Changes to PathPlannerLib workflows Changes to the GitHub Actions workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants