What Is A Companion Computer On Drones?

What is a companion computer? 

While they are a very important element of a drone build, they are by no means required. 

Why is this? 

Companion computers only give you the capability of designing higher level drone applications. They don’t actually directly control any of the onboard drone hardware. 

The board that is responsible for fusing all the sensors, balancing the drone 400 times a second, providing return-to-home functionality, accepting RC commands etc is on the flight control board. 

So what does the companion computer do then?

Most Popular Drone Companion Computer

Let’s think of a familiar example to make the concept more digestible. 

Think of your desktop computer. It is running an operating system like Windows, Apple or Linux. This is the firmware that fuses all the physical computer hardware together, and provides an easy to use user interface with a mouse and keyboard to interact with the hardware. 

On this desktop computer, you have things like calculators, calendars, internet browsers etc. These are called apps. The developers used the OS sandbox and wrote in new functionality to the computer through their programs.

Well, the same concept applies for drones. What if you wanted to add some higher functionality into your drone that isn’t supplied out of the box, like gesture control, computer vision, python control, 4G drone telemetry, taco delivery etc? 

Autonomous Drone Delivery | Taco Copters and Precision Landing

That is where the companion computer steps in. This is the device that we can use to introduce new functionalities onto our drone. 

Flight Controller Vs Companion Computer

The most common example would be a pixhawk flight controller with a raspberry pi companion computer. 

All the drone hardware wries into the flight controller like normal, but then you simply wire together your pi with the pixhawk. 

The communication bridge can be done in many ways, but most commonly is performed through a UART bridge. 

UART Bridge On Companion Computer To Flight Controller

Once the UART bridge is created, the companion computer can send over high level flight commands to the flight controller to be controlled in new/unique ways. 

For example, let’s say you wanted to land a drone on an aruco marker through computer vision and a camera. 

The breakdown looks like this. 

  1. Plug a camera into the raspberry pi
  2. Write a script on the pi to look for the aruco marker with openCV
  3. Determine how far away the camera is from the marker
  4. Send a flight command from the Pi to the Pixhawk to adjust over the marker

In step 4, you’re essentially treating the Pixhawk as an API. Through 1 line of code on the companion computer, you may be commanding the drone to fly a bit north. 

The flight controller then accepts this input and taps into the 100’s of lines of code that is required to physically move the drone’s hardware to satisfy the command. 

But from the companion computer, all you needed was one line of code. The flight controller has no idea that there is some other board running computer vision that is generating flight commands. It just accepts the flight commands and is agnostic to the source.

That is the power of writing apps on the companion computer. To learn more about drone programming in this fashion, check out this guide

Types of Companion Computers

Just like flight controllers come in many different forms, so do companion computers

Here are some just to name a few:

  • Raspberry Pi 4B
  • Raspberry Pi Zero
  • Orange Pi
  • Odroid
  • Jetson Nano

Basically, choose your preferred single board computer of choice, wire it into the flight controller with a UART bridge, and you’re good to start developing your functionality. 

Final Thoughts

Companion computers can provide your drone with unique functionality that a flight controller alone can’t provide. In my opinion, the future of drone engineering will be done on the companion computer and not the flight controller.

If you want to see an example of a pixhawk raspberry pi drone, check out this post.

Leave a Reply