mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
* refactor(msg): rename SensorGps to SensorGnss and add VehicleGnss GPS is one constellation; the receivers and the rest of PX4 handle GNSS. Field names lose their units (latitude, speed_accuracy, course, ...), which move into the metadata comments. The sensors module's output becomes VehicleGnss on vehicle_gnss: the selected receiver's sample next to what the sensors module adds to it (corrected sample time, antenna position, selected instance), so a consumer can tell the two apart and later selection and check results have a place to go. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/gps): publish sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/septentrio): publish sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/pps_capture): read sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(lib/gnss): select receivers on sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(sensors): publish VehicleGnss on vehicle_gnss and rename SENS_GPS* to SENS_GNSS* The sensors module's output nests the selected receiver's sample, with the corrected sample time, antenna position and selected instance next to it. SENS_GPS_MASK/TAU/PRIME and SENS_GPSn_ID/OFFX/OFFY/OFFZ/DELAY take the SENS_GNSS name the heading parameters already use; saved parameters migrate on import, and the EKF2_GPS_POS/EKF2_GPS_DELAY translations now land on the new names directly. Assisted-by: Claude:claude-opus-5-5 * refactor(logger): log sensor_gnss and vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(ekf2): fuse vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(replay): replay vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(local_position_estimator): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(attitude_estimator_q): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(lib/terrain_estimation): take sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(lib/wind_estimator): read vehicle_gnss in the replay script Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(vision_target_estimator): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(navigator): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(commander): read sensor_gnss and vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(mavlink): stream sensor_gnss and vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(uxrce_dds_client): bridge vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(zenoh): bridge vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(failure_injection): inject GNSS failures on sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/ins): publish sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/uavcan): publish sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/uavcannode): read sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/cyphal): bridge sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/telemetry): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/rc): read vehicle_gnss for telemetry Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/osd): read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(drivers/transponder): read sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(boards/modalai): publish sensor_gnss from the voxl2 drivers Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(examples): publish sensor_gnss and read vehicle_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(simulation): publish sensor_gnss Follows the SensorGps to SensorGnss and vehicle_gps_position to VehicleGnss rename. Assisted-by: Claude:claude-opus-5-5 * refactor(gnss): name GNSS variables gnss in the sensors module and receiver drivers GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay. Assisted-by: Claude:claude-opus-5-5 * refactor(gnss): name GNSS variables gnss in the estimators and navigator GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay. Assisted-by: Claude:claude-opus-5-5 * refactor(gnss): name GNSS variables gnss in commander, mavlink and failure injection GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay. Assisted-by: Claude:claude-opus-5-5 * refactor(gnss): name GNSS variables gnss in the remaining drivers and simulation GPS is one constellation. Identifiers that hold or handle GNSS samples, or bind to the renamed parameters, follow the message and parameter rename; classes, files, modules and names tied to parameters that keep GPS stay. Assisted-by: Claude:claude-opus-5-5 * docs(gnss): reference sensor_gnss, vehicle_gnss and SENS_GNSS* parameters The upgrade guide covers the topic, field, ROS 2, parameter and Cyphal register renames. Assisted-by: Claude:claude-opus-5-5 * fix(boards): name EKF2::UpdateGnssSample in the fmu-v6xrt ITCM lists The rename left the old UpdateGpsSample symbol in the lists, so the ITCM check fails and the function drops out of ITCM on the boards it doesn't check. Assisted-by: Claude:claude-opus-5-5 * chore(drivers/gps): bump PX4-GPSDrivers to the merged sensor_gnss rename The submodule pointed at the PX4-GPSDrivers#243 branch commit; #243 is merged. Assisted-by: Claude:claude-opus-5-5 * docs(msg): restore WGS84 in SensorGnss and point VehicleGlobalPosition at vehicle_gnss The rename dropped the only mention of the WGS84 datum and ellipsoid, and left VehicleGlobalPosition referring to the removed vehicle_gps_position topic. Assisted-by: Claude:claude-opus-5-5 * refactor(msg): drop selected_instance from VehicleGnss receiver.device_id already names the selected receiver, and 0 while blended. The sensor_gnss instance depends on the order drivers advertise at boot, so it doesn't identify a receiver across boots or logs, and nothing reads it. It would also be meaningless on the per-receiver VehicleGnss instances proposed in #28894. Assisted-by: Claude:claude-opus-5-5 * refactor(gnss): fuse vehicle_gnss.timestamp_sample directly and document the receiver's corrected time vehicle_gnss.timestamp is now the sensors module's publish time, so EKF2's check of timestamp_sample against it was always true; the sensors module always fills timestamp_sample. The message docs described receiver.timestamp_sample as the driver's uncorrected value, but the sensors module writes the corrected time into it as well. Assisted-by: Claude:claude-opus-5-5 * docs(msg): point VehicleGnss users at the top-level timestamp_sample uXRCE-DDS shifts only top-level timestamp and timestamp_sample into agent time, so receiver.timestamp_sample reaches ROS 2 on the PX4 boot clock even though it holds the same value on uORB. Assisted-by: Claude:claude-opus-5-5 * docs(releases): tell ROS 2 users which VehicleGnss timestamps to read Only top-level timestamps are converted to ROS time, so a port that reads receiver.timestamp gets the PX4 boot clock, and vehicle_gnss.timestamp is now the sensors module's publish time rather than the receiver's. Assisted-by: Claude:claude-opus-5-5
145 lines
5.1 KiB
Markdown
145 lines
5.1 KiB
Markdown
# PPS Time Synchronization (PX4 Integration)
|
|
|
|
[Pulse Per Second](https://en.wikipedia.org/wiki/Pulse-per-second_signal) (PPS) time synchronization provides high-precision timing for GNSS receivers.
|
|
This page explains how PPS is integrated into PX4 and how to configure it.
|
|
|
|
## Overview
|
|
|
|
PPS (Pulse Per Second) is a timing signal provided by GNSS receivers that outputs an electrical pulse once per second, synchronized to UTC time.
|
|
The PPS signal provides a highly accurate timing reference that PX4 can use to:
|
|
|
|
- Refine GNSS time measurements and compensate for clock drift
|
|
- Provide precise UTC timestamps for camera capture events (for photogrammetry and mapping applications)
|
|
- Enable offline position refinement through accurate time correlation
|
|
|
|
## Supported Hardware
|
|
|
|
PPS time synchronization can be supported on flight controllers that have a hardware timer input pin that can be configured for PPS capture, by [enabling the PPS capture driver](#enable-pps-driver-in-board-configuration) in the board configuration.
|
|
|
|
Supported boards include (at time of writing):
|
|
|
|
- [Ark FMUv6x](../flight_controller/ark_v6x.md)
|
|
- Auterion FMUv6x
|
|
- Auterion FMUv6s
|
|
|
|
## Setup
|
|
|
|
### Enable PPS Driver in Board Configuration
|
|
|
|
The [PPS capture driver](../modules/modules_driver.md#pps-capture) must be enabled in the board configuration.
|
|
This is done by adding the following to your board's configuration:
|
|
|
|
```ini
|
|
CONFIG_DRIVERS_PPS_CAPTURE=y
|
|
```
|
|
|
|
### Configure PPS Parameters
|
|
|
|
The configuration varies depending on your flight controller hardware.
|
|
|
|
#### FMUv6X
|
|
|
|
For FMUv6X-based flight controllers, configure PWM AUX Timer 3 and Function 9:
|
|
|
|
```sh
|
|
param set PWM_AUX_TIM3 -2
|
|
param set PWM_AUX_FUNC9 2064
|
|
param set PPS_CAP_ENABLE 1
|
|
```
|
|
|
|
#### FMUv6S
|
|
|
|
For FMUv6S-based flight controllers, configure PWM MAIN Timer 3 and Function 10:
|
|
|
|
```sh
|
|
param set PWM_MAIN_TIM3 -2
|
|
param set PWM_MAIN_FUNC10 2064
|
|
param set PPS_CAP_ENABLE 1
|
|
```
|
|
|
|
#### Multi-GPS Setups
|
|
|
|
If you have multiple GPS receivers, set `PPS_CAP_GPS_ID` to the device ID of the GPS receiver that emits the PPS signal.
|
|
When set to `0` (default), the driver uses the first available GPS instance.
|
|
|
|
You can find the device ID by running:
|
|
|
|
```sh
|
|
listener sensor_gnss
|
|
```
|
|
|
|
### Wiring
|
|
|
|
The wiring configuration depends on your specific flight controller.
|
|
|
|
#### Skynode X (FMUv6x)
|
|
|
|
Connect the PPS signal from your GNSS module to the flight controller using the 11-pin or 6-pin GPS connector:
|
|
|
|
For detailed pinout information, refer to:
|
|
|
|
- [Skynode GPS Peripherals - Pinouts](https://docs.auterion.com/hardware-integration/skynode/peripherals/gps#pinouts)
|
|
|
|
#### Skynode S (FMUv6S)
|
|
|
|
For FMUv6S, you need to route the PPS signal separately:
|
|
|
|
1. Connect your GNSS module using the standard 6-pin GPS connector: [Skynode S GPS Interface](https://docs.auterion.com/hardware-integration/skynode-s/interfaces#gps)
|
|
2. Connect the PPS signal from your GNSS module to the **PPM_IN** pin: [Skynode S Extras 1 Interface](https://docs.auterion.com/hardware-integration/skynode-s/interfaces#extras-1)
|
|
|
|
#### ARK Jetson Carrier Board (FMUv6x)
|
|
|
|
For ARK FMUv6X on the Jetson carrier board:
|
|
|
|
1. Connect your GNSS module using either the 10-pin or 6-pin GPS connector: [ARK PAB GPS1 Interface](../flight_controller/ark_pab.md#gps1)
|
|
2. Connect the PPS signal to the **FMU_CAP** pin: [ARK PAB ADIO Interface](../flight_controller/ark_pab.md#adio)
|
|
|
|
## Verification
|
|
|
|
After configuring PPS, you can verify that it is working correctly:
|
|
|
|
1. Connect to the [PX4 System Console](../debug/system_console.md) (via MAVLink shell or serial console).
|
|
2. Wait for GNSS fix.
|
|
3. Check the PPS capture status to confirm it is up and running:
|
|
|
|
```sh
|
|
pps_capture status
|
|
```
|
|
|
|
4. You can also check the [PpsCapture](../msg_docs/PpsCapture.md) uORB topic
|
|
|
|
```sh
|
|
listener pps_capture
|
|
```
|
|
|
|
Where you should see: `timestamp`, `rtc_timestamp`, and `pps_rate_exceeded_counter`.
|
|
|
|
### PPS Capture Driver
|
|
|
|
The PPS capture driver is located in `src/drivers/pps_capture` and uses hardware timer input capture to precisely measure the arrival time of each PPS pulse.
|
|
|
|
Key features:
|
|
|
|
- Sub-microsecond pulse capture precision (hardware-dependent)
|
|
- Automatic drift calculation and compensation
|
|
- Integration with the GNSS driver for refined time stamping
|
|
|
|
See also:
|
|
|
|
- [PPS Capture Driver Documentation](../modules/modules_driver.md#pps-capture)
|
|
- [PpsCapture Message](../msg_docs/PpsCapture.md)
|
|
|
|
### Time Synchronization Flow
|
|
|
|
1. GNSS module sends position/time data at ~1-20 Hz.
|
|
2. GNSS module outputs PPS pulse at 1 Hz, precisely aligned to UTC second boundary.
|
|
3. PPS capture driver measures the exact time of the PPS pulse arrival using hardware timer.
|
|
4. Driver calculates the offset between GNSS time (from UART data) and autopilot clock (from PPS measurement).
|
|
5. This offset is used to correct GNSS timestamps and improve sensor fusion accuracy.
|
|
|
|
The PPS signal provides much higher temporal precision than the transmitted time data, which has latency and jitter from serial communication.
|
|
|
|
::: warning
|
|
If the PPS driver does not send any data for 5 seconds (despite having `PPS_CAP_ENABLE` set to 1), the corresponding `SENS_GNSS*_DELAY` parameter will be used instead for estimating the latency.
|
|
:::
|