Configure a Dual GPS Movement Sensor

The dual-gps-rtk model of movement sensor calculates a compass heading from two GPS movement sensors, and returns the midpoint position between the first and second GPS devices as its position. In addition to GetCompassHeading(), this model provides data for GetPosition() and GetAccuracy().

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Select the movement-sensor type, then select the dual-gps-rtk model. Enter a name or use the suggested name for your movement sensor and click Create.

Creation of a dual-gps-rtk movement sensor in the Viam app config builder.

Fill in the attributes as applicable to your movement sensor, according to the table below.

{
  "components": [
    {
      "name": "your-dual-gps-rtk",
      "model": "dual-gps-rtk",
      "type": "movement_sensor",
      "namespace": "rdk",
      "attributes": {
        "first_gps": "<name-of-your-first-gps-movement-sensor>",
        "second_gps": "<name-of-your-second-gps-movement-sensor>",
        "offset_degrees": <int>
      },
      "depends_on": []
    }
  ]
}
{
  "components": [
    {
      "name": "your-dual-gps-rtk",
      "model": "dual-gps-rtk",
      "type": "movement_sensor",
      "namespace": "rdk",
      "attributes": {
        "first_gps": "nmea-1",
        "second_gps": "nmea-2",
        "offset_degrees": 90
      },
      "depends_on": []
    }
  ]
}

The following attributes are available for a dual-gps-rtk movement sensor:

NameTypeInclusionDescription
first_gpsintRequiredThe name you have configured for the first movement sensor you want to combine the measurements from. Must be a GPS model.
second_gpsstringRequiredThe name you have configured for the second movement sensor you want to combine the measurements from. Must be a GPS model.
offset_degreesintOptionalThe value to offset the compass heading calculation between the two GPS devices based on their positions on the base. Calculate this as the degrees between the vector from first_gps to second_gps and the vector from the vehicle’s back to the vehicle’s front, counterclockwise. Rand's diagram of 3 offset degree calculations.
Default: 90

Test the movement sensor

After you configure your movement sensor, navigate to the Control tab and select the dedicated movement sensor dropdown panel. This panel presents the data collected by the movement sensor. The sections in the panel include the position, compass heading, and accuracy.

The dual GPS movement sensor component in the control tab


Have questions, or want to meet other people working on robots? Join our Community Discord.

If you notice any issues with the documentation, feel free to file an issue or edit this file.