drivers/gps: extract Septentrio into new standalone drivers/gnss/septentrio module (#22904)

Having a generic interface over the GPS drivers makes dedicated
functionality for each driver harder. Move the Septentrio driver into
its own module under the `gnss` driver directory, and let it have its
own parameters for only the functionality it requires. This also helps
with adding new features because they only need to be implemented for
the driver that wants it, simplifying testing.
This commit is contained in:
Thomas Frans
2024-07-25 10:38:55 -07:00
committed by Ramon Roche
parent d298be9cc5
commit 6666c98d02
27 changed files with 4028 additions and 56 deletions
+1 -26
View File
@@ -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"
@@ -97,7 +96,6 @@ enum class gps_driver_mode_t {
EMLIDREACH,
FEMTOMES,
NMEA,
SBF
};
enum class gps_dump_comm_mode_t : int32_t {
@@ -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
}
}
@@ -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");
@@ -875,11 +864,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:
@@ -1056,11 +1040,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
@@ -1120,10 +1101,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:
@@ -1496,8 +1473,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);