Commit 20cee6b4 authored by Marlene Böhmer's avatar Marlene Böhmer

Flightscripts: IP command line parameter

parent 8aff8807
......@@ -14,7 +14,8 @@ if len(sys.argv) >= 2:
if sys.argv[1] == 'radio':
URI = 'radio://0/80/2M'
elif sys.argv[1] == 'prrt':
URI = 'prrt://10.8.0.208:5000'
ip = sys.argv[2]
URI = 'prrt://' + ip + ':5000'
elif sys.argv[1] == 'serial':
URI = 'serial://pi'
else:
......
......@@ -14,7 +14,8 @@ if len(sys.argv) >= 2:
if sys.argv[1] == 'radio':
URI = 'radio://0/80/2M'
elif sys.argv[1] == 'prrt':
URI = 'prrt://10.8.0.208:5000'
ip = sys.argv[2]
URI = 'prrt://' + ip + ':5000'
elif sys.argv[1] == 'serial':
URI = 'serial://pi'
else:
......
......@@ -14,7 +14,8 @@ if len(sys.argv) >= 2:
if sys.argv[1] == 'radio':
URI = 'radio://0/80/2M'
elif sys.argv[1] == 'prrt':
URI = 'prrt://10.8.0.208:5000'
ip = sys.argv[2]
URI = 'prrt://' + ip + ':5000'
elif sys.argv[1] == 'serial':
URI = 'serial://pi'
else:
......@@ -30,6 +31,7 @@ if __name__ == '__main__':
cflib.crtp.init_drivers(enable_debug_driver=False)
with SyncCrazyflie(URI) as scf:
time.sleep(1)
with MotionCommander(scf) as mc:
print('Taking off!')
time.sleep(0.5)
......
......@@ -14,7 +14,8 @@ if len(sys.argv) >= 2:
if sys.argv[1] == 'radio':
URI = 'radio://0/80/2M'
elif sys.argv[1] == 'prrt':
URI = 'prrt://10.8.0.208:5000'
ip = sys.argv[2]
URI = 'prrt://' + ip + ':5000'
elif sys.argv[1] == 'serial':
URI = 'serial://pi'
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment