-
Notifications
You must be signed in to change notification settings - Fork 106
Implement BehaviourTrees for forall and imply #347
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
base: rolling
Are you sure you want to change the base?
Conversation
Add Imply to PDDL domain parsing (cherry picked from commit 30e3e26)
|
Hi @eshan-savla Thanks for your work!! My main concern here is that it breaks the modular design of PlanSys2 if we fill everything with parameters to pass instances back and forth. Maybe at some point it is necessary, but, for example, the domain expert, whose function is to describe and verify what has to do with the domain through the queries that are made to it, should not know anything about instances. That is what the problem expert is for. Nor should the bt_builder know anything about instances. Its mission is to build a behavior tree from a plan. Its nodes will be the ones to verify the conditions. As far as I remember, it should be enough to check the corresponding plansys2_msgs::msg::Tree. @Rezenders has been working in similar duties. What do you think is the best approach? |
|
Hello to both of you, Considering those points, another option would be to use placeholders for the forall parameters which are then filled in by the problem expert during evaluation. The only thing I can't seem to figure out is creating the necessary amount of children for forall in the parser without knowing how many instances exist. It definitely would be nice to get a second opinion on solving this 😊 |
|
Hi all, I agree with the position of @fmrico. We shall maintain modularity. Moreover, the temporal planners POPF and TFD as far as I know do not support forall constructs! Thus, it is not clear why adding them. Notice that, adding those construct to POPF is far from being trivial (as far I know). Moreover, we should consider using a new version of POPF that fixes some issues the currently available one has. But we need to merge the fixes since @fmrico applied some modifications to popf to support some checks not supported by the other popf version. Notice also, that the forall has an impact also on the construction of the BT since to properly capture the semantics of the temporal plan, constraints shall be imposed between nodes not only relying on the temporal aspects. My two cents! |
|
Hi @roveri-marco, I don't disagree however, that my implementation of forall definitely doesn't help with the modularity and look forward to hearing suggestions on how to address that issue and also the second point you mentioned about the BTs inability to capture temporal plan semantics. I really appreciate all of you guys weighing on this and offering your inputs. I hope I haven't caused too much extra work for you guys and would love to help correct any issues in my PR. 😄 |
|
Hi @eshan-savla Not sure the popf on the website is the same used in plansys2 (I have examples that work on the website and do not work on the one in plansys2). Moreover, type hierarchies are wrongly handled in both the domain and problem expert although supported by popf and tfd. TFD since based on decision epochs is not complete! |
|
I disagree a bit here. We should allow PlanSys2 to do everything that PDDL allows, and let the user who uses one planner or another limit it based on what their planner supports. We'd have to see how to do it... |
|
@fmrico Ok, but then we need to properly report the user of unsupported features by the planners! Notice that PDDL is a rich language and the support by planners is questionable and also planner dependent! My experience with many planners is that users if they see fancy feature tend to use them, but then they fight with the planners that do not support them. I'm facing this problem every year with my students! |
Changes:
This pull request introduces several changes to the
plansys2_domain_expert,plansys2_problem_expert,plansys2_pddl_parserandplansys2_executorpackages, primarily to enhance the handling of durative actions by introducing new PDDL functionality using forall and imply and corresponding tests.Parser updates:
Imply.cpp.getTreemethods for both forall and imply. Respective changes inForall.cppandImply.cpp.Condition.hand respective derived classes to allow forall to supplement action params with instances from typed lists.Domain expert updates:
getDurativeActionmethod to supply the necessary instances to the forallgetTreemethod.DomainExpertInterface::getDurativeActionand its overrides to optionally accept aplansys2_msgs::msg::Paramvector of instances.DomainExpert::getDurativeActionconverts this vector into a map of format instance-type : instances and supplies this to all three precondition types. Effects are excluded at this point, as POPF support for forall in effects is limited. Extending support for forall in effects is simply a matter of providing these instances to the AtStart and AtEnd effects.Updates to executor nodes:
getDurativeActionmethod of the domain client are supplied with these instances inExecutorNode.cppandBTBuilder.cpp.Updates to problem expert:
evaluatemethod inUtils.cpp.New PDDL functionality and tests:
bt_node_test.cppwithin the executor package with the appropriate pddl domain to test the new functionalities implemented.