Created
June 18, 2015 18:06
-
-
Save djnugent/d65e6adb24344dcdf970 to your computer and use it in GitHub Desktop.
api.stop usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
# First get an instance of the API endpoint | |
api = local_connect() | |
# Get the connected vehicle (currently only one vehicle can be returned). | |
v = api.get_vehicles()[0] | |
#wait here until mavproxy tells us to exit | |
while not api.exit: | |
time.sleep(0.2) | |
#This is our clean up code | |
#close connections and files | |
print 'sleeping for 5 seconds' | |
time.sleep(5) | |
api.stop() #kill the script | |
print "This shouldn't print" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment