Configure NTRIP-Based RTK GPS with I2C Connection
Stability Notice
The gps-nmea-rtk-pmtk
model is an experimental feature.
Stability is not guaranteed.
Breaking changes are likely to occur, and occur often.
A global positioning system (GPS) receives signals from satellites in the earth’s orbit to determine where it is and how fast it is going.
All supported GPS models provide data for the Position
, CompassHeading
, LinearVelocity
, and GetAccuracy
methods.
You can obtain fix and correction data by using the sensor GetReadings
method, which is available because GPSes wrap the sensor component.
The gps-nmea-rtk-pmtk
and gps-nmea-rtk-serial
movement sensor models support NTRIP-based real time kinematic positioning (RTK) GPS units (such as these) and RTCM versions up to 3.3.
The chip requires a correction source to get to the required positional accuracy.
The gps-nmea-rtk-pmtk
model uses an over-the-internet correction source like an RTK reference station and sends the data over I2C to the board.
Follow the guide to Set up a SparkFun RTK Reference Station to configure a SparkFun station for use with this RTK-enabled GPS movement sensor model.
Tip
If your movement sensor uses serial communication instead of I2C, use the gps-nmea-rtk-serial
model.
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 gps-nmea-rtk-pmtk
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-sensor-name>",
"model": "gps-nmea-rtk-pmtk",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"i2c_addr": <int>,
"i2c_baud_rate": <int>,
"i2c_bus": "<index-of-bus-on-board>",
"ntrip_connect_attempts": <int>,
"ntrip_mountpoint": "<identifier>",
"ntrip_password": "<password for NTRIP server>",
"ntrip_url": "<URL of NTRIP server>",
"ntrip_username": "<username for NTRIP server>"
},
"depends_on": [],
}
]
}
{
"components": [
{
"name": "my_GPS",
"model": "gps-nmea-rtk-pmtk",
"type": "movement_sensor",
"namespace": "rdk",
"attributes": {
"i2c_addr": 66,
"i2c_baud_rate": 115200,
"i2c_bus": "1",
"ntrip_connect_attempts": 12,
"ntrip_mountpoint": "MNTPT",
"ntrip_password": "pass",
"ntrip_url": "http://ntrip/url",
"ntrip_username": "usr"
},
"depends_on": []
}
]
}
The following attributes are available for a gps-nmea-rtk-pmtk
movement sensor:
Name | Type | Required? | Description |
---|---|---|---|
i2c_addr | int | Required | The device’s I2C address. |
i2c_bus | string | Required | The index of the I2C bus of the board wired to the sensor. |
i2c_baud_rate | int | Optional | The rate at which data is sent from the sensor. Optional. Default: 38400 |
ntrip_url | string | Required | The URL of the NTRIP server from which you get correction data. Connects to a base station (maintained by a third party) for RTK corrections. |
ntrip_username | string | Optional | Username for the NTRIP server. |
ntrip_password | string | Optional | Password for the NTRIP server. |
ntrip_connect_attempts | int | Optional | How many times to attempt connection before timing out. Default: 10 |
ntrip_mountpoint | string | Optional | If you know of an RTK mountpoint near you, write its identifier here. It will be appended to NTRIP address string (for example, “nysnet.gov/rtcm/NJMTPT1”) and that mountpoint’s data will be used for corrections. |
Tip
How you connect your device to an NTRIP server varies by geographic region. You will need to research the options available to you. If you are not sure where to start, check out this GPS-RTK2 Hookup Guide from SparkFun.
Test the movement sensor
After you configure your movement sensor, open the movement sensor’s TEST panel on the CONFIGURE or CONTROL tabs. This panel presents the data collected by the movement sensor. The sections in the panel include the position, linear velocity and compass heading.
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!