Skip to content
On this page

Companion Computers

Hardware

Required materials

  • Raspberry Pi
    • Rpi 4 Model B 8GB RAM
    • Power supply: Raspberry Pi 15W USB-C Power Supply
  • PC with microSD card slot
  • MicroSD card
    • SanDisk 64GB Ultra MicroSDXC

Hardware Image

Software

  • Install the Raspberry Pi Imager here.

  • Install the VNC Viewer here.

Imaging in Headless Mode

  • Insert the microSD card into the PC
  • Open the Raspberry Pi Imager
    • Select the Raspberry Pi OS (64-bit) as the Operating System
    • Select the microSD card as the Storage

Rasberry Pi Imager

  • Click on the gear icon in the bottom right hand corner to access the Advanced options
    • Select Set hostname: raspberrypi.local
    • Select Enable SSH and Use password authentication
    • Select Set username and password
      • Type the username and password of your choice
    • Select Configure wireless LAN
      • Type your wifi network name as the SSID and your wifi network password as the Password
      • Find your country’s two-letter country code
    • Click Save

Advance Options

  • Now, Click Write

OSAVC

  • Connect the OSAVC and PICkit3 Debugger to your PC
  • Load TestHarness.X’s code onto the OSAVC
    • Open the TestHarness.X folder
    • Click Make and Program Device Save

Raspberry Pi 4

  • Insert the microSD card into the Raspberry Pi 4
  • Connect the micro-USB port of the OSAVC to the USB port of the Raspberry Pi 4
  • Power the Raspberry Pi 4 using the USB-C port with the power supply
  • Open an SSH tunnel from your PC to the Raspberry Pi 4 by typing ssh [username]@[hostname].local in your PC terminal
    • sudo raspi-config
    • Select 5 Interfacing Options
    • Select P3 VNC
    • Click Yes to enabling the VNC server
    • Save your changes
  • Open VNC Viewer and connect to [hostname].local at the top

RealVNC Viewer

  • Install opencv and its dependencies
    • sudo apt-get update
    • sudo apt install python3-opencv
  • Install pymavlink
    • sudo pip3 install pymavlink
  • Install a serial terminal on the Raspberry Pi 4
    • sudo apt-get install minicom
    • minicom -b 115200 -o -D /dev/ttyUSB0
    • Press Ctrl-A Z to get the Mincom Command Summary dialog

Mincom

  • Press o to Configure Minicom
  • Select Serial port setup

Serial Port  Setup

  • press F to set F - Hardware Flow Control : No

Hardware Flow Control

  • Save by pressing Enter and exit the Minicom Command Summary
  • Click on the OSAVC’s reset button
  • Press h to transmit a Mavlink heartbeat message from the OSAVC to the Raspberry Pi 4 and then press q to quit

Hardware Flow Control

  • Create a new terminal tab, delete the Minicom terminal tab
  • In the new terminal, enter
sh
git clone https://github.com/uccross/open-source-autonomous-vehicle-controller.git
sh
cd open-source-autonomous-vehicle-controller
sh
cd companion-computer
sh
sudo python3 OSAVC_web_server_rpi.py

Terminal

  • A webpage like this should appear

Web Page

  • Click the Connect Mav button
    • The button should turn red
    • The terminal should output target_system 1, target component 0

Target Component

Target Component

  • Finally, click the Connected button again, and the MAVstatus should become Connected

Connected