uORB/sensor: Add timestamp for GNSS data

Add timestamp for GNSS measurements and clock, for matching.

When recovering the combination of `GnssMeasurement` and `GnssClock` into
[GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/
           refs/heads/android14-release/include/hardware/gps.h#1748),
the reason for splitting is that the uORB buffer is not large enough to
accommodate `GnssData`, since different topics cannot guarantee the
same timing when publishing and subscribing data, we need an index to match.

WARNING: A new member "timestamp" of type uint64_t has been added at
the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock".

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2025-05-09 16:39:21 +08:00 committed by Xiang Xiao
parent d63bb6d81d
commit 0fbeae7f0d

View file

@ -57,6 +57,7 @@ static const char sensor_gnss_format[] =
UORB_DEBUG_FORMAT_SENSOR_GNSS ",firmware_version:%" PRIu32 "";
static const char sensor_gnss_clock_format[] =
"timestamp:%" PRIu64 ","
"flags:%" PRIx32 ",leap_second:%" PRId32 ",time_ns:%" PRId64 ","
"time_uncertainty_ns:%hf,hw_clock_discontinuity_count:%" PRIu32 ","
"full_bias_ns:%" PRId64 ",bias_ns:%hf,bias_uncertainty_ns:%hf,"
@ -68,6 +69,7 @@ static const char sensor_gnss_geofence_event_format[] =
"timestamp:%" PRId64 ",status:%" PRId32 ",transition:%" PRId32 "";
static const char sensor_gnss_measurement_format[] =
"timestamp:%" PRIu64 ","
"flags:%" PRIx32 ",svid:%" PRId32 ",constellation:%" PRIu32 ","
"time_offset_ns:%hf,received_sv_time_in_ns:%" PRId64 ","
"received_sv_time_uncertainty_in_ns:%" PRId64 ",state:%" PRIu32 ","