Commit Graph

1244 Commits

Author SHA1 Message Date
Peter Barker b5cd3370eb AP_InertialSensor: add missing include for AHRS
we use a method from this library
2024-09-06 08:52:01 +10:00
Peter Barker a0c57291d7 AP_InertialSensor: correct compilation when logging disabled 2024-09-02 11:53:12 +10:00
Andy Piper 98f3a4b7d5 AP_InertialSensor: allow backend filters to be updated independently from a separate thread 2024-08-23 18:34:28 +10:00
Iampete1 89297737ea AP_InertialSensor: move to new constant dt low pass filter class 2024-08-20 09:09:41 +10:00
Peter Barker f389549d5d AP_InertialSensor: correct warnings on static_assert requiring a message 2024-08-13 08:38:00 +10:00
James O'Shannessy 66817e207f AP_InertialSensor: Check the gyro/accel id has not been previously registered
If the Gyro/Accel ID is already in the registered list, do not try to add it again.

This stops an issue seen on a CubeOrangePlus BG3 where, during the very first boot after a parameter wipe, software incorrectly registers a fourth IMU.
The Fourth IMU is registered because the AUX IMU is the same DevID as the third ICM45686.
2024-07-25 09:49:35 +10:00
James O'Shannessy c771440ea4 AP_InertialSensor: Fix persistent storing of IMU Z Scale
Fixes INSn_ACCSCAL_Z not being stored in persistent storage when bootloader is flashed.
2024-07-23 11:59:49 +10:00
Peter Barker ef0de65347 AP_InertialSensor: tidy IMU killing 2024-07-10 18:17:00 +10:00
muramura e48044dc45 AP_InertialSensor: Clearly state the maximum G-force 2024-07-10 10:07:16 +10:00
Andy Piper a86f4fdc8f AP_InertialSensor: move gyro and accel instance ids into AP_InertialSensor_Backend 2024-06-26 17:14:56 +10:00
Peter Barker 8ddac54b17 AP_InertialSensor: rename ins get_primary_accel to get_first_usable_accel 2024-06-26 17:12:12 +10:00
Andrew Tridgell e9d39d80f4 AP_InertialSensor: fixed ICM42670
highres sampling is not working on the ICM42670 on some versions of
the Pixhawk6X. Disable for now.
2024-06-07 19:44:48 +10:00
Andrew Tridgell e97a6c7089 AP_InertialSensor: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Andrew Tridgell a0acccb1f9 AP_InertialSensor: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Andy Piper f78eb58fb4 AP_InertialSensor: ensure that notches get updated while converging 2024-05-03 07:34:21 +10:00
Andy Piper 30877cf11f AP_InertialSensor: allow FIFO rate logging for hires sampling 2024-05-02 11:01:20 +10:00
James O'Shannessy 9dbc61f85b AP_InertialSensor: Fix parameter name when saving persistent accel cals for Aux IMUs
Without this change, you get:
* IMU_ACCOFFS_*
* IMU_ACC2OFFS_*
* IMU_ACC3OFFS_*
* IMU3_ACCOFFS_*

After this change, you get:
* IMU_ACCOFFS_*
* IMU_ACC2OFFS_*
* IMU_ACC3OFFS_*
* IMU4_ACCOFFS_*
2024-04-05 11:02:04 +11:00
James O'Shannessy ac271cf4e0 AP_InertialSensor: Improve bitmask indicating persistent parameters on bootloader flash
INS_TCAL_OPTIONS parameter description indicates a singular bit in a bitmask to persist Accels/TCAL parameters, however there are two separate bits for persistence.
2024-03-26 11:39:11 +11:00
Peter Barker 6de3cce480 AP_InertialSensor: allow HarmonicNotches to be compiled out of the code 2024-03-19 07:04:13 +11:00
Andrew Tridgell 7353001646 AP_InertialSensor: adjust logging descriptions 2024-03-16 06:54:27 +11:00
Andrew Tridgell d7d854a60f AP_InertialSensor: call logging function for notch centers and harmonics 2024-03-16 06:54:27 +11:00
Andrew Tridgell 88fb38b524 AP_InertialSensor: added comments 2024-03-16 06:54:27 +11:00
Andrew Tridgell 25ffcc1580 AP_InertialSensor: use num_composite_notches()
this prevents duplication of the logic for the priority of the double
notch vs the triple notch option
2024-03-16 06:54:27 +11:00
Andrew Tridgell 08ccead215 AP_InertialSensor: fixed num_filters to be uint16_t
max is more than 256
2024-03-16 06:54:27 +11:00
Andrew Tridgell de8bec596e AP_InertialSensor: removed zero checks and clamping on notch filters
and pass params object down into HarmonicNotchFilter
2024-03-16 06:54:27 +11:00
Patrick José Pereira 5b1cac268b INS_generic: Use new default for reboot
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2024-03-12 21:13:41 +11:00
Andrew Tridgell 66ff84e6fb AP_InertialSensor: fixed wait_for_sample() in examples 2024-02-28 19:22:14 +11:00
Andrew Tridgell 280bc3a285 AP_InertialSensor: fixed accel cal simple to remove unused IMUs
when we change EAHRS_SENSORS to remove use of IMU from an external
AHRS we need to be able to zero the accel and gyro offsets to get
prearms to pass
2024-02-27 21:10:20 +11:00
Peter Barker 477fa3e161 AP_InertialSensor: move logger object up to AP_Vehicle 2024-02-13 10:54:29 +11:00
Hayden Donald fdf56c2ec4 AP_InertialSensor: Move accel/gyro_consistent to AP_IntertialSensor
Move the accel_consistent and gyro_consistent methods from AP_Arming to AP_IntertialSensor
2024-02-09 18:54:43 +11:00
Peter Barker 6a897f01d8 AP_InertialSensor: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Peter Barker 1051da5cb4 AP_InertialSensor: correct compilation when AP_AHRS_ENABLED is off
e.g. CubeOrange-periph-heavy
2024-01-16 16:14:04 +11:00
Peter Barker a81b229997 AP_InertialSensor: make AHRS attitude member variables private 2024-01-14 12:47:47 +11:00
Andrew Tridgell 9c8fa7f58c AP_InertialSensor: fixed build of NONE backend
conflict with rand_float()
2024-01-07 20:51:55 +11:00
muramura 4765ba8218 AP_InertialSensor: Specify the number of arrays by sizeof 2024-01-04 10:24:44 +11:00
Peter Barker 68d8a2606d AP_InertialSensor: SITL: call logging singleton methods only if available 2024-01-03 18:33:41 +11:00
Andrew Tridgell da7c556f77 AP_InertialSensor: avoid fcntl.h
allows mixing of lwip and sockets
2024-01-03 12:14:47 +11:00
Andrew Tridgell aba5ec6854 AP_InertialSensor: added support for writing raw IMU data to a UART
this is for supporting external visual odomotry systems which need the
IMU data to correctly process image data

# Conflicts:
#	libraries/AP_InertialSensor/AP_InertialSensor.cpp
2023-11-30 07:05:02 +11:00
Iampete1 eb4e3fc36a AP_InertialSensor: init all notch center frequencies 2023-11-28 18:05:37 +11:00
Andrew Tridgell 483d19f44c AP_InertialSensor: apply stuck gyro fix to all IxM42xxx sensors
TDK has confirmed this applies to all IxM42xxx sensors
2023-10-29 08:24:04 +11:00
Andy Piper 7ca2a4da56 AP_InertialSensor: remove ICM42xxx defaults 2023-10-25 19:23:11 +11:00
Andrew Tridgell 2688848cd1 AP_InertialSensor: fixed orientation of batch sampled data
we need to rotate the data so that FFT displays match the configured
orientation
2023-10-25 19:23:11 +11:00
Andrew Tridgell 0ebf9e7af5 AP_InertialSensor: pre-fetch instances for use in filter setup
we use the instance numbers during filter configuration to check if
fast sampling is enabled. We need to ensure these instance numbers
have been setup before the filtering functions get called
2023-10-25 19:23:11 +11:00
Andy Piper a9e0bf070c AP_InertialSensor: ensure indirect registers are not modified with sensors active on ICM-42688 2023-10-25 19:23:11 +11:00
Andy Piper da0b1402d3 AP_InertialSensor: add high-resolution reads for ICM45686
enable high-resolution support on all ICM4xxxx sensors
create INS_HIRES_SAMPLE mask
adjust high-resolution sampling for correct byte ordering and depth
correct high resolution scaling on 18bit ICM4xxxx IMUs
control highres via HAL_INS_HIGHRES_SAMPLE
2023-10-25 19:23:11 +11:00
Andrew Tridgell b6c9ac2569 AP_InertialSensor: added optional FIFO rate logging to invensensev3 driver
this is useful for tracking down and confirming the stuck gyro issue
on the ICM42688
2023-10-22 15:09:40 +11:00
Andrew Tridgell 792d8a4cb8 AP_InertialSensor: fix for ICM42688 stuck gyro issue
these undocumented bits in register 0x4d control the "adaptive full
scale range" mode of the ICM42688. The feature is enabled by default
but has a bug where it gives "stuck" gyro values for short periods
(between 1ms and 2ms):, leading to a significant gyro bias at longer
time scales, enough to in some cases cause a vehicle to crash if it is
unable to switch to an alternative IMU

this fixes https://github.com/ArduPilot/ardupilot/issues/25025
2023-10-22 15:09:40 +11:00
Iampete1 e35a459090 AP_InertialSensor: call init for harmonic notch params 2023-10-10 08:07:16 +09:00
Andrew Tridgell 6e26f088bf AP_InertialSensor: fixed the error value for BMI088
the bad value is -32768 not 0xffff (which is -1)

-32768 badly corrupts the low-pass filter, and is what we see in logs
(a large negative spike on all 3 axes)

update to bug fix from:
https://github.com/ArduPilot/ardupilot/pull/23033
2023-10-08 10:52:27 +11:00
Iampete1 3429276224 AP_InertialSensor: add INS_RAW_LOG_OPT to allow raw logging of post, and pre+post on primary or all gyros 2023-10-03 10:24:58 +11:00