This guide outlines the process of setting up a Raspberry Pi onboard companion computer without the need for a mouse or keyboard, using Ubuntu 20.04 Server Image.
Flashing OS on the Board
Install rpi-imager
Run sudo apt install rpi-imager to install the Raspberry Pi Imager.
Insert the microSD card into your computer.
Choose OS and Storage
Open Raspberry Pi Imager and select "Choose OS".
Navigate to the Ubuntu 20.04 Server image.
Select your microSD card under "Choose Storage".
Configure Settings
Click on the settings icon.
Enable "Enable SSH".
Set a username and password (e.g., "pi").
Configure wireless LAN to connect to your Wi-Fi network.
Write OS to microSD
Click "Write" to write the OS to the microSD card.
Boot the Board
Insert the microSD card into the board.
Check the LED status to confirm booting from the card.
# install some dependenciessudoaptinstallpython3-rosinstallpython3-rosinstall-generatorpython3-wstoolbuild-essential# install MAVROSsudoapt-getinstallros-noetic-mavrosros-noetic-mavros-extrascd~/wgethttps://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.shsudochmoda+xinstall_geographiclib_datasets.shsudo./install_geographiclib_datasets.sh# Install catkin toolssudoapt-getinstallpython3-catkin-tools# Updating MAVProxy and pymavlink (new versions released now and then)sudopipinstall--upgradepymavlinkMAVProxy#Setup MAVROS to begin communicationcd~/# Setup MAVROS workspacemkdir-p~/ardupilot_ws/srccd~/ardupilot_wscatkininit# Create launch file for MAVROScdsrcmkdirlaunchcdlaunchroscpmavrosapm.launchapm.launchsudo gedit apm.launch #opens a text editor, follow the next command (you can also do it using any other editor of your choice, for eg. by using 'code .' commmand)
#To proxy to a Ground Control Station like QGC or Mission Planner on ground we just need to modify the first line to <arg name="fcu_url" default="udp://:{ground-port}@{ground-hostname}" />. save you file and launch it with-
cd~/ardupilot_ws/src/launchroslaunchapm.launch
QGC Setup
To configure QGroundControl for communication with MAVROS:
Open QGroundControl
Launch QGroundControl on your ground station device.
Configure UDP Settings
Navigate to 'Application Settings'.
Go to the 'Comm Links' tab.
Click 'Add' in the options menu.
Select 'Type' as 'UDP'.
Enter the{ground-port} in "Port" and {ground-hostname} in "Server Addresses (optional)"
Connect
Click "OK" to save the settings.
Click on the "Connect" tab to establish the connection from side menu
Ensure that your onboard companion computer and ground station are connected to the same LAN setup via a router for proper communication.
Ensure both the board and the ground station are connected to the same LAN setup for the proxy to work.