Created
October 15, 2019 09:40
-
-
Save knmcguire/7b9a4d4853a9c22524b9446534301b4d to your computer and use it in GitHub Desktop.
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 logging | |
import sys | |
import time | |
import cflib.crtp | |
from cflib.crazyflie import Crazyflie | |
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie | |
URI = 'radio://0/80/2M' | |
if len(sys.argv) > 1: | |
URI = sys.argv[1] | |
# Only output errors from the logging framework | |
logging.basicConfig(level=logging.ERROR) | |
if __name__ == '__main__': | |
# Initialize the low-level drivers (don't list the debug drivers) | |
cflib.crtp.init_drivers(enable_debug_driver=False) | |
print(sys.argv[1]) | |
cf = Crazyflie(rw_cache='./cache') | |
with SyncCrazyflie(URI, cf=cf) as scf: | |
cf.param.set_value('gbug.trigger_avoid','1') | |
time_now=time.time() | |
while(1): | |
if time.time() - time_now > 10: | |
cf.param.set_value('gbug.trigger_avoid','1') | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment