Skip to content

Conversation

@HenryLeC
Copy link

@HenryLeC HenryLeC commented Dec 6, 2024

Conditional command groups are interesting additions to Autos that will allow for conditionally changing pathing if a game piece was not picked up for example.
Wait until commands will allow for running a path until some condition is met. This could be used for running a specific path along a line of gamepieces while trying to pick them up until a gamepiece is detected in the robot.

NamedConditions are very similar to NamedCommands in the GUI and libraries

Example auto mode using wait until and conditional group
image

@github-actions github-actions bot added GUI Changes to the PathPlanner GUI PathPlannerLib Changes to PathPlannerLib labels Dec 6, 2024
@HenryLeC
Copy link
Author

HenryLeC commented Dec 7, 2024

Fixes #609

@mjansen4857
Copy link
Owner

mjansen4857 commented Dec 26, 2024

Sorry for just leaving this open for a while, but this is something I've decided a while ago that I would not add to PathPlanner/PPLib.

The command group building stuff is really designed for just doing simple/basic stuff, making it easier for teams with little to no auto experience to put together a simple auto. Conditional stuff is more complex functionality that would pretty much only be used by teams capable of creating auto command groups in code anyways. Plus, having that capability in the GUI doesn't really make it any easier to use conditionals, in some cases making it more difficult, as you have to add a named conditional, build the conditional command in the gui, then you have to keep track of the separate implementations of the conditional/group in the code/gui, and it becomes super difficult to debug.

Basically, I think its just a whole lot easier/safer to build conditional commands/autos in code. I wouldn't ever recommend someone to use something like this over just manually building it in code, so adding it to the library and having to maintain it going forward just doesn't make sense.

For #721 I have ideas/plans on how to handle it sort of like a behavior tree, using a blackboard that the user can control in code instead of using a "NamedConditionals" setup. But, this can't be extended to work within command groups without some significant library restructuring and hacking to get it to work. So, conditional stuff will probably just live in a level above the auto command groups. However, I think this will mostly accomplish what this PR is trying to achieve anyways, since the tree would be able to satisfy the use case for the "conditional group", and conditional waits and stuff like that can always just be bound to a named command.

Anyways, anything significant in respect to any sort of conditional features would not be added for 2025 anyways, as its just too significant a change to make this close to kickoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GUI Changes to the PathPlanner GUI PathPlannerLib Changes to PathPlannerLib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants