Skip to content

Commit

Permalink
gps: remove SBF driver and include Septentrio driver by default
Browse files Browse the repository at this point in the history
This removes the SBF code from the common GPS drivers which frees up
space to include the Septentrio driver module by default on some boards.
  • Loading branch information
flyingthingsintothings authored and AlexKlimaj committed Jun 3, 2024
1 parent d135162 commit f172587
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 48 deletions.
1 change: 1 addition & 0 deletions boards/cuav/nora/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_DRIVERS_CAMERA_TRIGGER=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
Expand Down
1 change: 1 addition & 0 deletions boards/cuav/x7pro/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_DRIVERS_CAMERA_TRIGGER=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
Expand Down
1 change: 1 addition & 0 deletions boards/cubepilot/cubeorange/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
Expand Down
1 change: 1 addition & 0 deletions boards/cubepilot/cubeorangeplus/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y
Expand Down
1 change: 1 addition & 0 deletions boards/mro/pixracerpro/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_BOSCH_BMI085=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
Expand Down
1 change: 1 addition & 0 deletions boards/px4/fmu-v3/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
Expand Down
1 change: 1 addition & 0 deletions boards/px4/fmu-v4/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=y
Expand Down
1 change: 1 addition & 0 deletions boards/px4/fmu-v5/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_COMMON_HYGROMETERS=y
Expand Down
1 change: 1 addition & 0 deletions boards/px4/fmu-v6x/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16470=y
Expand Down
3 changes: 1 addition & 2 deletions src/drivers/gps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ px4_add_module(
devices/src/nmea.cpp
devices/src/unicore.cpp
devices/src/crc.cpp
devices/src/sbf.cpp
MODULE_CONFIG
module.yaml
DEPENDS
git_gps_devices
)
)
27 changes: 1 addition & 26 deletions src/drivers/gps/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
# include "devices/src/mtk.h"
# include "devices/src/femtomes.h"
# include "devices/src/nmea.h"
# include "devices/src/sbf.h"

#endif // CONSTRAINED_FLASH
#include "devices/src/ubx.h"
Expand All @@ -97,7 +96,6 @@ enum class gps_driver_mode_t {
EMLIDREACH,
FEMTOMES,
NMEA,
SBF
};

enum class gps_dump_comm_mode_t : int32_t {
Expand Down Expand Up @@ -361,8 +359,6 @@ GPS::GPS(const char *path, gps_driver_mode_t mode, GPSHelper::Interface interfac
case 5: _mode = gps_driver_mode_t::FEMTOMES; break;

case 6: _mode = gps_driver_mode_t::NMEA; break;

case 7: _mode = gps_driver_mode_t::SBF; break;
#endif // CONSTRAINED_FLASH
}
}
Expand Down Expand Up @@ -706,13 +702,6 @@ GPS::run()
heading_offset = matrix::wrap_pi(math::radians(heading_offset));
}

handle = param_find("GPS_PITCH_OFFSET");
float pitch_offset = 0.f;

if (handle != PARAM_INVALID) {
param_get(handle, &pitch_offset);
}

int32_t gps_ubx_dynmodel = 7; // default to 7: airborne with <2g acceleration
handle = param_find("GPS_UBX_DYNMODEL");

Expand Down Expand Up @@ -886,11 +875,6 @@ GPS::run()
_helper = new GPSDriverNMEA(&GPS::callback, this, &_report_gps_pos, _p_report_sat_info, heading_offset);
set_device_type(DRV_GPS_DEVTYPE_NMEA);
break;

case gps_driver_mode_t::SBF:
_helper = new GPSDriverSBF(&GPS::callback, this, &_report_gps_pos, _p_report_sat_info, heading_offset, pitch_offset);
set_device_type(DRV_GPS_DEVTYPE_SBF);
break;
#endif // CONSTRAINED_FLASH

default:
Expand Down Expand Up @@ -1068,11 +1052,8 @@ GPS::run()
break;

case gps_driver_mode_t::FEMTOMES:
_mode = gps_driver_mode_t::SBF;
break;

case gps_driver_mode_t::SBF:
case gps_driver_mode_t::NMEA: // skip NMEA for auto-detection to avoid false positive matching

#endif // CONSTRAINED_FLASH
_mode = gps_driver_mode_t::UBX;
px4_usleep(500000); // tried all possible drivers. Wait a bit before next round
Expand Down Expand Up @@ -1132,10 +1113,6 @@ GPS::print_status()

case gps_driver_mode_t::NMEA:
PX4_INFO("protocol: NMEA");
break;

case gps_driver_mode_t::SBF:
PX4_INFO("protocol: SBF");
#endif // CONSTRAINED_FLASH

default:
Expand Down Expand Up @@ -1508,8 +1485,6 @@ GPS *GPS::instantiate(int argc, char *argv[], Instance instance)
} else if (!strcmp(myoptarg, "nmea")) {
mode = gps_driver_mode_t::NMEA;

} else if (!strcmp(myoptarg, "sbf")) {
mode = gps_driver_mode_t::SBF;
#endif // CONSTRAINED_FLASH
} else {
PX4_ERR("unknown protocol: %s", myoptarg);
Expand Down
21 changes: 1 addition & 20 deletions src/drivers/gps/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,6 @@ PARAM_DEFINE_INT32(GPS_UBX_CFG_INTF, 0);
*/
PARAM_DEFINE_FLOAT(GPS_YAW_OFFSET, 0.f);

/**
* Pitch offset for dual antenna GPS
*
* Vertical offsets can be compensated for by adjusting the Pitch offset (Septentrio).
*
* Note that this can be interpreted as the "roll" angle in case the antennas are aligned along the perpendicular axis. This occurs in situations where the two antenna ARPs may not be exactly at the same height in the vehicle reference frame. Since pitch is defined as the right-handed rotation about the vehicle Y axis, a situation where the main antenna is mounted lower than the aux antenna (assuming the default antenna setup) will result in a positive pitch.
*
*
* @min -90
* @max 90
* @unit deg
* @reboot_required true
* @decimal 3
*
* @group GPS
*/
PARAM_DEFINE_FLOAT(GPS_PITCH_OFFSET, 0.f);

/**
* Protocol for Main GPS
*
Expand All @@ -203,7 +185,6 @@ PARAM_DEFINE_FLOAT(GPS_PITCH_OFFSET, 0.f);
* @value 4 Emlid Reach
* @value 5 Femtomes
* @value 6 NMEA (generic)
* @value 7 Septentrio (SBF)
*
* @reboot_required true
* @group GPS
Expand Down Expand Up @@ -294,4 +275,4 @@ PARAM_DEFINE_INT32(GPS_1_GNSS, 0);
* @reboot_required true
* @group GPS
*/
PARAM_DEFINE_INT32(GPS_2_GNSS, 0);
PARAM_DEFINE_INT32(GPS_2_GNSS, 0);

0 comments on commit f172587

Please sign in to comment.