Skip to main content

ArduPilot integration

Reach supports RTK-enhanced coordinates output to Navio2, Edge, and Pixhawk autopilots. To make this possible, we implemented a custom GPS protocol named ERB.

Here is a demo video with our results:


ERB Protocol specification#

note

ERB format is deprecated. We recommend using industry-standard NMEA format instead.

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

Recommended setup#


We recommend the setup that goes as follows:

  • Navio2, Edge, or Pixhawk with the ArduPilot firmware. It is preferable to use the last stable version
  • Base station is a Reach RS2 or 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 or Reach M+ 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, allow ArduPilot board to pass base corrections and allow Reach to pass RTK solution back

The following guide will show how to configure Navio2, Edge, or Pixhawk and Reach 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 to Pixhawk#


To provide RTK solution to Pixhawk, Reach 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.

note

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

Connecting Reach to Navio2 over UART#


Connect Reach's JST-GH port with the UART port on Navio2.

Connecting Reach to Navio2 over USB#


Connect Reach's Micro-USB port with a USB port on your Raspberry Pi.

Connecting Reach to Edge#


Connect Reach's JST-GH port with the SER1-I2C port on Edge. Edge and Reach integration guide can be found in Edge docs.

Configuring Reach to work with ArduPilot#

Rover setup#

note

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

Start with configuration base correction input:

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

Now configure position output:

  1. Select Position output tab.
  2. Select Serial.
  3. Choose UART or USB-to-PC as the device.
  4. Choose the desired baud rate (38400 for default).
  5. Choose NMEA as position output format.
  6. Hit Apply button to save settings.

Setting up a correction link#

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.

note

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 solution#

danger

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 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).

note

If you are working with Pixhawk, reboot it each time you set a parameter for a change to take effect. Unplug it and plug in back to the USB port again.


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 5 - GPS.


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. Here, it stands for the second GPS input. If you configured Reach as the first input, set this parameter to 0.


Bad GPS Signal Health

If Mission Planner reports Bad GPS Signal Health error, make sure GNSS update rate on Reach is 5 Hz 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#

Let's configure our Reach base device:

  1. Open Base mode tab in ReachView.
  2. Choose TCP in Correction output options.
  3. Set Server in Role field.
  4. Set 9000 as Port.
  5. Hit Apply 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.