Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 37.783333, -122.416667 # San Francisco
- 32.715, -117.1625 # San Diego
- import geopy
- POS1 = (37.783333, -122.416667) # origin
- POS2 = (32.715, -117.1625) # dest
- def get_current_position(d):
- # use geopy to calculate bearing between POS1 and POS2
- # then use VincentyDistance to get next coord
- return gps_coord_at_distance_d
- # If current position is within .5 km of destination, consider it 'arrived'
- def has_arrived(curr_pos):
- return True/False
- d = 50 # 50 km
- print get_current_position(d)
- print has_arrived(get_current_position(d))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement