class_example.py
Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 # Author: Anas Abou Allaban
00003 
00004 import rospy
00005 from bt_action import BTAction
00006 
00007 
00008 class Start(BTAction):
00009 
00010     def __init__(self):
00011         self.condition = true
00012         # Behavior tree action server
00013         super(Start, self).__init__('Start')
00014 
00015     def execute_cb(self, goal):
00016         while not rospy.is_shutdown():
00017             if self._as.is_preempt_requested():
00018                 rospy.loginfo("{} halted".format(self._action_name))
00019                 self._as.set_preempted()
00020                 self.set_status(False)
00021                 break
00022             if condition:
00023                 self.set_status(True)
00024             else:
00025                 self.set_status(False)


behavior_tree_leaves
Author(s): Michele Colledanchise
autogenerated on Thu Jun 6 2019 18:19:15