def goto(dNorth, dEast, gotoFunction=vehicle.simple_goto):
 currentLocation = vehicle.location.global_relative_frame
 targetLocation = get_location_metres(currentLocation, dNorth, dEast)
 targetDistance = get_distance_metres(currentLocation, targetLocation)
 gotoFunction(targetLocation)
 while (vehicle.mode.name == 'GUIDED'):
  remainingDistance = get_distance_metres(vehicle.location.global_relative_frame, targetLocation)
  print 'Distance to target: ', remainingDistance
  if (remainingDistance <= (targetDistance * 0.01)):
   print 'Reached target'
   break
  time.sleep(2)

def goto ( dNorth , dEast , gotoFunction = vehicle . simple_goto ) : currentLocation = vehicle . location . global_relative_frame targetLocation = get_location_metres ( currentLocation , dNorth , dEast ) targetDistance = get_distance_metres ( currentLocation , targetLocation ) gotoFunction ( targetLocation ) while ( vehicle . mode . name == 'GUIDED' ) : remainingDistance = get_distance_metres ( vehicle . location . global_relative_frame , targetLocation ) print 'Distance to target: ' , remainingDistance if ( remainingDistance <= ( targetDistance * 0.01 ) ) : print 'Reached target' break time . sleep ( 2 )
moves the vehicle to a position dnorth metres north and deast metres east of the current position .