AP_GPS: added GPS_MIN_ELEV parameter

allows setting of satellite elevation mask in degrees
This commit is contained in:
Andrew Tridgell 2014-09-04 14:43:29 +10:00
parent 840a4dee1e
commit 15470bd81b
3 changed files with 23 additions and 2 deletions

View File

@ -71,6 +71,14 @@ const AP_Param::GroupInfo AP_GPS::var_info[] PROGMEM = {
// @User: Advanced
AP_GROUPINFO("SBAS_MODE", 5, AP_GPS, _sbas_mode, 2),
// @Param: MIN_ELEV
// @DisplayName: Minimum elevation
// @Description: This sets the minimum elevation of satellites above the horizon for them to be used for navigation. Setting this to -100 leaves the minimum elevation set to the GPS modules default.
// @Range: -100 90
// @Units: Degrees
// @User: Advanced
AP_GROUPINFO("MIN_ELEV", 6, AP_GPS, _min_elevation, -100),
AP_GROUPEND
};

View File

@ -294,6 +294,7 @@ public:
AP_Int8 _min_dgps;
#endif
AP_Int8 _sbas_mode;
AP_Int8 _min_elevation;
// handle sending of initialisation strings to the GPS
void send_blob_start(uint8_t instance, const prog_char *_blob, uint16_t size);

View File

@ -309,7 +309,11 @@ AP_GPS_UBLOX::_parse_gps(void)
}
if (_class == CLASS_CFG && _msg_id == MSG_CFG_NAV_SETTINGS) {
Debug("Got engine settings %u\n", (unsigned)_buffer.nav_settings.dynModel);
Debug("Got settings %u min_elev %d drLimit %u\n",
(unsigned)_buffer.nav_settings.dynModel,
(int)_buffer.nav_settings.minElev,
(unsigned)_buffer.nav_settings.drLimit);
_buffer.nav_settings.mask = 0;
if (gps._navfilter != AP_GPS::GPS_ENGINE_NONE &&
_buffer.nav_settings.dynModel != gps._navfilter) {
// we've received the current nav settings, change the engine
@ -317,7 +321,15 @@ AP_GPS_UBLOX::_parse_gps(void)
Debug("Changing engine setting from %u to %u\n",
(unsigned)_buffer.nav_settings.dynModel, (unsigned)gps._navfilter);
_buffer.nav_settings.dynModel = gps._navfilter;
_buffer.nav_settings.mask = 1; // only change dynamic model
_buffer.nav_settings.mask |= 1;
}
if (gps._min_elevation != -100 &&
_buffer.nav_settings.minElev != gps._min_elevation) {
Debug("Changing min elevation to %d\n", (int)gps._min_elevation);
_buffer.nav_settings.minElev = gps._min_elevation;
_buffer.nav_settings.mask |= 2;
}
if (_buffer.nav_settings.mask != 0) {
_send_message(CLASS_CFG, MSG_CFG_NAV_SETTINGS,
&_buffer.nav_settings,
sizeof(_buffer.nav_settings));