Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. 37.783333, -122.416667 # San Francisco
  2. 32.715, -117.1625 # San Diego
  3.  
  4. import geopy
  5.  
  6. POS1 = (37.783333, -122.416667) # origin
  7. POS2 = (32.715, -117.1625) # dest
  8.  
  9. def get_current_position(d):
  10. # use geopy to calculate bearing between POS1 and POS2
  11. # then use VincentyDistance to get next coord
  12.  
  13. return gps_coord_at_distance_d
  14.  
  15. # If current position is within .5 km of destination, consider it 'arrived'
  16. def has_arrived(curr_pos):
  17. return True/False
  18.  
  19. d = 50 # 50 km
  20. print get_current_position(d)
  21. print has_arrived(get_current_position(d))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement