class LandState(smach.State): def __init__(self, wait_time=20): smach.State.__init__(self, outcomes=['success', 'fail']) self.commander = HydrusCommander() self.wait_time = wait_time def execute(self, userdata): self.commander.land() rospy.sleep(self.wait_time) return 'success'
class LandingStateWithOpenJoints(smach.State): def __init__(self, wait_time=20): smach.State.__init__(self, outcomes=['success', 'fail']) self.commander = HydrusCommander() def execute(self, userdata): self.commander.open_joints() rospy.sleep(9.0) self.commander.land() rospy.sleep(self.wait_time) return 'success'