Peter Barker and Claude Opus 5
a78ff48a62
AP_Compass: add a feature gate for copy-from-EKF calibration
...
AP_COMPASS_LEARN_COPY_FROM_EKF_ENABLED, defaulting to
COMPASS_LEARN_ENABLED && AP_AHRS_ENABLED, so the disarm-time copying of
EKF-learned offsets can be compiled out on its own.
save_ekf_learned_offsets() moves out of the COMPASS_LEARN_ENABLED block
in Compass_learn.cpp so the two are genuinely separable; the in-flight
learner drags in the EKF-GSF yaw estimator, which this does not need.
Verified with nm: Compass::save_ekf_learned_offsets is present in a
default build and absent when the define is 0, with COMPASS_LEARN_ENABLED
still enabled.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-09-04 09:29:27 +10:00
Peter Barker and Claude Opus 5
1f1072c46d
AP_Compass: add save_ekf_learned_offsets
...
Moves the "save compass offsets learned by the EKF" logic out of the
vehicle AP_Arming subclasses, where it was duplicated verbatim in
Copter, Sub and Blimp, and into the library that owns the parameters
being written.
The AHRS is now checked for health before its estimates are copied.
Note the loop over COMPASS_MAX_INSTANCES is not redundant: a single EKF
core only ever returns offsets for its own selected compass, but with
EK3_AFFINITY compass affinity each core takes a different compass and
the frontend asks every core for each instance in turn.
Also drops a stale reference to ::learn_offsets, which no longer
exists, and corrects the COMPASS_LEARN description, which still
advertised the removed compass-only fixed wing method.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-09-04 09:29:27 +10:00
Peter Barker
bc914006bf
AP_Compass: remove primary compass parameter conversion
...
Converted the old COMPASS_PRIMARY into the device-id priority list.
Added Feb-2020 and present in the 4.3.0 release, so anybody running
4.3.0 or later has already had it applied.
Note that the conversion sat inside Compass::init(), below its
if (!_enabled) {
return;
}
early return, so "present in the release" is not quite the same as "has
run". A user who has had COMPASS_ENABLE=0 for every release from 4.3
onwards never reached the conversion, and if they enable the compass
after moving to 4.8 their old COMPASS_PRIMARY selection is not honoured.
That is judged too unlikely - and the parameter too old - to keep the
conversion for.
2026-09-01 20:49:36 +10:00
“Jim
4f48a09e7f
AP_Compass: add AF9838 backend
2026-08-31 08:18:54 +10:00
Peter Barker
013b6649c7
AP_Compass: annotate primary compass parameter conversion
...
Converts the old COMPASS_PRIMARY into the device-id priority list.
Added Feb-2020; it carried no PARAMETER_CONVERSION annotation.
2026-08-31 08:18:26 +10:00
Peter Barker
134b535916
AP_Compass: remove stale CUSTOM_ROLL/CUSTOM_PIT_CUSTOM_YAW param doc
...
removes as the conversion code is also going, and we have versioned parameters now-adays
2026-08-26 09:47:38 +10:00
Peter Barker
94ef9886f6
AP_Compass: remove from-4.1 custom-rotation conversion code
2026-08-26 09:47:38 +10:00
Peter Barker
643fe19f0f
AP_Compass: correct '#endif // COMMENT' comments
...
these should always match the opening #if
2026-08-04 11:59:14 +10:00
Peter Barker
ba34b23c61
AP_Compass: guard probing external IIS2MDC with new define
colcon build/test / build-test (push) Has been cancelled
Cygwin Build / build (push) Has been cancelled
ESP32 Build / build (esp32buzz, 10) (push) Has been cancelled
ESP32 Build / build (esp32s3empty, 10) (push) Has been cancelled
Macos Build / build (CubeOrange) (push) Has been cancelled
Macos Build / build (sitl) (push) Has been cancelled
pre-commit / ci (push) Has been cancelled
QURT Build / build (push) Has been cancelled
test ccache / build (10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-EKF2, 10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-ODID, 10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-PPP, 10, chibios) (push) Has been cancelled
test chibios / build (CubeOrange-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (CubeRedPrimary-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (MatekF405-Wing, 10, chibios) (push) Has been cancelled
test chibios / build (Pixhawk6X-PPPGW, 10, chibios) (push) Has been cancelled
test chibios / build (SOHW, 10, chibios) (push) Has been cancelled
test chibios / build (build-options-defaults-test, 10, chibios) (push) Has been cancelled
test chibios / build (configure-all, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv2-plane, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv3, 10, chibios) (push) Has been cancelled
test chibios / build (fmuv3-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (iofirmware, 10, chibios) (push) Has been cancelled
test chibios / build (new-check, 10, chibios) (push) Has been cancelled
test chibios / build (periph-build, 10, chibios) (push) Has been cancelled
test chibios / build (revo-bootloader, 10, chibios) (push) Has been cancelled
test chibios / build (revo-mini, 10, chibios) (push) Has been cancelled
test chibios / build (signing, 10, chibios) (push) Has been cancelled
test chibios / build (stm32f7, 10, chibios) (push) Has been cancelled
test chibios / build (stm32h7, 10, chibios) (push) Has been cancelled
test chibios / build (stm32h7-debug, 10, chibios) (push) Has been cancelled
test dds / build (sitl) (push) Has been cancelled
test dds / build (stm32h7) (push) Has been cancelled
test Linux SBC / build (bbbmini, armhf) (push) Has been cancelled
test Linux SBC / build (bebop, armhf) (push) Has been cancelled
test Linux SBC / build (bhat, armhf) (push) Has been cancelled
test Linux SBC / build (canzero, armhf) (push) Has been cancelled
test Linux SBC / build (erlebrain2, armhf) (push) Has been cancelled
test Linux SBC / build (linux, base) (push) Has been cancelled
test Linux SBC / build (navigator, armhf-musl) (push) Has been cancelled
test Linux SBC / build (navigator64, aarch64) (push) Has been cancelled
test Linux SBC / build (navio, armhf) (push) Has been cancelled
test Linux SBC / build (navio2, armhf) (push) Has been cancelled
test Linux SBC / build (pxf, armhf) (push) Has been cancelled
test Linux SBC / build (pxfmini, armhf) (push) Has been cancelled
test Linux SBC / build (t3-gem-o1, aarch64) (push) Has been cancelled
test replay / build (replay, base) (push) Has been cancelled
test replay / build (replay, clang) (push) Has been cancelled
test scripts / build (astyle-cleanliness) (push) Has been cancelled
test scripts / build (check_autotest_options) (push) Has been cancelled
test scripts / build (logger_metadata) (push) Has been cancelled
test scripts / build (param-file-validation) (push) Has been cancelled
test scripts / build (param_parse) (push) Has been cancelled
test scripts / build (python-cleanliness) (push) Has been cancelled
test scripts / build (shellcheck) (push) Has been cancelled
test scripts / build (validate_board_list) (push) Has been cancelled
test blimp / build (base) (push) Has been cancelled
test blimp / build (clang) (push) Has been cancelled
test blimp / autotest (sitltest-blimp) (push) Has been cancelled
test copter / build (base) (push) Has been cancelled
test copter / build (clang) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests1a) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests1b) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests1c) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests1d) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests1e) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests2a) (push) Has been cancelled
test copter / autotest (sitltest-copter-tests2b) (push) Has been cancelled
test copter / build-gcc-heli (push) Has been cancelled
test copter / autotest-heli (sitltest-heli) (push) Has been cancelled
test ap_periph / build-gcc-ap_periph (push) Has been cancelled
test ap_periph / autotest-can (sitltest-can) (push) Has been cancelled
test plane / build (base) (push) Has been cancelled
test plane / build (clang) (push) Has been cancelled
test plane / autotest (sitltest-plane-tests1a) (push) Has been cancelled
test plane / autotest (sitltest-plane-tests1b) (push) Has been cancelled
test plane / autotest (sitltest-plane-tests1c) (push) Has been cancelled
test plane / autotest (sitltest-quadplane) (push) Has been cancelled
test rover / build (base) (push) Has been cancelled
test rover / build (clang) (push) Has been cancelled
test rover / autotest (sitltest-balancebot) (push) Has been cancelled
test rover / autotest (sitltest-rover) (push) Has been cancelled
test rover / autotest (sitltest-sailboat) (push) Has been cancelled
test sub / build (base) (push) Has been cancelled
test sub / build (clang) (push) Has been cancelled
test sub / autotest (sitltest-sub) (push) Has been cancelled
test tracker / build (base) (push) Has been cancelled
test tracker / build (clang) (push) Has been cancelled
test tracker / autotest (sitltest-tracker) (push) Has been cancelled
test unit tests and sitl building / build (examples, base) (push) Has been cancelled
test unit tests and sitl building / build (examples, clang) (push) Has been cancelled
test unit tests and sitl building / build (sitl, base) (push) Has been cancelled
test unit tests and sitl building / build (sitl, clang) (push) Has been cancelled
test unit tests and sitl building / build (unit-tests, base) (push) Has been cancelled
test unit tests and sitl building / build (unit-tests, clang) (push) Has been cancelled
2026-06-01 17:05:32 +10:00
Jacob Dahl
7327339a95
AP_Compass: remove LIS2MDL driver, use IIS2MDC
...
LIS2MDL and IIS2MDC are the same ST silicon with identical register
maps, WHO_AM_I, I2C address and sensitivity. Remove the separate
LIS2MDL driver entirely and switch boards that referenced it to IIS2MDC.
AIRBRAINH743 COMPASS line changed from LIS2MDL to IIS2MDC.
2026-06-01 17:05:32 +10:00
Peter Barker
ef6ba3d0d5
AP_Compass: move logging of MAG message into AP_Compass
2026-05-26 22:30:45 +10:00
Brown
527d981d97
AP_Compass: add RM3100 probe option
...
Add a per-driver option for RM3100 internal bus probing.
This lets boards disable the generic RM3100 internal probe
without changing internal probing for other compass drivers.
2026-05-20 18:45:48 +10:00
Peter Barker
8a044f99a0
AP_Compass: ignore too-many-compasses-on-registration errors
...
panicing on something which can run in-flight is just dangerous.
2026-02-24 10:51:59 +11:00
Peter Barker
d3ddac74ea
AP_Compass: remove HAL_CHIBIOS_ARCH_MINDPXV2
...
MinxPX is the only board using it, and it specifies everything
2026-01-20 10:44:35 +11:00
Peter Barker
2d2cbf49dc
AP_Compass: remove HAL_CHIBIOS_ARCH_FMUV5+
2026-01-13 11:00:56 +11:00
Peter Barker
7e87c92e0c
AP_Compass: rename _have_i2c_driver to _i2c_sensor_is_registered
2026-01-03 10:10:16 +00:00
Peter Barker
096d240908
AP_Compass: move from add_backend to probe_i2c_device for MMC5XX3
2025-12-10 21:49:48 +11:00
Peter Barker
3e515f2a45
AP_Compass: use aliases to make new methods clearer
2025-12-10 21:49:48 +11:00
Peter Barker
5d15a960dc
AP_Compass: use parameters rather than constants in probe_ak09916_via_icm20948
2025-12-10 21:49:48 +11:00
Peter Barker
9534069dff
AP_Compass: add some helper functions for compass probing
...
... and stop leaking memory if the device isn't enabled
2025-12-10 21:49:48 +11:00
Peter Barker
4aa5b58de6
AP_Compass: all backends take a generic Device rather than an I2CDevice
2025-12-10 21:49:48 +11:00
Peter Barker
4ae0c0401c
AP_Compass: remove internal probing of MMC5XX3 compass
...
these should really only ever be in the hwdef if they are internal; we don't need generic probing of these!
2025-12-07 20:25:26 +11:00
jagadeeshdinesh
0ea41a4246
AP_Compass: add support for MMC5XX3 (MMC5983MA) external I2C compasses
2025-12-05 07:30:18 +11:00
Peter Barker
febcb3c1a8
AP_Compass: correct compilation for LIS2MDL/ADD_BACKEND PR crossover
2025-11-27 00:10:08 +11:00
Peter Barker
3b575e0559
AP_Compass: merge add_backend and _add_backend
...
folding these together makes us check the driver is enabled a little redundantly, but that's OK.
2025-11-26 20:44:21 +11:00
Peter Barker
fa4e31ff14
AP_Compass: make ADD_BACKEND a method not a macro
...
code generation isn't great, preparation for future cleanups
2025-11-26 20:44:21 +11:00
Peter Barker
461c1b7236
AP_Compass: remove CHECK_UNREG_LIMIT_RETURN from ADD_BACKEND, rename
...
new name is same as in AP_Baro. We probably want to have an elif for when we have filled up our compasses in the no-unregistered case
2025-11-26 20:44:21 +11:00
Andy Piper
a2949578ed
AP_Compass: support for LIS2MDL
2025-11-26 18:25:43 +11:00
bugobliterator
a6d03bb8a1
AP_Compass: fix issue with compass registration for more than 3 compasses
...
This fixes an issue where we would fail to register a dronecan compass
if its not already in the stored DEV_ID position that matches the detection order
This is fixed by ensuring that we try our best to register the compass in the stored DEV_ID position
that matches the priority order.
This in turn allows for over 3 dronecan compasses to appear and not cause incorrect
registration failures at boot.
2025-11-26 18:05:59 +11:00
bugobliterator
afdd95d34e
AP_Compass: use MAX_CONNECTED_MAGS for DroneCAN registration
...
this allows for more than 3 DroneCAN compasses to be on the bus.
2025-11-26 18:05:59 +11:00
Peter Barker
03e1f0180c
AP_Compass: tidy compass probing defines
...
- stop using #ifdef defines
- use current standard naming schemes
- remove the double-negatives
2025-11-05 19:35:27 +11:00
Peter Barker
944ef566ec
AP_Compass: rename HAL_PROBE_EXTERNAL_I2C_COMPASSES to AP_COMPASS_PROBING_ENABLED
...
... and force it to have a value, not just be defined
2025-10-27 18:24:18 -05:00
Peter Barker
a657744a2f
AP_Compass: rework SITL backend to be a single-instance
...
rather than this odd thing which acts as multiple backends
2025-10-08 13:23:49 +11:00
Peter Barker
9ea20dc132
AP_Compass: add a MSP probe method which can fail
...
currently registering an MSP backend can't fail, so if we fail to register (e.g. out of slots) then we can end up overwriting other's data.
Add a probe method which can return nullptr on failure
2025-09-30 15:10:09 +10:00
Peter Barker
39a4032f70
AP_Compass: add a probe method to AP_Compass_ExternalAHRS
...
this allows for the creation of the backend to fail gracefully
without this the backend will still have a value of 0, and will still get updated, overwriting the data for one of the registered compasses
2025-09-23 08:59:56 +09:00
Peter Barker
8189f7693e
AP_Compass: remove remaining vrbrain FMU architectures and PX4_BOARD_TYPEs
2025-06-25 18:17:19 +10:00
Peter Barker
17bd219c7f
AP_Compass: remove support for SP01 board
...
there's no automatic setting for this board, so it would have been selected by parameter only.
This was a development board pre-PCNC01 - it wasn't widely distributed.
If we want this back we can create a full-on board for it...
2025-06-24 10:38:58 +10:00
Peter Barker
162e2e0ff4
AP_Compass: remove PCNC1 board type
...
only used for one board, so inline everything required
2025-06-17 10:59:00 +10:00
Peter Barker
88d0bdb1bf
AP_Compass: move VRBrain-v54 sensors to hwdef
2025-06-11 17:22:55 +10:00
Peter Barker
9fe7f960b1
AP_Compass: remove dead sensor detect code
...
these boards specify their internal devices so don't cross these paths
2025-06-10 16:28:17 +10:00
muramura
012e727dfc
AP_Compass: Specify the names of the supported devices
2025-06-07 10:46:51 +10:00
Peter Barker
3b09612552
AP_Compass: remove unnueccesary HAL_BUILD_AP_PERIPH check
2025-05-13 18:48:05 +01:00
Peter Barker
6298f7dc58
AP_Compass: make compass LearnType enum-class and parameter AP_Enum
2025-01-29 19:21:59 +11:00
Peter Barker
9e4a180878
AP_Compass: remove vestiges of LearnType::LEARN_INTERNAL
...
57a3bc1397 changed the code from "internal" to "in-flight
It seems the old value of "1" was no longer valid
It also changed things to that the learning system saved the offsets.
2025-01-28 12:23:53 +11:00
Jacob Dahl
64bb0ad762
AP_Compass: add IIS2MDC driver
2025-01-15 19:10:16 +11:00
Dr.-Ing. Amilcar do Carmo Lucas
6a59d3adae
AP_Compass: Also mark Z axis as calibrations, just like the XY
2024-11-05 09:25:59 +09:00
muramura
0020cf5fe8
AP_Compass: Add existing devices
2024-09-22 10:11:50 +10:00
cuav-chen2
89a4571c58
AP_Compass: Add in BMM350 Driver
2024-09-21 10:08:36 +10:00
Peter Barker
42b8ee78cf
AP_Compass: remove use of AP_AHRS from most headers
...
don't need to know the details, just that it is a class
2024-09-03 10:35:54 +10:00
Peter Barker and muramura
fa4e90a3bb
AP_Compass: use GCS_SEND_TEXT rather than gcs().send_text
...
Co-authored-by: muramura <ma2maru@gmail.com >
2024-08-07 18:33:16 +10:00