Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions subsys/task_runner/tasks/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ config TASK_RUNNER_TASK_GNSS_UBX

if TASK_RUNNER_TASK_GNSS_UBX

config TASK_RUNNER_GNSS_MINIMUM_ACCURACY_M
int "Accuracies worse than this threshold are reported as (-181,-91)"
default 10000

config TASK_RUNNER_GNSS_TIME_RESYNC_PERIOD_SEC
int "Resynchronise time from GNSS every N seconds"
default 3600
Expand Down
6 changes: 6 additions & 0 deletions subsys/task_runner/tasks/task_gnss_ubx.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ static void log_and_publish(struct gnss_run_state *state, const struct ubx_msg_n
llha.h_acc = INT32_MAX;
llha.v_acc = INT32_MAX;
}
/* Set invalid location on insufficient accuracy */
if (pvt->h_acc > (CONFIG_TASK_RUNNER_GNSS_MINIMUM_ACCURACY_M * 1000)) {
llha.location.longitude = -1810000000;
llha.location.latitude = -910000000;
llha.location.height = 0;
}

/* Publish new data reading */
zbus_chan_pub(ZBUS_CHAN, &llha, K_FOREVER);
Expand Down
Loading