reac_tag_timeout = 15 # seconds reac_prev_state_timeout = 5 # seconds reac = Reacquisition(reac_velocities, reac_max_alt, reac_tag_timeout, reac_prev_state_timeout) # follow = Follow() # Create the timers to transition to Reacquisition mode # takeoff_to_reac_timer = rospy.Timer(rospy.Duration(takeoff_to_reac_timeout), goto_reacquisition) # land_to_reac_timer = rospy.Timer(rospy.Duration(land_to_reac_timeout), goto_reacquisition) # follow_to_reac_timer = rospy.Timer(rospy.Duration(follow_to_reac_timeout), goto_reacquisition) smach = Smach() # TODO: Test all of this # The start of it all # def main(): takeoff.turn_off_timer(takeoff.timer, 'Takeoff') land.turn_off_timer(land.timer, 'Land') reac.turn_off_timer(reac.prev_state_timer, 'Reac prev state') reac.turn_off_timer(reac.land_timer, 'Reac land') while not rospy.is_shutdown(): print state # NOTE: There are some subtleties here. We want to be able to use more than # one mode for certain modes which is why follow mode is on it's own # Check if we're in takeoff mode if (state == 'takeoff'): print "Takeoff Mode" # NOTE: This was copy and pasted from the takeoff node # To get this guy to take off! For some reason just calling this # function once does not work. This value (50) was determined
reac_prev_state_timeout = 5 # seconds reac = Reacquisition(reac_velocities, reac_max_alt, reac_tag_timeout, reac_prev_state_timeout) # follow = Follow() # Create the timers to transition to Reacquisition mode # takeoff_to_reac_timer = rospy.Timer(rospy.Duration(takeoff_to_reac_timeout), goto_reacquisition) # land_to_reac_timer = rospy.Timer(rospy.Duration(land_to_reac_timeout), goto_reacquisition) # follow_to_reac_timer = rospy.Timer(rospy.Duration(follow_to_reac_timeout), goto_reacquisition) smach = Smach() # TODO: Test all of this # The start of it all # def main(): takeoff.turn_off_timer(takeoff.timer, 'Takeoff') land.turn_off_timer(land.timer, 'Land') reac.turn_off_timer(reac.prev_state_timer, 'Reac prev state') reac.turn_off_timer(reac.land_timer, 'Reac land') while not rospy.is_shutdown(): print state # NOTE: There are some subtleties here. We want to be able to use more than # one mode for certain modes which is why follow mode is on it's own # Check if we're in takeoff mode if (state == 'takeoff'): print "Takeoff Mode" # NOTE: This was copy and pasted from the takeoff node # To get this guy to take off! For some reason just calling this # function once does not work. This value (50) was determined