Skip to content

ArduPilot integration

Since ReachView version 0.3.0 Reach supports RTK-enhanced coordinates output to Navio2, Edge, and Pixhawk autopilots. To make this possible, we implemented a custom GPS protocol ERB (Emlid Reach Binary protocol).

Here is a demo video with our results:

ERB Protocol specification

Protocol description is available here.

Requirements

ERB support is included to ArduPilot starting with the following versions:

  • ArduCopter 3.4
  • ArduPlane 3.5.0
  • APMrover 3.1

The setup we recommend goes as follows:

  • Navio2, Edge, or Pixhawk with the ArduPilot firmware. It's preferable to use the last stable version
  • Base stations is a Reach RS/RS+ unit in Wi-Fi AP mode, configured as a TCP server
  • GCS is a laptop with Mission Planner (version 1.3.35 and higher), connected to the base Reach Wi-Fi hosted network
  • Telemetry connection via a serial radio
  • Rover Reach M2 unit is mounted on a drone and connected to Navio2, Edge, or Pixhawk via the 6P-to-6P wire. This connection type will solve three problems at once: power Reach M2, allow ArduPilot board to pass base corrections and allow Reach M2 to pass RTK solution back.

The following guide will show how to configure Navio2, Edge, or Pixhawk and Reach M2 to work in this setup. If you wish alter to this workflow, it should be fairly easy to do so, as every part of the system is independent of others.

Connecting Reach M2 to Pixhawk

To provide RTK solution to Pixhawk, Reach M2 needs to be connected via a serial port. You can do that by plugging the serial cable into Reach's JST-GH port and Pixhawk's Serial 4/5 connector.

It's recommended to supply Reach M2 from an external power source. Pixhawk may not provide enough power for Reach M2 in some cases.

Connecting Reach M2 to Navio2 over UART

Connect Reach's JST-GH port with Navio's UART port.

Connecting Reach M2 to Navio2 over USB

Connect Reach's Micro-USB port with RPi's USB port.

Connecting Reach M2 to Edge

Connect Reach's JST-GH port with Edge's SER1-I2C port. Edge and Reach M2 integration guide may be found in Edge docs: Reach integration.

Configuring Reach M2 to work with ArduPilot

Rover setup

The serial connection is used to accept base corrections and send solution at the same time.

Start with configuration base correction input:

  • Select Correction input tab
  • Select Serial
  • Choose UART or USB-to-PC as the device
  • Choose the desired baud rate (38400 for default)
  • Choose RTCM3 as base corrections format
  • Hit Apply button to save settings

Now configure position output:

  • Select Position output tab
  • Select Serial
  • Choose UART or USB-to-PC as the device
  • Choose the desired baud rate (38400 for default)
  • Choose NMEA as position output format
  • Hit Apply button button to save settings

Reach supports a number of ways to accept base corrections, including the popular in UAV area serial radios. However, having a separate radio link for base corrections only is highly ineffective.

To solve this, you can use the telemetry radio as a carrier for RTK corrections. GCS can pass these corrections to the autopilot with a feature called GPS inject. This funcionality is available in Mission planner only.

Configuring radio for embedding corrections into telemetry

With default settings radio telemetry is not optimised for sending RTK corrections. This may cause correction data delivery delays and even loss. These slips will deteriorate RTK solution quality, so we need to minimize them.

Radio configuration is done with telemetry disconnected.

To change radio settings, make sure Mavlink connection is disabled. Then, go to Initial setup menu, and select Sik Radio in the side menu. Click Load settings and wait for the parameters of both radios to load.

You need to clear the field ECC and choose Raw Data in the Mavlink select field.

After this, click Save settings. If your radio's firmware is outdated, update with Update Firmware (Local).

Configuring ArduPilot to accept Reach M2 solution

Attention

It is recommended to use Reach as a second GPS unit only.

To launch ArduPilot on Navio2, add to your starting command one of the following arguments:

  • For UART connection
-E /dev/ttyAMA0
  • For USB connection
-E /dev/ttyACM0

This will enable to use Reach M2 as external GPS.

ArduPilot configuration will require setting some parameters via Mission Planner. After connecting, go to CONFIG/TUNING menu, then click Full parameters list on the left. To find the desired parameter more quickly, use a search box on the right (highlighted in red).

Start with settings GPS_TYPE2 parameter to "5" - NMEA. This will enable the second GPS input.

Next, set SERIAL4_BAUD parameter to the same baud rate as chosen in ReachView solution output. Note the options corresponding to the different baud rates.

Then set SERIAL4_PROTOCOL parameter to "20" - NMEA Output. This will enable Serial4 port to be used as NMEA output.

Set GPS_AUTO_SWITCH to "1" - Enabled. Autopilot will automatically switch between the two GPS receivers picking the one with better solution.

Finally, set GPS_INJECT_TO parameter to "1". "1" here stands for the second GPS input. If you configured Reach M2 as the first input, set this parameter to "0".

Bad GPS Signal Health

If the GCS reports Bad GPS Signal Health error, make sure GNSS update rate on Reach M2 is 5Hz or higher.

Configuring Mission Planner to inject RTK corrections into telemetry

To enable and configure GPS inject options in Mission planner press ctrl+F button combination. This will open a window with advanced GCS settings. Click Inject GPS button on the right.

In the new window, choose parameters for base connection. Reach in base mode supports TCP and serial modes. For the sake of this example, let's assume base corrections are coming from another Reach in base TCP server mode. This is a setup we usually use in our test flights.

Base setup

Reach M2 requires multi-band corrections to calculate the solution. To provide it with these correction messages, you can use Reach RS2 base.

Let's configure our Reach base device:

  • Open Base mode tab on Reach
  • Choose TCP in Correction output options
  • Set Server in Role field
  • Set 9000 as Port
  • Hit Apply button button to save settings

To connect, choose TCP client mode in Mission Planner.

Enter Base Reach's IP address.

And port the server port number.

Finally, check the corrections are coming in.