Open dgerod opened 6 years ago
I have added (not(localised v1))
and others to the problem file but it still not works.
It seems that the system does not work when a PDDL domain file is using a negate precondition, I have found the following comment in parsePrecondition()
of PlanningEnvironment
:
TODO: test negative precondition support.
Am I right? How to solve it?
(1) Looking through the plan dispatcher code, negative preconditions don't appear to be supported at all. The code you mention does not look at the "neg_goal" VAL type, only "simple_goal".
(2) In the Knowledge Base, a negative precondition will not be detected if the positive fact is not in the KB. However, adding the negative precondition with "is_negative=true" in the KnowlegeItem should work.
To solve the problem in the short term, some code must be added to PlanningEnvironment to iterate through the neg_goal list, and then explicitly adding the negative facts to the KB should work.
I'll leave this issue open and post an update when there is a complete fix.
Thanks.
I have just checked but VAL::neg_goal
has not ng->getProp()
, so I think that I cannot use same code as simple_goal
. Could you explain your idea more detailed?
I am using the FF planner with some PDDL files and it solves the plan, see below the output:
However, when the
SimpleDispatchPlanner
executed the plan after being correctly parsed, it says that preconditions are not meet for 1st FIND_OBJECT action, see below the messages provided byrosplan_planning_system
. I have removed some messages provided byFFPlanParser
after second FIND_OBJECT action because they are not interesting in current situation.The point is that I have some a negative precondition in FIND_OBJECT actions, see below.
I think that
SimpleDispatchPlanner
wants that I set explicitly these one negated when the FF planner does not need them. The problem file that I am passing to the FF planner is:Why
SimplePlanDispatcher
is doing this? Is this behavior correct? In my opinion it should not be as the FF planner is able to solve this situation... or the FF planner behavior is not. And How I can fix this situation?Thanks.