ardupilot
ardupilot copied to clipboard
AP_ExternalAHRS: Add pre-arm for misconfigured EAHRS_SENSORS and GPS_TYPE
Purpose
- This catches when there's a mismatch of GPSx_TYPE and EAHRS_SENSORS when GPS is enabled
- Before this pre-arm, failure to set GPS_TYPE2 to 21 (ExternalAHRS) resulted in silent rejection of the data in AP_GPS because the default is off
- The wiki did not say to set GPS_TYPE on anything but the VN300
- For now, until we support 3+ GPS instances, this only checks if you have at least on GPSx_TYPE set to EAHRS.
Drive by fix - logging problem in Microstrain7 with format strings.
Tests
Tested in SITL with MicroStrain7 hardware. And, a new CI test:
./Tools/autotest/autotest.py build.Plane test.Plane.GpsSensorPreArmEAHRS
Why?
The default behavior is to disable the 2nd GPS, so MicroStrain7 was dropping the data on the floor in the call to AP::gps().handle_external(gps, instance);
Futher improvements
The same behavior is possible with other external sensors?