Skip to main content
Version: 1.1.0

RTK Correction

Hardware​

The default correction data is received over a cellular or Wi-Fi connection.

Info

The AutomatePro offers an optional L-band RTK correction data receiver, which receives correction data from L-Band satellites. This allows the RTK GNSS to function without a cellular connection and provides correction redundancy. For more information, contact Lemvos.

ROS API​

Nodes: automatepro_ntrip_client, automatepro_spartn_client​

Publishers​

TopicTypeDescription
/sensor/gnss/correctionrtcm_msgs/msg/MessageRTCM or SPARTN correction data.

Parameters​

Both clients read the file /etc/opt/automatepro/ros/rtk_params.yaml. correction_source in its /** block selects the client that streams, ntrip or spartn. The packaged file leaves it empty, so both clients stay unconfigured and report an error; any other text has the same effect. Once it names a client, that client streams after it is configured and activated, as Select the Correction Client describes, or after a restart of the core driver. Both publish onto /sensor/gnss/correction, so only the selected client streams.

In the Applies column, on configure means that the node accepts a value set on the running node, for example with ros2 param set, and applies it the next time the node is configured, after a lifecycle cleanup and configure. A restart reads the parameter file again and drops a value set only on the running node.

NTRIP Client​

ParameterTypeValuesAppliesDescription
use_httpsbooltrue/falseon configureUses HTTPS when set to true.
hoststringon configureNTRIP server hostname. Must be set; printable ASCII without spaces.
portint2101 (1-65535)on configureNTRIP server port.
mountpointstringon configureMountpoint to connect to. Must be set; printable ASCII without spaces.
fix_topicstring/sensor/gnss/position/fixon configureTopic whose position is sent to a VRS caster.
gga_interval_sdouble30.0 (0 or ≥10)on configureSeconds between the GGA position sentences sent on the open connection, so a VRS caster keeps streaming. 0 sends the position only when connecting.
reconnect_backoff_sdouble1.0 (≥0.1)on configureDelay in seconds after the first failed connection attempt or a stream the caster closed. It doubles after each further failure, up to reconnect_backoff_max_s, and starts over once a connection delivers data.
reconnect_backoff_max_sdouble60.0 (≥ reconnect_backoff_s)on configureLongest delay in seconds between failed connection attempts.
reconnect_backoff_forbidden_max_sdouble600.0on configureLongest delay in seconds after the caster answers 403 (forbidden).

The NTRIP client reads its login from the files /etc/opt/automatepro/secrets/ntrip_username and /etc/opt/automatepro/secrets/ntrip_password, not from parameters.

With both files empty, the client connects without a login, for casters that need none. With only one of them holding a value, it does not connect and logs an error.

If the caster refuses the login (HTTP 401) or does not offer the mountpoint (HTTP 404, or its source table instead of data), the client stops connecting and logs Streaming stopped with the reason every 5 minutes. Correct the login or the mountpoint, then restart the core driver.

The packaged NTRIP block leaves host and mountpoint empty, so the NTRIP client stays unconfigured and logs host and mountpoint must both be set; streaming disabled until you set both.

SPARTN Client​

ParameterTypeValuesAppliesDescription
use_httpsbooltrue/falseon configureUses HTTPS when set to true.
hoststringon configureNTRIP server hostname. Must be set; printable ASCII without spaces.
portint2102 (1-65535)on configureNTRIP server port.
mountpointstringon configureMountpoint to connect to. Must be set; printable ASCII without spaces.
gga_interval_sdouble10.0on configureInterval, in seconds, for sending GGA position sentences to the caster. 0 sends none.

The SPARTN client reads its login from the files /etc/opt/automatepro/secrets/spartn_username and /etc/opt/automatepro/secrets/spartn_password, not from parameters.

If the caster refuses the login (HTTP 401) or does not offer the mountpoint (HTTP 404, or its source table instead of data), the SPARTN client logs the reason once with streaming stopped until the node is activated again and makes no further connection attempt. Correct the login or the mountpoint, then restart the core driver.

The installer creates the four login files empty, and AutomatePro ships no default NTRIP or SPARTN login.

Both clients read their parameters and login files each time they are configured. When it starts, the client that correction_source names configures and activates itself. A change to rtk_params.yaml or to a login file needs no restart; Select the Correction Client describes how to apply it.

RTK Correction Services​

RTK (Real-Time Kinematic) correction service is a technique used to enhance the precision of position data derived from satellite-based positioning systems such as GPS, GLONASS, Galileo, and BeiDou. RTK achieves centimeter-level accuracy by using corrections transmitted from a network of ground-based reference stations to a receiver in real time. AutomatePro supports RTCM and SPARTN correction data over the NTRIP protocol.

If you already have login credentials for the NTRIP caster you want to use, proceed with configuring parameters as shown below. If you would like to set up a new one, follow the instructions below.

info

The following services have been tested with AutomatePro. If you use a different service provider, you may need to configure it according to that provider's instructions.

Here are the suggested free and paid correction services:

u-blox PointPerfect (Paid)​

u-blox correction data uses SPARTN format, which is more efficient than RTCM. More details can be found here. Before proceeding to the next step, you should have a hostname, mountpoint, username, and password.

The configuration file is:

/etc/opt/automatepro/ros/rtk_params.yaml

The file is owned by root, so edit it with sudo. It holds the settings of both correction clients. The SPARTN client has its own block:

/automatepro_spartn_client:
ros__parameters:
use_https: true
host: "ppntrip.services.u-blox.com"
port: 2102 # [http: 2101, https: 2102]
mountpoint: "NEAR-SPARTN" # From your PointPerfect credentials
gga_interval_s: 10.0

The packaged block already uses TLS on port 2102. Without TLS, the login is sent unencrypted.

Set correction_source in the /** block of the same file to the client that streams, spartn for PointPerfect:

/**:
ros__parameters:
correction_source: spartn

The SPARTN login is not a parameter. Write the PointPerfect user name and password into their files. Type each value and press Enter; the password is not shown as you type it:

IFS= read -rp 'PointPerfect user name: ' user && printf '%s' "$user" | sudo tee /etc/opt/automatepro/secrets/spartn_username >/dev/null; unset user
IFS= read -rsp 'PointPerfect password: ' pw && printf '%s' "$pw" | sudo tee /etc/opt/automatepro/secrets/spartn_password >/dev/null; unset pw; echo

The SPARTN client sends the position receiver's NMEA output to the caster, so keep publish.nmea: true in gnss_position_params.yaml, the packaged default.

RTK2go (Free)​

RTK2go is a community NTRIP caster that provides free RTK correction service. To use it, select a mountpoint near your location. You can find the list of available mountpoints here. Click on view-all to view mountpoints on the map.

Once you have the mountpoint you would like to connect to, add that to the config file as shown below.

The configuration file is:

/etc/opt/automatepro/ros/rtk_params.yaml

The NTRIP client has its own block of this file:

/automatepro_ntrip_client:
ros__parameters:
use_https: false
host: rtk2go.com
port: 2101
mountpoint: Prittlbach # Add your mountpoint here

Set correction_source in the /** block of the same file to ntrip:

/**:
ros__parameters:
correction_source: ntrip

The NTRIP client reads its credentials from files in /etc/opt/automatepro/secrets/, not from the parameter file. RTK2go requires a valid email address as the user name and accepts none as the password. Write both into their files. Type your email address and press Enter, then type none and press Enter; the password is not shown as you type it:

IFS= read -rp 'Email address: ' user && printf '%s' "$user" | sudo tee /etc/opt/automatepro/secrets/ntrip_username >/dev/null; unset user
IFS= read -rsp 'Password: ' pw && printf '%s' "$pw" | sudo tee /etc/opt/automatepro/secrets/ntrip_password >/dev/null; unset pw; echo

Select the Correction Client​

ROS_DRIVER_GNSS_RTK_CORRECTION=1 in /etc/opt/automatepro/automatepro.conf, the packaged default, starts both clients, and correction_source in rtk_params.yaml selects the one that streams. Choosing a client needs no restart, since each client reads every parameter and its login files again at each configure. After you edit rtk_params.yaml or a login file, load the file into both clients, then configure and activate the client that correction_source names, here the NTRIP client:

. /opt/automatepro/scripts/ros-env.sh && automatepro_source_ros
FILE=/etc/opt/automatepro/ros/rtk_params.yaml # after setting correction_source: ntrip
ros2 param load /automatepro_ntrip_client "$FILE"
ros2 param load /automatepro_spartn_client "$FILE"
ros2 lifecycle set /automatepro_ntrip_client configure
ros2 lifecycle set /automatepro_ntrip_client activate

For SPARTN, configure and activate /automatepro_spartn_client instead. To switch from one client to the other, or to apply a change to the client that streams, first take that client down with ros2 lifecycle set <client> deactivate and ros2 lifecycle set <client> cleanup: between the activate of one client and the deactivate of the other, both stream onto /sensor/gnss/correction. Edit the file, not only the running nodes, because a client that restarts reads the file again.

With ROS_DRIVER_GNSS_RTK_CORRECTION=0 in automatepro.conf, neither client runs. To run them, set it to 1:

ROS_DRIVER_GNSS_RTK_CORRECTION=1
Important

Restart the automatepro-core-driver Docker container after changing automatepro.conf. The switch is applied when the container restarts.

sudo systemctl restart automatepro-core-driver