Skip to content

Commit

Permalink
Bugfix for Autonomy State Machine
Browse files Browse the repository at this point in the history
  • Loading branch information
joshreed13 committed May 26, 2017
1 parent 100d791 commit 76485c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions AutonomyTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,11 @@ def do_nothing(packet_contents):

if reached_goal:
state = 'waypoint reached'
#state = 'vision_navigate'
if autonomy_algorithm.distance_to_goal < VISION_RANGE:
elif autonomy_algorithm.distance_to_goal < VISION_RANGE:
logging.info('In vision range, searching')
ball_in_frame, center, radius = tracker.track_ball()
if ball_in_frame:
logging.info('Ball seen, locking on')
logging.info('Ball seen at (%i, %i) with r=%i, locking on' % (center.x, center.y, radius))
state = 'vision_navigate'
else:
state = 'gps_navigate'
Expand Down Expand Up @@ -156,6 +155,7 @@ def do_nothing(packet_contents):
current_goal = waypoints.get_nowait()
autonomy_algorithm.setWaypoint(current_goal)
logging.info('Moving to next waypoint')
motors.enable()
state = 'gps_navigate'
else:
logging.info('All waypoints reached, going into idle')
Expand Down

0 comments on commit 76485c7

Please sign in to comment.