diff --git a/src/drivers/gps/devices b/src/drivers/gps/devices index 9282d3d733..52535dc2eb 160000 --- a/src/drivers/gps/devices +++ b/src/drivers/gps/devices @@ -1 +1 @@ -Subproject commit 9282d3d73391859f51c759a343a052dfb1be02e0 +Subproject commit 52535dc2ebb41bc5c134d99a1b9ad2023ac0512b diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index eaaf67e094..8a98952fac 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -697,6 +697,17 @@ GPS::run() } } + int32_t gnssSystemsParam = static_cast(GPSHelper::GNSSSystemsMask::RECEIVER_DEFAULTS); + + if (_instance == Instance::Main) { + handle = param_find("GPS_1_GNSS"); + param_get(handle, &gnssSystemsParam); + + } else if (_instance == Instance::Secondary) { + handle = param_find("GPS_2_GNSS"); + param_get(handle, &gnssSystemsParam); + } + initializeCommunicationDump(); uint64_t last_rate_measurement = hrt_absolute_time(); @@ -769,8 +780,11 @@ GPS::run() } _baudrate = _configured_baudrate; + GPSHelper::GPSConfig gpsConfig{}; + gpsConfig.output_mode = GPSHelper::OutputMode::GPS; + gpsConfig.gnss_systems = static_cast(gnssSystemsParam); - if (_helper && _helper->configure(_baudrate, GPSHelper::OutputMode::GPS) == 0) { + if (_helper && _helper->configure(_baudrate, gpsConfig) == 0) { /* reset report */ memset(&_report_gps_pos, 0, sizeof(_report_gps_pos)); diff --git a/src/drivers/gps/params.c b/src/drivers/gps/params.c index 4e080c5803..fd64bf221d 100644 --- a/src/drivers/gps/params.c +++ b/src/drivers/gps/params.c @@ -146,3 +146,63 @@ PARAM_DEFINE_INT32(GPS_1_PROTOCOL, 1); * @group GPS */ PARAM_DEFINE_INT32(GPS_2_PROTOCOL, 1); + +/** + * GNSS Systems for Primary GPS (integer bitmask) + * + * This integer bitmask controls the set of GNSS systems used by the receiver. Check your + * receiver's documentation on how many systems are supported to be used in parallel. + * + * Currently this functionality is just implemented for u-blox receivers. + * + * When no bits are set, the receiver's default configuration should be used. + * + * Set bits true to enable: + * 0 : Use GPS (with QZSS) + * 1 : Use SBAS (multiple GPS augmentation systems) + * 2 : Use Galileo + * 3 : Use BeiDou + * 4 : Use GLONASS + * + * @min 0 + * @max 31 + * @bit 0 GPS (with QZSS) + * @bit 1 SBAS + * @bit 2 Galileo + * @bit 3 BeiDou + * @bit 4 GLONASS + * + * @reboot_required true + * @group GPS + */ +PARAM_DEFINE_INT32(GPS_1_GNSS, 0); + +/** + * GNSS Systems for Secondary GPS (integer bitmask) + * + * This integer bitmask controls the set of GNSS systems used by the receiver. Check your + * receiver's documentation on how many systems are supported to be used in parallel. + * + * Currently this functionality is just implemented for u-blox receivers. + * + * When no bits are set, the receiver's default configuration should be used. + * + * Set bits true to enable: + * 0 : Use GPS (with QZSS) + * 1 : Use SBAS (multiple GPS augmentation systems) + * 2 : Use Galileo + * 3 : Use BeiDou + * 4 : Use GLONASS + * + * @min 0 + * @max 31 + * @bit 0 GPS (with QZSS) + * @bit 1 SBAS + * @bit 2 Galileo + * @bit 3 BeiDou + * @bit 4 GLONASS + * + * @reboot_required true + * @group GPS + */ +PARAM_DEFINE_INT32(GPS_2_GNSS, 0);