xm_tree.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:xm_strategy 作者: xm-project 项目源码 文件源码
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")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号