A companion computer operates as a “companion” to the flight controller on an autonomous vehicle. It performs higher level, more complex tasks that enhance the overall capability of the vehicle.
Typically, the flight controller is a microcontroller (such as the STM32). It takes in raw sensor data, calculates the vehicle’s attitude/position and then commands the servos and motors according to a desired position and attitude. This could be “hover in place”, “go to this location” and so on.
These microcontrollers tend to be very limited in terms of CPU, RAM and stored memory. A typical flight controller might have a 100MHz processor, 512 Kb of RAM and 2 Mb of stored (flash) memory.
A companion computer, on the other hand, will typically have a multi-core 1GHz processor, >1 GB of RAM and 10’s of GB of stored (flash) memory.
The companion computer receives telemetry data from the flight controller. It then uses that data (sometimes in conjunction with other attached sensors) to calculate and send high-level commands to the flight controller. For example, the companion computer might command the flight controller to fly the vehicle to the location of an object detected by an attached camera. This layout is shown in the below diagram.
What can I do with a Companion Computer?
A companion computer has enough computational power and interfaces (such as USB and Ethernet) that can be used for capturing and processing data from devices attached to these interfaces.
There are two major classes of devices. First are payload devices (such as cameras and LIDAR) that collect data. Second are communications devices (such as 4G modems and long range Wi-Fi) for long range monitoring and control.
Some examples of use cases include:
- Long range control over 4G or Wi-Fi
- Image capture and geotagging
- Real time image processing
- SLAM and indoor navigation
Interfacing the Companion Computer with the Flight Controller
On the hardware side, UARTs are used to pass data between the companion computer and flight controller. They are often labelled as Telemetry ports on flight controllers. At a minimum, they consist of two data lines (transmit and receive) and ground. Some may also provide flow control (RTS/CTS lines), but this is typically optional.
Boards such as the Pi-Connect assist with hardware interfacing by including power converters and the correct type of telemetry port.
For flight controllers using ArduPilot, MAVLink is the protocol used for reading telemetry and issuing commands. The commands can include high-level commands such as takeoff and landing. For finer control, roll/pitch/yaw/throttle (RC) commands can be issued.
For integration with ROS, there are specific setups available online.
Examples of Companion Computers
Larger companion computers, such as Intel NUCs, can be used on larger vehicles.
Choosing a suitable companion computer can depend on the following factors:
- Size and weight
- Power consumption
- Interfaces (ports) for the specific payload or sensors wanting to be used
- Computational speed. This is important in SLAM or image processing applications where a powerful CPU and large amounts of RAM are required
- Software support. Some boards (such as the Raspberry Pi) have a large ecosystem of pre-built software applications and support forums