-
Notifications
You must be signed in to change notification settings - Fork 90
Piksi PPS Sync
Timestamping sensor messages on arrival introduces jitter (and transmission and buffering delay) from the communication interface (USB, TCP, Serial). The package piksi_pps_sync address this problem by timestamping the GPS data with the correct GPS timestamp and synchronizing the (x86) host against the PPS clock.
To activate GPS time stamping set the flag in the driver settings.
The Piksi is delivering its SBP messages through TCP to the ROS driver. UART 1 publishes the NMEA GPZDA message at 1Hz to get absolute time on the computer. The PPS is enabled with default settings and goes into a GPIO port of the x86.
For validation we record an additional IMU on a microcontroller connected to the host computer where the hardware timestamps get translated via cuckoo time translator.
On the host machine we install a custom PPS driver to expose the PPS signal to Chrony. The NMEA is read out through GPSD. Chrony is configured to use the PPS as a local reference clock.
NOTE: On an ARM host computer you can easily configure the default PPS-GPIO module to readout the PPS signal.
One-liner that turns on green LED on UP board if clock error is below 999ns.
while true; do var=$(chronyc sources -v | grep PPS0 | sed 's/.*+\/- \(.*\)ns/\1/'); var_low=0; var_high=999; if [ $var -gt $var_low -a $var -lt $var_high ]; then echo 1 > /sys/class/leds/upboard\:green\:/brightness; else echo 0 > /sys/class/leds/upboard\:green\:/brightness; fi; sleep 1; done
We validate synchronization of the host against the GPS clock using chronyd sources -v
. After some convergence time one can observe nanoseconds offset between the PPS and the host clock.
To show the improvement over the existing time stamp on arrival (rospy.Time.now()
) we cross validate the angular velocity of the Piksi IMU with the external IMU described above. Here the system was rotated on a chair.
First of all we observe that the synchronized messages still have a delay of 10-15 ms. This may be due to internal filtering of the Piksi Bosch IMU, transmission delays or translation delay of the external ADIS IMU. But very importantly there is no buffering delay / jitter on the data anymore!