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.
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:
Name | Type | Required? | 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.
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.
Next steps
For more configuration and development info, see:
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.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!