Uncategorized

Raspberry Pi Dependency And Setup Instructions For Pixhawk Communication

We currently only have instructions for Buster version of raspbian, even though there are later versions. To use this guide you will need Buster. This guide will show you how to take a fresh install of raspbian (Buster) and enable to work with the dronekit-python API to control the pixhawk vehicle from a python script (and without an RC controller).

The guide consists of dependency installs and raspberry pi config modifications.

This guide is applicable to any Pixhawk + Raspberry Pi setup, including those used on ArduRovers or ArduCopters, or even ArduPlanes.

If you need a pre-selected Rover kit or Drone kit to remove the guesswork from the part selecting process, check out the links for more information!

Dependencies

These dependency installs are only confirmed to work on a freshly installed version of Buster.

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install python-pip python-dev python-opencv python-numpy
  • sudo pip install future
  • sudo apt-get install git screen python-wxgtk4.0 python-lxml
  • sudo pip install pyserial dronekit MAVProxy imutils
  • git clone https://github.com/dronedojo/video2calibration

Setup Instructions

Need to disable serial console to enable uart bridge between pixhawk and raspberry pi. 

sudo raspi-config

Go to “Interface Options” then “Serial Port”

Would you like a login shell to be accessible over serial? 

select NO

Would you like the serial port hardware to be enabled? 

select YES

Exit raspi-config by selecting FINISH and REBOOT

sudo reboot

THEN:

Go to /boot/config with “sudo nano /boot/config.txt”

Go to [all] section

Enter:

enable_uart=1

dtoverlay=disable-bt

Then SAVE and REBOOT.

NOW you should be good to go to use the dronekit API to control the pixhawk over the UART bridge from the Raspberry Pi. 

Leave a Reply