PlanSys2 / ros2_planning_system

This repo contains a PDDL-based planning system for ROS2.
Apache License 2.0
392 stars 87 forks source link

Forall() usage in PDDL domain not supported by BT parser #314

Open claudio-dg opened 3 months ago

claudio-dg commented 3 months ago

Hi, using the "forall()" construct within the preconditions of actions in my PDDL Domain file I discovered that it is well supported for generating a proper plan, but not for running it using BTs. More in details, I manage to 'get a plan', but when i execute the run command from 'plansys2_terminal' i get the following error:

[domain_expert_node-1] terminate called after throwing an instance of 'parser::pddl::UnsupportedConstruct' [domain_expert_node-1] what(): Forall is not currently supported by plansys2

I tried to use a work-around solution to avoid using the forall() construct in my domain: this allowed me to run my plans with BTs, but drastically decreased the performances of my plan generation, forcing me to have simplified problem instances in order to avoid planner's time out.

Is there a reason for this discrepancy in trying to use the forall() construct in generating/running a plan? How can i possibly fix this issue, since the complexity of my PDDL requires using such construct to obtain useful results?

fmrico commented 2 months ago

Hi @claudio-dg

There are no specific reasons for not having forall, as far as I remember, but I have to check how difficult it will be to enable this. I probably did not think about this because of the limitation of POPF for some expressions.

Best

claudio-dg commented 2 months ago

Thanks a lot for your answer @fmrico! If it can be useful, in my personal experience POPF seems to support very well forall() expressions for planning, obtaining much better results with respect to other alternatives/workarounds. Therefore, if it is not excessively complex, it might be actually worth to enable it.

Best

fmrico commented 1 month ago

Hi @claudio-dg

forall and exists (https://github.com/PlanSys2/ros2_planning_system/pull/318#issuecomment-2316148489) would be a nice contribution ;)