Commit Graph

71 Commits

Author SHA1 Message Date
Ryan Friedman b81a5deefe AP_ExternalAHRS: Add pre-arm for misconfigured EAHRS_SENSORS and GPS_TYPE
* 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
* And fix a little logging bug

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-04-30 09:18:46 +10:00
Ryan Friedman 6fc8185716 AP_ExternalAHRS: Only use GPS data when populating GPS fields
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:23:06 +11:00
Ryan Friedman 35451c7021 AP_ExternalAHRS: Check backend pre-arm before origin
* This allows the backend to report more detailed errors
* Before this, many pre-arm errors were hidden by origin failure
* If pre-arm could report multiple errors, that would be ideal

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:22:06 +11:00
Ryan Friedman 95ac178f20 Save flash, reduce code duplication
* Add generic health and time utils
* Fix bug only checking first GNSS system
* Use common logging struct
* Improve pre-arm log checks

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:22:06 +11:00
Ryan Friedman 9edc0f8ec6 AP_ExternalAHRS: Don't send init message till booted up
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:22:06 +11:00
Ryan Friedman d383a19c29 AP_ExternalAHRS: Use state watching instead
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:22:06 +11:00
Ryan Friedman 67b89a9b1f AP_ExternalAHRS: Provide warning for init failure
* If the device hasn't initialized in 5 seconds, give a warning

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:22:06 +11:00
Ryan Friedman dc2815e9f5 AP_ExternalAHRS: Use filter data to populate EKF status report
* Variances vs uncertainties may still be off
* Requires enabling the following packets in SensorConnect:
  * Position Uncertainty (LLH)
  * Velocity Uncertainty (NED)

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-26 11:11:39 +11:00
Peter Barker 84a81bebfe AP_ExternalAHRS: rename GPS_ to GPS1_ 2024-03-19 19:50:12 +11:00
Ryan Friedman 3cb4d2ec3b AP_ExternalAHRS: Populate orientation from filter
* Populating AHRS orientation from IMU was not correct

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2024-03-15 18:11:22 +11:00
Pulak Gautam 2d5e6a5f98 AP_ExternalAHRS: added missing #if AHRS logging 2024-03-05 17:11:38 +11:00
Andrew Tridgell 0aee2a436c AP_ExternalAHRS: check for origin in pre-arm check 2024-02-27 21:10:20 +11:00
Andrew Tridgell 9770855c9d AP_ExternalAHRS: make get_accel() and get_gyro() bool 2024-02-27 21:10:20 +11:00
Andrew Tridgell 9fd3e4169a AP_ExternalAHRS: added support for GPS disable and fwd flight
allow backends to determine if we are in fixed wing flight and/or the
GPS is disabled by the user
2024-02-27 21:10:20 +11:00
Andrew Tridgell cb53e64293 AP_ExternalAHRS: added EAHRS_LOG_RATE and common logging
common logging for all EAHRS backends
2024-02-27 21:10:20 +11:00
Jackwooh f67d895677 AP_ExternalAHRS: Reserve aaeron ID
Added new EAHRS_TYPE
2024-01-21 07:33:17 +11:00
Peter Barker f92b02afd0 AP_ExternalAHRS: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Peter Barker f722457854 AP_ExternalAHRS: correct compilation with MicroStrain5 disabled 2024-01-15 09:39:41 +11:00
Peter Barker 7898d6f107 AP_ExternalAHRS: correct compilation when baro and compass externalahrs disabled 2024-01-15 09:39:41 +11:00
Henry Wurzburg 319202a233 AP_ExternalAHRS: add InertialLabs to type parameter 2024-01-01 13:18:08 +11:00
Andrew Tridgell 1d0fc4e87c AP_ExternalAHRS: fixed InertialLabs gyro/accel data
this fixes a flapping CI test
2023-12-29 06:29:52 +11:00
Andrew Tridgell 2842166b06 AP_ExternalAHRS: avoid uart owner issue
ensure we own uart before read
2023-12-26 06:21:42 +11:00
Ryan Friedman 1d805555f5 AP_ExternalAHRS: Fix typos in configuration for microstrain7
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-19 09:32:55 +11:00
Ryan Friedman dee0ca2f34 AP_ExternalARHS: Don't offer IMU by default
* Since MicroStrain won't support >400Hz yet

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-18 16:03:35 +11:00
Andrew Tridgell 757607e4f8 AP_ExternalAHRS: added InertialLabs backend 2023-12-17 09:47:30 +11:00
Andrew Tridgell 771dfdf826 AP_ExternalAHRS: added location extrapolation
this copes better with slow backends
2023-12-17 09:47:30 +11:00
Andrew Tridgell 3954425f77 AP_ExternalAHRS: allow backends to set default sensor set 2023-12-17 09:47:30 +11:00
Andrew Tridgell cbc14d1fa5 AP_ExternalAHRS: align origin with AHRS origin
automatically set origin to AHRS origin. This means if on boot
external AHRS is not the primary then it will use the origin from the
active backend, preventing a jump on change of backends
2023-12-17 09:47:30 +11:00
Ryan Friedman 7c183f4ab3 AP_ExternalAHRS: Add MicroStrain7 support
* Implement filter state without relying on GPS
* Implement health and initialization check based on filter state
* Fix pre-arm checks missing version
* Add version specifics to microstrain 5 log msgs
* Add utilities to microstrain packet to remove magic number array
  access

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-05 11:09:22 +11:00
Andrew Tridgell 2ef560db0b AP_ExternalAHRS: reserve some ExternalAHRS type values 2023-12-01 14:59:57 +11:00
Ryan Friedman be668ddc1b AP_ExternalAHRS: Clarify public interface design intent
* Discussions with Tridge on design intent for these accessors

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-28 11:48:22 +11:00
Ryan Friedman ef6105c5e0 AP_ExternalAHRS: Specify brand on all log messages
* The VN driver was likely written before there were multiple types
* The log messages make it seem like core AHRS problems rather than
  issues directly with VN

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-14 11:02:26 +11:00
muramura 45fc140e1d AP_ExternalAHRS: Change to Boolean value 2023-11-11 09:06:42 +09:00
Mykhailo Kuznietsov 7f2975d21a AP_ExternalAHRS: Fix some typos
Fixed some typos found in the code.
2023-10-12 18:30:42 +11:00
Peter Barker 429dbefade AP_AHRS: fill in error string when invalid backend specified 2023-09-25 08:11:23 +10:00
Peter Barker f8f28ee767 AP_ExternalAHRS: correct AP_ExternalAHRS init
default clause is in wrong place and shouldn't be present to start with...
2023-08-31 11:08:51 +10:00
Peter Barker 0bb8ec1e57 AP_ExternalAHRS: add missing includes 2023-08-30 12:26:14 +10:00
Ryan Friedman cbc0043b9b AP_ExternalAHRS: Fix nullptr crash on bootup
* If you didn't set the serial port parameter correctly, but enabled MicroStrain AHRS, it would crash on boot
* This is because AP_AHRS calls update() which calls build_packet()

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
2023-08-30 12:21:59 +10:00
Ryan Friedman d8eee6f41a AP_ExternalAHRS: Create common lib for MicroStrain
* Move common parsing to MicroStrain_common
* Add propogation of parsed packet type back to the driver
* Rename the driver to add series-5 specifier
* Unlocks adding 7-series driver with less code duplication
* Add missing includes

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-29 10:31:44 +10:00
Ryan Friedman 1839db7c1f AP_ExternalAHRS: Allow multiple external AHRS GPS instances
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-24 12:01:32 +10:00
Ryan Friedman cb480d2855 AP_ExternalAHRS: Rename LORD to MicroStrain
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-08-07 19:16:03 +10:00
Ryan Friedman 42abfa9e0e AP_ExternalAHRS: Use sparse-endian be32to<ftype>_ptr
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-06-05 09:09:13 +10:00
Ryan Friedman d0b8e672c0 AP_ExternalAHRS: Switch from type punning to defined behavior
* This was undefined behavior in the C++ standard
* Use the safer options in AP_Common
* Removes a compiler warning

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-06-05 09:09:13 +10:00
Peter Barker b471f9bfac AP_ExternalAHRS: create and use backend defines for AP_ExternalAHRS 2023-04-26 14:09:25 +10:00
Peter Barker de7d5c6899 AP_ExternalAHRS: don't check MINIMIZE_FEATURES when also checking BOARD_FLASH_SIZE
we have an assertion that no board with >1MB of flash is minimized
2023-04-15 09:33:35 +10:00
Peter Barker 74207ea687 AP_ExternalAHRS: add and use a "bool read(c)" method to AP_HAL
this is much less likely to not work vs the int16_t equivalent
2023-03-22 17:59:11 +11:00
Peter Barker f476a47228 AP_ExternalAHRS: specify AP_EXTERNALAHRS_ENABLED for periph in chibios_hwdef.py 2023-03-12 09:35:35 +11:00
Peter Barker c47a698edd AP_ExternalAHRS: honour AP_COMPASS_EXTERNALAHRS_ENABLED 2023-02-22 19:40:13 +11:00
Andrew Tridgell 32ee3002eb AP_ExternalAHRS: added EAHRS_SENSORS parameter
allow selection of what sensors to enable
2023-01-30 09:22:02 +11:00
Iampete1 3d9794a503 AP_ExternalAHRS: VectorNav: remove reset and wait as it causes baro calibration issues 2023-01-03 10:32:20 +11:00