From af5256c4540e51d9f1e369d9db22232a0d20aa14 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 24 Jun 2017 21:40:35 -0400 Subject: [PATCH] GPS ublox add dynamic model parameter --- src/drivers/gps/devices | 2 +- src/drivers/gps/gps.cpp | 8 ++++++-- src/drivers/gps/params.c | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/drivers/gps/devices b/src/drivers/gps/devices index dd275f36cb..e645b90967 160000 --- a/src/drivers/gps/devices +++ b/src/drivers/gps/devices @@ -1 +1 @@ -Subproject commit dd275f36cb22a82342bdeadf4f66b4f6af03ef92 +Subproject commit e645b90967a304669a51f0105882ac21470c646c diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index a869181c97..b7a688fe15 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -686,9 +686,13 @@ GPS::task_main() _mode = GPS_DRIVER_MODE_UBX; /* FALLTHROUGH */ + case GPS_DRIVER_MODE_UBX: { + int32_t param_gps_ubx_dynmodel = 7; // default to 7: airborne with <2g acceleration + param_get(param_find("GPS_UBX_DYNMODEL"), ¶m_gps_ubx_dynmodel); - case GPS_DRIVER_MODE_UBX: - _helper = new GPSDriverUBX(_interface, &GPS::callback, this, &_report_gps_pos, _p_report_sat_info); + _helper = new GPSDriverUBX(_interface, &GPS::callback, this, &_report_gps_pos, _p_report_sat_info, + param_gps_ubx_dynmodel); + } break; case GPS_DRIVER_MODE_MTK: diff --git a/src/drivers/gps/params.c b/src/drivers/gps/params.c index 75f4c3dc22..290429aa4d 100644 --- a/src/drivers/gps/params.c +++ b/src/drivers/gps/params.c @@ -44,3 +44,22 @@ */ PARAM_DEFINE_INT32(GPS_DUMP_COMM, 0); +/** + * u-blox GPS dynamic platform model + * + * u-blox receivers support different dynamic platform models to adjust the navigation engine to + * the expected application environment. + * + * @min 0 + * @max 9 + * @value 2 stationary + * @value 4 automotive + * @value 6 airborne with <1g acceleration + * @value 7 airborne with <2g acceleration + * @value 8 airborne with <4g acceleration + * + * @reboot_required true + * + * @group GPS + */ +PARAM_DEFINE_INT32(GPS_UBX_DYNMODEL, 7);