Skip to content

Commit

Permalink
Add notes for preemptions and introspection to runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Kolbe committed Jan 9, 2014
1 parent 9f5fb95 commit c94130e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions goap/src/goap/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def update_and_plan_and_execute(self, goal, tries=1, introspection=False):

def execute_as_smach(self, start_node, introspection=False):
sm = self.path_to_smach(start_node)
# TODO: create proxies / userdata info for inner-sm introspection
outcome = execute_smach_container(sm, introspection, name='/SM_GENERATED')
return outcome

Expand Down Expand Up @@ -201,10 +202,13 @@ def __init__(self, runner, **kwargs):

def execute(self, userdata):
# TODO: propagate preemption request into goap submachine
# TODO: maybe make this class a smach.Container and add states dynamically?
goal = self.build_goal(userdata)
# avoid duplicate introspection:
outcome = self.runner.update_and_plan_and_execute(goal, introspection=False)
outcome = self.runner.update_and_plan_and_execute(goal, introspection=True)
print "Generated GOAP sub state machine returns: %s" % outcome
if self.preempt_requested():
rospy.logwarn("Preempt request was ignored as GOAPPlannerState cannot"
" yet forward it to inner generated machine.")
return outcome

def build_goal(self, userdata):
Expand Down

0 comments on commit c94130e

Please sign in to comment.