Help regarding Hierarchical planning #578
-
I am designing HTN planning problem for a domestic robot scenario and this here is a mockup of the same. Code
and when I run it, I get the following error:
My initial assumption is that it is not finding the source in
but I cannot understand how it has to be passed. There is a similar use in the example from the docs, but I cannot understand how the orig is passed there as well. example from documentation
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The problem in the model is in the two lines:
There you use the value of non-static fluents (at, on). This is ambiguous as it is unclear at which time the fluent should be evaluated and this would impact the value passed to the subtasks. Here is a corrected model (with other minor fixes). Note that m = Method("move-object-actual", objects=Objects, robot=Robot, source=Location, destination=Location, ltmp=Location, ltmp2=Location)
m.set_task(move_object, m.objects, m.robot, m.destination)
m.add_precondition(Equals(at(m.robot), m.source))
t1 = m.add_subtask(move, m.robot, m.source, m.ltmp)
t2 = m.add_subtask(pick, m.objects, m.robot, m.ltmp)
t3 = m.add_subtask(move, m.robot, m.ltmp, m.destination)
t4 = m.add_subtask(place, m.objects, m.robot, m.destination)
m.set_ordered(t1, t2, t3, t4) |
Beta Was this translation helpful? Give feedback.
The problem in the model is in the two lines:
There you use the value of non-static fluents (at, on). This is ambiguous as it is unclear at which time the fluent should be evaluated and this would impact the value passed to the subtasks.
Instead you should use a parameter (that is, invariant in time), whose value may be restricted in preconditions.
Here is a corrected model (with other minor fixes). Note that
ltmp
is only implicitly constrained by its usage but you may as well impose its value in preconditions.