Skip to content

Commit

Permalink
DOCS-1499: Document dual-gps-rtk model of movement sensor (viamrobo…
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre committed Apr 25, 2024
1 parent a77abdf commit 755f64d
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/components/movement-sensor/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Model | Description <a name="model-table"></a>
[`gps-nmea`](./gps/gps-nmea/) | [NMEA-based](https://en.wikipedia.org/wiki/NMEA_0183) GPS models
[`gps-nmea-rtk-pmtk`](./gps/gps-nmea-rtk-pmtk/) | [NTRIP-based](https://en.wikipedia.org/wiki/Networked_Transport_of_RTCM_via_Internet_Protocol) [RTK](https://en.wikipedia.org/wiki/Real-time_kinematic_positioning) GPS models using I<sup>2</sup>C (**experimental**)
[`gps-nmea-rtk-serial`](./gps/gps-nmea-rtk-serial/) | [NTRIP-based](https://en.wikipedia.org/wiki/Networked_Transport_of_RTCM_via_Internet_Protocol) [RTK](https://en.wikipedia.org/wiki/Real-time_kinematic_positioning) GPS models using serial communication (**experimental**)
[`dual-gps-rtk`](./gps/dual-gps-rtk/) | A movement sensor that calculates compass heading from two GPS movement sensors
[`imu-wit`](./imu/imu-wit/) | IMUs manufactured by [WitMotion](https://www.wit-motion.com/)
[`accel-adxl345`](./adxl345/) | The [Analog Devices ADXL345](https://www.analog.com/en/products/adxl345.html) digital accelerometer
[`gyro-mpu6050`](./mpu6050/) | A gyroscope/accelerometer manufactured by TDK InvenSense
Expand Down
114 changes: 114 additions & 0 deletions docs/components/movement-sensor/gps/dual-gps-rtk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: "Configure a Dual GPS Movement Sensor"
linkTitle: "dual-gps-rtk"
weight: 10
type: "docs"
description: "Configure a movement sensor that calculates compass heading from two gps movement sensors."
images: ["/icons/components/imu.svg"]
# SMEs: Rand
---

The `dual-gps-rtk` model of movement sensor calculates 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()`](/components/movement-sensor/#getcompassheading), this model provides data for [`GetPosition()`](/components/movement-sensor/#getposition) and [`GetAccuracy()`](/components/movement-sensor/#getaccuracy).

{{< tabs >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your machine's page in [the Viam app](https://app.viam.com).
Click on the **Components** subtab and click **Create component**.
Select the `movement-sensor` type, then select the `dual-gps-rtk` model.
Enter a name for your movement sensor and click **Create**.

![Creation of a `dual-gps-rtk` movement sensor in the Viam app config builder.](/components/movement-sensor/dual-gps-rtk-builder.png)

Copy and paste the following attribute template into your movement sensor's **Attributes** box.
Then remove and fill in the attributes as applicable to your movement sensor, according to the table below.

{{< tabs >}}
{{% tab name="Attributes template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"first_gps": "<name-of-your-first-gps-movement-sensor>",
"second_gps": "<name-of-your-second-gps-movement-sensor>",
"offset_degrees": <int>
}
```

{{% /tab %}}
{{% tab name="Attributes example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"first_gps": "nmea-1",
"second_gps": "nmea-2",
"offset_degrees": 90
}
```

{{% /tab %}}
{{< /tabs >}}

{{% /tab %}}
{{% tab name="JSON Template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"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": []
}
]
}
```

{{% /tab %}}
{{% tab name="JSON Example" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"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": []
}
]
}
```

{{% /tab %}}
{{< /tabs >}}

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

<!-- prettier-ignore -->
| Name | Type | Inclusion | Description |
| ---- | ---- | --------- | ----------- |
| `first_gps` | int | **Required** | The name you have configured for the first movement sensor you want to combine the measurements from. Must be a GPS model. |
| `second_gps` | string | **Required** | The name you have configured for the second movement sensor you want to combine the measurements from. Must be a GPS model. |
| `offset_degrees` | int | Optional | The 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. {{< imgproc src="/components/movement-sensor/offset_degrees.png" alt="Rand's diagram of 3 offset degree calculations." resize="600x" >}} <br> Default: `90` |

## Test the movement sensor

After you configure your movement sensor, navigate to the [Control tab](/fleet/machines/#control) 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.

{{<imgproc src="/components/movement-sensor/movement-sensor-control-tab-dual.png" resize="800x" declaredimensions=true alt="The dual GPS movement sensor component in the control tab">}}

0 comments on commit 755f64d

Please sign in to comment.