Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@knmcguire
Created October 15, 2019 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knmcguire/7b9a4d4853a9c22524b9446534301b4d to your computer and use it in GitHub Desktop.
Save knmcguire/7b9a4d4853a9c22524b9446534301b4d to your computer and use it in GitHub Desktop.
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