Skip to content

Commit d94aa77

Browse files
JianyuWang0623xiaoxiang781216
authored andcommitted
uORB/sensor: Add GNSS Geofence, Measurement & Clock.
Signed-off-by: wangjianyu3 <[email protected]>
1 parent ad2514f commit d94aa77

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

system/uorb/sensor/gnss.c

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,40 @@
2929
****************************************************************************/
3030

3131
#ifdef CONFIG_DEBUG_UORB
32+
#define UORB_DEBUG_FORMAT_SENSOR_GNSS \
33+
"timestamp:%" PRIu64 ",time_utc:%" PRIu64 ",latitude:%hf,longitude:%hf," \
34+
"altitude:%hf,altitude_ellipsoid:%hf,eph:%hf,epv:%hf,hdop:%hf,pdop:%hf," \
35+
"vdop:%hf,ground_speed:%hf,course:%hf,satellites_used:%" PRIu32 ""
36+
3237
static const char sensor_gnss_format[] =
33-
"timestamp:%" PRIu64 ",time_utc:%" PRIu64 ",latitude:%hf,longitude:%hf,"
34-
"altitude:%hf,altitude_ellipsoid:%hf,eph:%hf,epv:%hf,hdop:%hf,pdop:%hf,"
35-
"vdop:%hf,ground_speed:%hf,course:%hf,satellites_used:%" PRIu32 "";
38+
UORB_DEBUG_FORMAT_SENSOR_GNSS;
39+
40+
static const char sensor_gnss_clock_format[] =
41+
"flags:%" PRIx32 ",leap_second:%" PRId32 ",time_ns:%" PRId64 ","
42+
"time_uncertainty_ns:%hf,hw_clock_discontinuity_count:%" PRIu32 ","
43+
"full_bias_ns:%" PRId64 ",bias_ns:%hf,bias_uncertainty_ns:%hf,"
44+
"drift_nsps:%hf,drift_uncertainty_nsps:%hf";
45+
46+
static const char sensor_gnss_geofence_event_format[] =
47+
"type:%" PRId32 ",geofence_id:%" PRId32 ","
48+
UORB_DEBUG_FORMAT_SENSOR_GNSS ","
49+
"timestamp:%" PRId64 ",status:%" PRId32 ",transition:%" PRId32 "";
50+
51+
static const char sensor_gnss_measurement_format[] =
52+
"flags:%" PRIx32 ",svid:%" PRId32 ",constellation:%" PRIu32 ","
53+
"time_offset_ns:%hf,received_sv_time_in_ns:%" PRId64 ","
54+
"received_sv_time_uncertainty_in_ns:%" PRId64 ",state:%" PRIu32 ","
55+
"c_n0_dbhz:%hf,pseudorange_rate_mps:%hf,"
56+
"pseudorange_rate_uncertainty_mps:%hf,"
57+
"accumulated_delta_range_state:%" PRIu32 ",accumulated_delta_range_m:%hf,"
58+
"accumulated_delta_range_uncertainty_m:%hf,"
59+
"carrier_frequency_hz:%hf,carrier_cycles:%" PRId64 ",carrier_phase:%hf,"
60+
"carrier_phase_uncertainty:%hf,multipath_indicator:%" PRIu32 ","
61+
"snr:%" PRIu32 "";
3662

3763
static const char sensor_gnss_satellite_format[] =
3864
"timestamp:%" PRIu64 ",count:%" PRIu32 ",satellites:%" PRIu32 ","
65+
"constellation:%" PRIu32 ","
3966
"svid0:%" PRIu32 ",elevation0:%" PRIu32 ",azimuth0:%" PRIu32 ","
4067
"snr0:%" PRIu32 ",svid1:%" PRIu32 ",elevation1:%" PRIu32 ","
4168
"azimuth1:%" PRIu32 ",snr1:%" PRIu32 ",svid2:%" PRIu32 ","
@@ -49,5 +76,11 @@ static const char sensor_gnss_satellite_format[] =
4976
****************************************************************************/
5077

5178
ORB_DEFINE(sensor_gnss, struct sensor_gnss, sensor_gnss_format);
79+
ORB_DEFINE(sensor_gnss_clock, struct sensor_gnss_clock,
80+
sensor_gnss_clock_format);
81+
ORB_DEFINE(sensor_gnss_geofence_event, struct sensor_gnss_geofence_event,
82+
sensor_gnss_geofence_event_format);
83+
ORB_DEFINE(sensor_gnss_measurement, struct sensor_gnss_measurement,
84+
sensor_gnss_measurement_format);
5285
ORB_DEFINE(sensor_gnss_satellite, struct sensor_gnss_satellite,
5386
sensor_gnss_satellite_format);

system/uorb/sensor/gnss.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
/* register this as object request broker structure */
3535

3636
ORB_DECLARE(sensor_gnss);
37+
ORB_DECLARE(sensor_gnss_clock);
38+
ORB_DECLARE(sensor_gnss_geofence_event);
39+
ORB_DECLARE(sensor_gnss_measurement);
3740
ORB_DECLARE(sensor_gnss_satellite);
3841

3942
#endif

system/uorb/sensor/topics.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ static FAR const struct orb_metadata *g_sensor_list[] =
8383
ORB_ID(sensor_force),
8484
ORB_ID(sensor_gas),
8585
ORB_ID(sensor_gnss),
86+
ORB_ID(sensor_gnss_clock),
87+
ORB_ID(sensor_gnss_geofence_event),
88+
ORB_ID(sensor_gnss_measurement),
8689
ORB_ID(sensor_gnss_satellite),
8790
ORB_ID(sensor_gyro),
8891
ORB_ID(sensor_gyro_uncal),

0 commit comments

Comments
 (0)