In this blog I describe how I evolved the joystick / gamepad remote control of my RPI-controlled DiddyBorg to QGroundControl and MAVLink as communication protocol.
This has given me the basis to process more sensors in a standard environment in the future and to plan and execute missions for the DiddyBorg.
Software installation on the Raspberry Pi (RPi)
On the RPi, first install pymavlink, the Python version of the MAVLink libraries. The easiest way to do this is with PIP:
pip install pymavlink
Then create a directory, e.g. diddy2QGC, into which you copy the Python modules diddy2QGroundControl.py and ThunderBorg3.py from the Github repository of this project. In this directory you then start the Python script later with:
python diddy2QGroundControl.py
Software installation on the desktop
Install QGroundControl on your desktop.
Starting the applications
Make sure the RPi and your desktop are on the same network and run QGroundControl (QGC) and the Python script (the order is irrelevant).
The DiddyBorg sends heartbeat messages, which are recognized and answered by QGC. After exchanging a few more messages (please do not be confused by the error messages), the connection is established and you will then find the option to teach in your joystick in the vehicle settings. Please note that diddy2QGroundControl.py in mode 2 uses the roll channel for right/left control and the inverted value of the pitch channel for motor control.