This is a project to fly crazyflie drone(s) autonomously, using Optitrack Motive motion capture system. The code is meant to be run on Ubuntu 16.04. However, using NatNetClient_Old.py and corrections to "COM" port names in the Main.py should lead to the correct version for Windows-based usage. The project is currently under development and probably has not been cleaned or a few bugs may still exist. The control algorithm is based on Keyvan Mohammadi's paper.
- Crazyflie Python Library
- SciPy library
- Plotly Python Library
- Setup Ethernet connection using LAN cable between Ubuntu and Windows (which has Motive). See this video.
-
To run Main.py on Ubuntu, use the current NatNetClient.py and pay specific attention to the NatNet Version. For example, with our device we had to use version 2.9.0.0.
optitrackThread = NatNetClient(ver=(2, 9, 0, 0), quiet=True)
-
In our setup, an Emergency-Stop button was used which was defined in
EStop_failsafe = EStop('/dev/ttyUSB0', 115200)
. In windows, it will be defined asEStop_failsafe = EStop('COM5', 115200)
-
In our setup, for experimental purposes the first rigid-body (or the one with three marker) is assumed to be the payload, at least for now. Please see the definition of
receiveRigidBodyFrame
function. -
The callback function is different for Windows-based code. Use the following in your Main.py:
def receiveNewFrame( frameNumber, markerSetCount, unlabeledMarkersCount, rigidBodyCount, skeletonCount,
labeledMarkerCount, latency, timecode, timecodeSub, timestamp, isRecording, trackedModelsChanged ):
pass
- Number of gains in
kPos
in PB_Control.py,xOffsets
andyOffsets
in Trajectory_Planner,numCopters
in Main for single-drone or in Main_multi_test must be modified accordingly.