PX4 - RTK GNSS (GPS)
Introduction
Real Time Kinematic GNSS GPS systems provide centimetre-level accuracy, allowing PX4 to be used in applications like precision surveying (where pinpoint accuracy is essential).
Positioning Setup Configuration
- QGroundControl running on Laptop/PC as Ground Station.
- Vehicle with WiFi or Telementry radio link to Ground Station.
Hardware Setup
Vehicle RTK Module
RTK modules need to be connect to the vehicle's flight controller GPS port (in some it is the CAN bus).
Base RTK Module
Connect base module to QGroundControl via USB.
Base module must not be moved while it is being used!
Choose a position where the base module won't need to be moved, has a clear view of the sky, and is well separated from any buildings. Often it is helpful to elevate the base GPS, by using a tripod or mounting it on a roof.
Telemetry Radio/WiFi
Vehicle and ground control laptop must be connected via WiFi or radio telemetry link.
Link must use MAVLink 2 protocol as it makes more efficient use of the channel
in QGC set MAV_PROTO_VER to 2
RTK Connection Process
Start QGC and attach base RTK GPS with USB. Device should be recognised automatically.
Start vehicle and make it connect to QGC.
QGC starts the RTK setup process "Survey-In". This typically takes several minutes and ends after reaching minimum time and accuracy provided in RTK settings.
To set the minimum time and accuracy:
Application Settings > General Settings > RTK GPS
Save and reuse base position in order to save time: perform 'Survey-In' once, select 'Use Specified Base Position' and then 'Save Current Base Position'
Wait until GPS icon turns from red to white on QGC and check if 'RTK Streaming'.
GPS Status should say "GPS Lock: 3D RTK GPS Lock (fixed)".
Alternative: RTK Connection Process with NTRIP server/client
NTRIP Server
- Download the ucenter app from their website. This only works on windows.
- Ensure that the server can be pinged from remote at its IP.
- Connect any of the following F9P modules to the computer. Prefer the H-RTK F9P Base. Fix this device. You can then start the Survey-In process to get the GPS position of the device. Prefer to limit the error to centimetre accuracy so this process must be conducted for a significant duration.
- Once done, take note of the GPS coordinates.
- For one time, set the Time-Mode for the server:
- View -> Configuration View, then select TMODE3 on the left listbox.
- Set to Fixed Mode and add the Lat/Long/Alt plus the accuracy of 0.00m.
- Save configuration and click "Send".
- Can then start setting up the NTRIP server according to instructions in Page 55 of 74 on this manual:
- Ensure that: 1005, 1074, 1084, 1094, 1124, 1230 are checked with period 1 sec
NTRIP Client
This is integrated into the ROS 2 platform.
The NTRIP client is in this repository: LORD-MicroStrain/ntrip_client.
It primarily works by processing the information received from server and packaging it into px4_msgs/msg/GpsInjectData ROS message and pushing it into /fmu/in/gps_inject_data.
The /fmu/in/gps_inject_data needs to be enabled on the PX4-Autopilot firmware in the dds_topics.yaml.
Post Setup
Tuning
You may also need to tune some parameters as the default parameters are tuned assuming a GPS accuracy in the order of meters, not centimeters. For example, you can decrease EKF2_GPS_V_NOISE and EKF2_GPS_P_NOISE to 0.2.