def __init__(self):
rospy.init_node('xm_tree', anonymous=False)
# The root node
BEHAVE = Sequence("BEHEAVE")
# Initialize the ParallelAll task
PARALLEL = ParallelAll("Listen_AND_CHECK")
BEHAVE.add_child(PARALLEL)
SPEECH_CMD = MonitorTask("SPEECH", "speech_sub", Int32, self.task_check_cb)
CMD_EXE=Selector("CMD_LIST")
PARALLEL.add_child(SPEECH_CMD)
PARALLEL.add_child(CMD_EXE)
with CMD_EXE:
#CMD_EXE.add_child(Check_Cmd())
CMD_EXE.add_child(ExecuteTask())
pass
print "Behavior Tree\n"
print_tree(BEHAVE)
rospy.loginfo("Starting simulated house cleaning test")
# Run the tree
while not rospy.is_shutdown():
BEHAVE.run()
rospy.sleep(0.1)
BEHAVE.reset()
#rospy.loginfo("running")
评论列表
文章目录