Installing MAVSDK
Running your python script
Read more- Build MAVSDK from source
- Follow the instructions here
- Do not forget to do a system-wide-install
- After you build the MAVSDK go ahead and build the mavsdk_server.
- The binary can be found in
MAVSDK/build/default/src/backend/src/mavsdk_server
- Install using the following command
$ pip3 install mavsdk
- At the time of writing this story the MAVSDK-Python for NavQ does not come with the mavsdk_server binary, hence the previous step.
- Now you need to copy the mavsdk_server binary created in the previous section
$ sudo cp MAVSDK/build/default/src/backend/src/mavsdk_server /usr/local/lib/python3.8/dist-packages/mavsdk/bin/
- Now we need to give the mavsdk_server binary execute permission
- Go to the location and update the permission
$ cd /usr/local/lib/python3.8/dist-packages/mavsdk/bin/
$ sudo chmod +x mavsdk_server
Setup in QGroundControl- Connect the FMUK66 with your computer running QGroundControl using USB or Telemetry radio.
- Connect the UART connector coming out of the NavQ to the TELEM2 port of FMUK66
- Click on the gear icon to open the Vehicle Setup page
- Now click on the Parameters tab
- Go to MAVLink tab under Parameters
- See that the TELEM1 is assigned to MAV_0_CONFIG but MAV_1_CONFIG and MAV_2_CONFIG are disabled.
- Enable the MAV_1_CONFIG by clicking on it and choosing TELEM2 on the dropdown.
- Your vehicle needs to reboot for this change to take effect.
- Now go ahead and reboot the FMUK66 either from SW or by pressing the reboot button on the FMUK66
- Note that TELEM2 is assigned to MAV_1_CONFIG
- Now go to the Serial tab under Parameters and check the serial port settings for TELEM2
- The baud rate should be set to 921600 by default. If not change it.
- Now go ahead and run the MAVSDK-Python examples
- Do not forget to use the serial port as the connection medium by assigning it to the system_address param in the connect() function.
>>> await drone.connect(system_address="serial:///dev/ttymxc2:921600")
- You should get the following response
Waiting for mavsdk_server to be ready...
Connected to mavsdk_server!
- Go ahead and have fun using MAVSDK to build your autonomous drone.
3 projects • 1 follower
Embedded Software Developer with over 5 years of experience. Love tinkering with open source electronics.
Comments