Commit Graph

733 Commits

Author SHA1 Message Date
Andrew Tridgell 84d7160128 AP_Compass: use new accumulate functions for UAVCAN 2018-10-19 16:03:45 +11:00
Andrew Tridgell 579a84b53e AP_Compass: use new accumulate functions for AK8963 2018-10-19 16:03:45 +11:00
Andrew Tridgell 55e4b64755 AP_Compass: don't apply offsets twice in SITL 2018-10-19 16:03:45 +11:00
Andrew Tridgell 925555c995 AP_Compass: move accum fields to frontend
this is needed to ensure they are per-instance. Without this the SITL
backend produces zero for all but the first instance. The same would
be true for any multi-instance backend
2018-10-17 12:54:22 +11:00
Andrew Tridgell 83065d5e88 AP_Compass: convert SITL to new accumulate approach 2018-10-17 12:54:22 +11:00
Andrew Tridgell a260792e9e AP_Compass: use WITH_SEMAPHORE()
and removed usage of hal.util->new_semaphore()
2018-10-17 12:54:22 +11:00
vierfuffzig b455c7a769 AP_Compass: add rotation option for AK8963_MPU9250
allows using non-neutrally rotated AK8963 compass on MPU9250 as internal
reference: https://github.com/ArduPilot/ardupilot/pull/9459
2018-10-17 09:35:49 +11:00
Andrew Tridgell 0b9d0a4559 AP_Compass: removed incorrect semaphore take() in QMC5883L driver 2018-10-16 10:47:26 -07:00
Lucas De Marchi 1a9c386df2 AP_Compass: MMC3416: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi e83b345cbb AP_Compass: MAG3110: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi ac2771b311 AP_Compass: LSM9DS1: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi 2324a28e39 AP_Compass: LSM303D: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi 38d1f8705f AP_Compass: LIS3MDL: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi b05b3b9932 AP_Compass: IST8310: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi 8d54276263 AP_Compass: BMM150: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi 565df5ec94 AP_Compass: AK09916: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi e769c6932f AP_Compass: QMC5883L: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi c0bccdaed6 AP_Compass: HMC5843: use common method to accumulate samples 2018-10-15 14:41:09 -07:00
Lucas De Marchi 329516373c AP_Compass: add common method to accumulate and drain samples
Instead of repeating on each driver the same sequence of steps,
let's move them to the common parent class. This only implements
it, but no driver was ported yet.
2018-10-15 14:41:09 -07:00
Andrew Tridgell 2f2be6afda AP_Compass: use rotation_equal() from AP_Compass 2018-10-01 14:26:56 +09:00
Andrew Tridgell 803f255c73 AP_Compass: fixed handling of duplication rotations
we have some rotations that are duplicated, such as ROLL_180_YAW_90
and PITCH_180_YAW_270. This copes with those in the auto-orientation
code
2018-10-01 14:26:56 +09:00
Lucas De Marchi 93d99dacd1 AP_Compass: UAVCAN: remove additional semaphore
We already inherit from AP_Compass_Backend, so use the semaphore from
there to synchronize with the main thread, like the other backends.
2018-09-06 08:23:02 +10:00
Lucas De Marchi cd9b08dbae AP_Compass: rename variable for more buses
"all_external" reflects better the fact that we can have more than 2
buses (and now we are using the foreach macro).
2018-09-06 08:23:02 +10:00
Lucas De Marchi de535dc573 AP_Compass: remove unused external and name arguments
Aka "fix copy and pasta".
2018-09-06 08:23:02 +10:00
Lucas De Marchi 4039b51810 AP_Compass: stop passing frontend pointer
Let AP_Compass_Backend call AP::compass() *once* instead of passing
the frontend pointer over and over.
2018-09-06 08:23:02 +10:00
Lucas De Marchi 585b6dce0d AP_Compass: support more external compasses on aerofc
Let it probe on external bus. Aerofc has an HMC5883 on internal bus, but
we don't want it enabled as it interferes with the internal baro. Also
the rotation for the compass that comes with Aero RTF is different from
the other that got added later. That means people would need to orient a
third party IST8310-based compass differently on Aero RTF than on other
boards... that's a problem of having orientation based on the chip that
can't be solved on this commit.
2018-09-06 08:23:02 +10:00
liang.tang 2c0b9a16a5 AP_Compass: fix UAVCAN mag message handlers 2018-09-05 17:22:34 +10:00
Siddharth Purohit 14b701cff8 AP_Compass: move UAVCAN mag subscribers and handlers to Compass Backend 2018-08-29 22:54:59 +01:00
Francisco Ferreira 317e8e0296
AP_Compass: adapt to changes in AP_BoardConfig_CAN 2018-08-12 13:35:03 +01:00
Andrew Tridgell 3ed7c060df AP_Compass: address review comments 2018-08-07 10:00:10 +10:00
Jonathan Challinger cefd998177 AP_Compass: add expected DEV_ID parameters 2018-08-07 10:00:10 +10:00
Jonathan Challinger 878e84a015 AP_Compass: correct edge case where checks pass when saved dev_id != detected dev_id 2018-08-07 10:00:10 +10:00
Randy Mackay c88926f227 Compass: remove accumulate from example sketch 2018-08-06 11:05:34 +10:00
Randy Mackay 99b54935db Compass: remove accumulate
this method is a noop on all backends
2018-08-06 11:05:34 +10:00
Andrew Tridgell 2ded88e611 AP_Compass: allow override of QMC5883L orientation 2018-07-30 17:26:19 +10:00
Randy Mackay cb3731e08e Compass: fix compile warning in calibrator output 2018-07-30 14:57:01 +10:00
Andrew Tridgell e39d070b78 AP_Compass: clear DEV_ID for undetected compasses
this prevents user confusion with the number of compasses detected
2018-07-30 13:07:55 +10:00
Andrew Tridgell b181340fd9 AP_Compass: allow override of COMPASS_AUTO_ROT 2018-07-28 18:05:12 +10:00
Andrew Tridgell cbd6f4cc21 AP_Compass: fixed compass for tailsitters in SITL 2018-07-20 14:21:06 +10:00
Andrew Tridgell 027beb0dc1 AP_Compass: rename COMPASS_ROT_AUTO to COMPASS_AUTO_ROT
request from Randy
2018-07-18 16:07:19 +10:00
Andrew Tridgell 15d2daabf0 AP_Compass: don't do auto-orientation if using ROTATION_CUSTOM 2018-07-18 16:07:19 +10:00
Andrew Tridgell a73492b40a AP_Compass: fixed newline in statustext 2018-07-18 16:07:19 +10:00
Andrew Tridgell 196ba0e858 AP_Compass: make COMPASS_ROT_AUTO take 3 values
0 for disabled, 1 for check only, 2 for check and fix
2018-07-18 16:07:19 +10:00
Andrew Tridgell d15a4ad92a AP_Compass: improved error reporting, check all compasses
this uses extensions to the MAG_CAL_REPORT message to convey failures
of orientation checking.

It also checks all compasses, external or internal. It only tries to
fix the orientation if it is external
2018-07-18 16:07:19 +10:00
Andrew Tridgell a5749c1869 AP_Compass: allow diagonals and off-diagonals to be calculated on rot change
this re-runs the fit on change in orientation
2018-07-18 16:07:19 +10:00
Andrew Tridgell b4c7d1925e AP_Compass: allow for runtime changes to SIM_MAG_DIA_?
this makes for easier testing
2018-07-18 16:07:19 +10:00
Andrew Tridgell 3c2e8baee2 AP_Compass: improved orientation reporting
and fail magcal if we fail orientation detection for an external
compass
2018-07-18 16:07:19 +10:00
Andrew Tridgell 8b0f40b402 AP_Compass: implement automatic compass orientation
this automatically determines the compass orientation when doing a 3D
compass calibration, if COMPASS_ROT_AUTO is enabled.
2018-07-18 16:07:19 +10:00
Andrew Tridgell 4acc06df87 AP_Compass: support diagonal, off-diagonal and rotation in SITL
compass
2018-07-18 16:07:19 +10:00
Andrew Tridgell 3c0ed01fd0 AP_Compass: prevent use of null dev_icm device in ICM20948 driver 2018-07-14 17:51:50 +10:00