forked from felix-kolbe/executive_rgoap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract test_runner() and tasker() from goap.runner into separate mod…
…ules
- Loading branch information
Felix Kolbe
committed
Jan 9, 2014
1 parent
c94130e
commit 322aecf
Showing
2 changed files
with
48 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
''' | ||
Created on Oct 6, 2013 | ||
@author: felix | ||
''' | ||
import roslib; roslib.load_manifest('goap') | ||
import rospy | ||
|
||
from smach import Sequence | ||
|
||
from uashh_smach.util import SleepState, execute_smach_container | ||
from uashh_smach.platform.move_base import WaitForGoalState | ||
from uashh_smach.tasks.tasker import MoveBaseGOAPState | ||
|
||
from goap.runner import Runner | ||
|
||
|
||
def test_runner(): | ||
rospy.init_node('runner_test') | ||
|
||
runner = Runner() | ||
|
||
sq = Sequence(outcomes=['succeeded', 'aborted', 'preempted'], | ||
connector_outcome='succeeded') | ||
|
||
wfg = WaitForGoalState() # We don't want multiple subscribers so we need one WaitForGoal state | ||
|
||
with sq: | ||
|
||
Sequence.add('SLEEP', SleepState(5)) | ||
|
||
Sequence.add('WAIT_FOR_GOAL', wfg, | ||
transitions={'aborted':'SLEEP'}) | ||
|
||
Sequence.add('MOVE_BASE_GOAP', MoveBaseGOAPState(runner), | ||
transitions={'succeeded':'SLEEP'}) | ||
|
||
execute_smach_container(sq, enable_introspection=True) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
|
||
test_runner() |