Loading crazyflie-lib-python @ b3ef5eb2 Compare b9612f7d to b3ef5eb2 Original line number Diff line number Diff line Subproject commit b9612f7d1905e98d4d22fa2367f144c6cd5c0ad0 Subproject commit b3ef5eb222f83f71a5d0a6e7ab29965783e51523 salt/drone/scripts/bridge.py +1 −2 Original line number Diff line number Diff line #!/usr/bin/env python #!/usr/bin/env python3 import logging import sys Loading Loading @@ -176,4 +176,3 @@ if __name__ == '__main__': except KeyboardInterrupt: print('\n') bridge.stop() salt/drone/scripts/circle_flightscript.py +48 −38 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. #!/usr/bin/env python3 Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import sys import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = '' 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' elif sys.argv[1] == 'serial': URI = 'serial://pi' else: sys.exit('Give a valid argument.') else: sys.exit('Give a commandline argument.') # Only output errors from the logging framework logging.basicConfig(level=logging.ERROR) Loading @@ -21,42 +30,43 @@ if __name__ == '__main__': cflib.crtp.init_drivers(enable_debug_driver=False) with SyncCrazyflie(URI) as scf: # n_points = 16 radius = 0.4 circle_time = 4 with MotionCommander(scf) as mc: mc.up(0.4) time.sleep(1.5) for i in range(2): mc.start_linear_motion(0.0, -0.12179274798194117, 0.6122934917841437) mc.start_linear_motion(0.0, -0.121792748 , 0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.34683640211958267, 0.5190773581143323) mc.start_linear_motion(0.0, -0.3468364021 , 0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.5190773581143324, 0.3468364021195829) mc.start_linear_motion(0.0, -0.5190773581 , 0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.6122934917841437, 0.12179274798194117) mc.start_linear_motion(0.0, -0.6122934918 , 0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.6122934917841437, -0.12179274798194117) mc.start_linear_motion(0.0, -0.6122934918 , -0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.5190773581143324, -0.34683640211958267) mc.start_linear_motion(0.0, -0.5190773581 , -0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.3468364021195829, -0.5190773581143324) mc.start_linear_motion(0.0, -0.3468364021 , -0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.12179274798194117, -0.6122934917841436) mc.start_linear_motion(0.0, -0.121792748 , -0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.12179274798194095, -0.6122934917841437) mc.start_linear_motion(0.0, 0.121792748 , -0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.3468364021195829, -0.5190773581143325) mc.start_linear_motion(0.0, 0.3468364021 , -0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.5190773581143316, -0.34683640211958244) mc.start_linear_motion(0.0, 0.5190773581 , -0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.6122934917841443, -0.12179274798194162) mc.start_linear_motion(0.0, 0.6122934918 , -0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.6122934917841444, 0.1217927479819414) mc.start_linear_motion(0.0, 0.6122934918 , 0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.5190773581143318, 0.34683640211958244) mc.start_linear_motion(0.0, 0.5190773581 , 0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.34683640211958267, 0.5190773581143315) mc.start_linear_motion(0.0, 0.3468364021 , 0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.12179274798194162, 0.6122934917841443) mc.start_linear_motion(0.0, 0.121792748 , 0.6122934918 ) time.sleep( 0.25 ) mc.stop() Loading salt/drone/scripts/flightscript.pydeleted 100755 → 0 +0 −53 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = 'radio://0/80/2M' # 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) with SyncCrazyflie(URI) as scf: # We take off when the commander is created with MotionCommander(scf) as mc: print('Taking off!') time.sleep(1) # There is a set of functions that move a specific distance # We can move in all directions print('Moving forward 0.5m') mc.forward(0.5) # Wait a bit time.sleep(1) print('Moving up 0.2m') mc.up(0.2) # Wait a bit time.sleep(1) print('Doing a 180deg circle') mc.circle_right(0.1, velocity=0.1, angle_degrees=180) print('Moving down 0.2m') mc.down(0.2) # Wait a bit time.sleep(1) print('Moving forward 0.5m') mc.forward(0.5) # We land when the MotionCommander goes out of scope print('Landing!') salt/drone/scripts/uart_simple_flightscript.py→salt/drone/scripts/line_flightscript.py +47 −0 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. #!/usr/bin/env python3 Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import sys import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = '' 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' elif sys.argv[1] == 'serial': URI = 'serial://pi' else: sys.exit('Give a valid argument.') else: sys.exit('Give a commandline argument.') # Only output errors from the logging framework logging.basicConfig(level=logging.ERROR) Loading @@ -21,9 +30,18 @@ if __name__ == '__main__': cflib.crtp.init_drivers(enable_debug_driver=False) with SyncCrazyflie(URI) as scf: # We take off when the commander is created # n_points = 2 radius = 0.25 circle_time = 2 with MotionCommander(scf) as mc: print('Taking off!') time.sleep(0.1) # We land when the MotionCommander goes out of scope print('Landing!') time.sleep(1.5) for i in range(5): mc.start_linear_motion(0.0, -0.5 , 0.0 ) time.sleep( 1.0 ) mc.stop() time.sleep(0.2) mc.start_linear_motion(0.0, 0.5 , -0.0 ) time.sleep( 1.0 ) mc.stop() time.sleep(0.2) time.sleep(1.3) Loading
crazyflie-lib-python @ b3ef5eb2 Compare b9612f7d to b3ef5eb2 Original line number Diff line number Diff line Subproject commit b9612f7d1905e98d4d22fa2367f144c6cd5c0ad0 Subproject commit b3ef5eb222f83f71a5d0a6e7ab29965783e51523
salt/drone/scripts/bridge.py +1 −2 Original line number Diff line number Diff line #!/usr/bin/env python #!/usr/bin/env python3 import logging import sys Loading Loading @@ -176,4 +176,3 @@ if __name__ == '__main__': except KeyboardInterrupt: print('\n') bridge.stop()
salt/drone/scripts/circle_flightscript.py +48 −38 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. #!/usr/bin/env python3 Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import sys import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = '' 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' elif sys.argv[1] == 'serial': URI = 'serial://pi' else: sys.exit('Give a valid argument.') else: sys.exit('Give a commandline argument.') # Only output errors from the logging framework logging.basicConfig(level=logging.ERROR) Loading @@ -21,42 +30,43 @@ if __name__ == '__main__': cflib.crtp.init_drivers(enable_debug_driver=False) with SyncCrazyflie(URI) as scf: # n_points = 16 radius = 0.4 circle_time = 4 with MotionCommander(scf) as mc: mc.up(0.4) time.sleep(1.5) for i in range(2): mc.start_linear_motion(0.0, -0.12179274798194117, 0.6122934917841437) mc.start_linear_motion(0.0, -0.121792748 , 0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.34683640211958267, 0.5190773581143323) mc.start_linear_motion(0.0, -0.3468364021 , 0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.5190773581143324, 0.3468364021195829) mc.start_linear_motion(0.0, -0.5190773581 , 0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.6122934917841437, 0.12179274798194117) mc.start_linear_motion(0.0, -0.6122934918 , 0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.6122934917841437, -0.12179274798194117) mc.start_linear_motion(0.0, -0.6122934918 , -0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.5190773581143324, -0.34683640211958267) mc.start_linear_motion(0.0, -0.5190773581 , -0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.3468364021195829, -0.5190773581143324) mc.start_linear_motion(0.0, -0.3468364021 , -0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, -0.12179274798194117, -0.6122934917841436) mc.start_linear_motion(0.0, -0.121792748 , -0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.12179274798194095, -0.6122934917841437) mc.start_linear_motion(0.0, 0.121792748 , -0.6122934918 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.3468364021195829, -0.5190773581143325) mc.start_linear_motion(0.0, 0.3468364021 , -0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.5190773581143316, -0.34683640211958244) mc.start_linear_motion(0.0, 0.5190773581 , -0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.6122934917841443, -0.12179274798194162) mc.start_linear_motion(0.0, 0.6122934918 , -0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.6122934917841444, 0.1217927479819414) mc.start_linear_motion(0.0, 0.6122934918 , 0.121792748 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.5190773581143318, 0.34683640211958244) mc.start_linear_motion(0.0, 0.5190773581 , 0.3468364021 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.34683640211958267, 0.5190773581143315) mc.start_linear_motion(0.0, 0.3468364021 , 0.5190773581 ) time.sleep( 0.25 ) mc.start_linear_motion(0.0, 0.12179274798194162, 0.6122934917841443) mc.start_linear_motion(0.0, 0.121792748 , 0.6122934918 ) time.sleep( 0.25 ) mc.stop() Loading
salt/drone/scripts/flightscript.pydeleted 100755 → 0 +0 −53 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = 'radio://0/80/2M' # 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) with SyncCrazyflie(URI) as scf: # We take off when the commander is created with MotionCommander(scf) as mc: print('Taking off!') time.sleep(1) # There is a set of functions that move a specific distance # We can move in all directions print('Moving forward 0.5m') mc.forward(0.5) # Wait a bit time.sleep(1) print('Moving up 0.2m') mc.up(0.2) # Wait a bit time.sleep(1) print('Doing a 180deg circle') mc.circle_right(0.1, velocity=0.1, angle_degrees=180) print('Moving down 0.2m') mc.down(0.2) # Wait a bit time.sleep(1) print('Moving forward 0.5m') mc.forward(0.5) # We land when the MotionCommander goes out of scope print('Landing!')
salt/drone/scripts/uart_simple_flightscript.py→salt/drone/scripts/line_flightscript.py +47 −0 Original line number Diff line number Diff line """ This script shows a simple scripted flight path using the MotionCommander class. #!/usr/bin/env python3 Simple example that connects to the crazyflie at `URI` and runs a sequence. Change the URI variable to your Crazyflie configuration. """ import logging import time import sys import cflib.crtp from cflib.crazyflie.syncCrazyflie import SyncCrazyflie from cflib.positioning.motion_commander import MotionCommander URI = '' 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' elif sys.argv[1] == 'serial': URI = 'serial://pi' else: sys.exit('Give a valid argument.') else: sys.exit('Give a commandline argument.') # Only output errors from the logging framework logging.basicConfig(level=logging.ERROR) Loading @@ -21,9 +30,18 @@ if __name__ == '__main__': cflib.crtp.init_drivers(enable_debug_driver=False) with SyncCrazyflie(URI) as scf: # We take off when the commander is created # n_points = 2 radius = 0.25 circle_time = 2 with MotionCommander(scf) as mc: print('Taking off!') time.sleep(0.1) # We land when the MotionCommander goes out of scope print('Landing!') time.sleep(1.5) for i in range(5): mc.start_linear_motion(0.0, -0.5 , 0.0 ) time.sleep( 1.0 ) mc.stop() time.sleep(0.2) mc.start_linear_motion(0.0, 0.5 , -0.0 ) time.sleep( 1.0 ) mc.stop() time.sleep(0.2) time.sleep(1.3)