Commit Graph

12836 Commits

Author SHA1 Message Date
Andrew Tridgell
0fb959a309 AP_RPM: make pwm_input driver start on demand 2016-11-11 15:49:53 +11:00
Andrew Tridgell
08f770125e AP_BoardConfig: moved optional sensor startup out of AP_BoardConfig 2016-11-11 15:49:53 +11:00
Andrew Tridgell
8d19808152 AP_InertialSensor: fixed missing checked register goto
thanks to Francisco for spotting
2016-11-11 08:08:56 +11:00
Andrew Tridgell
49856c37f2 AP_InertialSensor: reduce checked register count
thanks to Francisco for spotting this
2016-11-11 08:08:56 +11:00
Andrew Tridgell
4be8f05ad4 AP_InertialSensor: added register checking for LSM9DS0 2016-11-11 08:08:56 +11:00
Andrew Tridgell
77a83c091a AP_InertialSensor: added register checking for MPU6000/ICM20608 2016-11-11 08:08:56 +11:00
Andrew Tridgell
95a849f472 AP_InertialSensor: added register checking for MPU9250 2016-11-11 08:08:56 +11:00
Andrew Tridgell
3289e90134 AP_InertialSensor: added error count increments in drivers 2016-11-11 08:08:55 +11:00
Andrew Tridgell
bc614de4b3 AP_HAL: added checked registers interface
allow drivers to easily monitor and correct critical registers
2016-11-11 08:08:55 +11:00
Andrew Tridgell
4ebf3309f7 AP_InertialSensor: auto-handle invensense sensor changes
some boards swap out MPU6000 for MPU9250 or ICM20608
2016-11-11 08:08:55 +11:00
Andrew Tridgell
8e61b15384 HAL_PX4: added ICM20608_EXT SPI device 2016-11-11 08:08:55 +11:00
Andrew Tridgell
e4454c5056 AP_Compass: setup for new PX4 board IDs 2016-11-11 08:08:55 +11:00
Andrew Tridgell
41b132e576 AP_Baro: setup for new board PX4 IDs 2016-11-11 08:08:55 +11:00
Andrew Tridgell
4f50d67790 AP_BoardConfig: added board type auto-detection
using SPI probing
2016-11-11 08:08:55 +11:00
Andrew Tridgell
c565c9df35 AP_HAL: added ICM20608 external SPI name 2016-11-11 08:08:55 +11:00
Andrew Tridgell
af0ec41652 AP_InertialSensor: fixed accel clip detection with fast sampling
we need to check on every sample at the full rate
2016-11-10 13:39:17 +11:00
Andrew Tridgell
0eac781559 AP_Compass: don't run the AK8963 on the external MPU9250
this saves us one mag slot for another external mag, and leaves the
primary MPU9250 undisturbed by the mag traffic on the bus
2016-11-10 13:05:22 +11:00
Andrew Tridgell
70c27a85de AP_InertialSensor: on PH2 run the first MPU9250 at 8kHz 2016-11-10 13:04:15 +11:00
Andrew Tridgell
73122adb78 AP_BoardConfig: removed unused startup functions for Pixracer 2016-11-10 12:55:22 +11:00
Andrew Tridgell
3d5c57c5dc AP_Compass: fixed orientation of PH2 in-tree compass drivers 2016-11-10 11:44:52 +11:00
Andrew Tridgell
4ba00720aa AP_Compass: make init() private
not called from frontend
2016-11-10 11:44:52 +11:00
Andrew Tridgell
1ea4c6938c AP_InertialSensor: allow auxiliary bus with fast sampling 2016-11-10 11:44:52 +11:00
Andrew Tridgell
8da42b7a8b AP_InertialSensor: fixed temperature for fast sampling case 2016-11-10 11:44:52 +11:00
Andrew Tridgell
cb70bae167 AP_InertialSensor: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell
c68a6451cb AP_Compass: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell
d716bbedee AP_Baro: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell
e7a9de9b41 AP_BoardConfig: use in-tree drivers for PH2SLIM 2016-11-10 11:44:52 +11:00
Andrew Tridgell
fea7040aff AP_Baro: don't panic when we can't find MS5611
this makes booting a PH2 without its sensor hat on much easier
2016-11-10 11:44:51 +11:00
Andrew Tridgell
e27a76e460 AP_InertialSensor: fixed auxiliary bus with FIFO enabled
make sure fifo reset doesn't check I2C master enable
2016-11-10 11:44:51 +11:00
Andrew Tridgell
46785e8ecf AP_InertialSensor: improved method for FIFO integrity checking
check temperature every 255 samples against FIFO data
2016-11-10 11:44:51 +11:00
Andrew Tridgell
8a3f6a8902 AP_InertialSensor: use FIFO and implement fast sampling for MPU9250 2016-11-10 11:44:51 +11:00
Andrew Tridgell
f94e4b4375 Filter: allow 1P LowPassFilter to work without alpha recalc per sample
this makes the 1P filter optionally syntax compatible with the 2P
filter and much more CPU efficient.
2016-11-10 11:43:29 +11:00
murata
f9add59b58 Global: Aggregate the same definitions.
Global: Aggregate the same definitions.
2016-11-09 11:46:55 -03:00
Lucas De Marchi
c1647b13eb AP_HAL_Linux: fix leaking strings 2016-11-09 11:44:05 -03:00
Andrew Tridgell
e25a391a8f AP_InertialSensor: fixed typo 2016-11-09 17:08:15 +11:00
Andrew Tridgell
d2f6a514b9 AP_InertialSensor: catch FIFO alignment errors using temperature reading
Two cases of what seems to be FIFO alignment errors have been seen on
a Pixracer-beta board with a ICM-20608. At a cost of 2 extra bytes per
transfer we can catch these by looking for sudden temperature changes
caused by bad data in the temperature registers.
2016-11-09 17:08:15 +11:00
Andrew Tridgell
4602b4d679 AP_Compass: improve init and calibration of hmc5843 2016-11-09 17:08:15 +11:00
Andrew Tridgell
d248b33104 AP_InertialSensor: simplify config of MPU6000
use zero sample rate divider on both MPU6000 and ICM20608
2016-11-09 17:08:14 +11:00
Andrew Tridgell
7137d5c6f2 AP_InertialSensor: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell
3d48a72f59 AP_C0mpass: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell
b8c789cf35 AP_Baro: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell
b0b93f8928 AP_BoardConfig: switch pixracer to always use in-tree drivers 2016-11-09 17:08:14 +11:00
Andrew Tridgell
84c3e29891 AP_InertialSensor: use AP_HAL rotations for MPU6000 2016-11-09 17:08:14 +11:00
Andrew Tridgell
fd8955a737 AP_HAL: define default rotations for mpu6000 based boards 2016-11-09 17:08:14 +11:00
Andrew Tridgell
2f01dfe81c AP_InertialSensor: fixed from review by Lucas 2016-11-09 17:08:13 +11:00
Andrew Tridgell
81b933d9d0 AP_InertialSensor: use int32_t summation for fast sampling
very slightly faster
2016-11-09 17:08:13 +11:00
Andrew Tridgell
b00fd95725 AP_Math: define Vector3l for += op 2016-11-09 17:08:13 +11:00
Andrew Tridgell
565f1986e0 AP_Baro: fixed FMUv1 baro and enable in-tree driver for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell
fcf0a4ea59 AP_BoardConfig: use in-tree drivers for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell
b363a65c2e AP_Compass: enable in-tree drivers for PHMINI 2016-11-09 17:08:13 +11:00
Andrew Tridgell
03b7bc9e65 AP_InertialSensor: use internal drivers for PHMINI
this gets us fast sampling
2016-11-09 17:08:12 +11:00
Andrew Tridgell
af1c5fd6d3 AP_InertialSensor: always use FIFO on MPU6000
and enable fast sampling on ICM20608 if on SPI
2016-11-09 17:08:12 +11:00
Andrew Tridgell
96e42696b7 HAL_PX4: added icm20608-am SPI device 2016-11-09 17:08:12 +11:00
Andrew Tridgell
d778ee2db0 AP_HAL: define device for icm20608 on ACCEL_MAG CS line on px4
for PHMINI
2016-11-09 17:08:12 +11:00
Andrew Tridgell
b34ab2956b HAL_PX4: added access to external SPI connector on FMUv2 2016-11-09 17:08:12 +11:00
Andrew Tridgell
fde80a9408 AP_InertialSensor: modify LSM303D settings to match PX4 driver
this allows existing accel calibration to be used
2016-11-09 17:08:12 +11:00
Andrew Tridgell
875fa60452 AP_Compass: fixed external I2C HMC5983 rotation on pixhawk 2016-11-09 17:08:11 +11:00
Andrew Tridgell
01fadb6e90 HAL_PX4: added per-device perf counter for I2C devices 2016-11-09 17:08:11 +11:00
Andrew Tridgell
a9a5e50bd1 AP_InertialSensor: removed timer callback for MPU6000
Thanks to Lucas for pointing out this is not needed
2016-11-09 17:08:11 +11:00
Andrew Tridgell
42f242a07b HAL_PX4: fixed build on PX4-v1 2016-11-09 17:08:11 +11:00
Andrew Tridgell
bd8867be38 AP_Compass: cope with NULL dev pointer in driver probe functions 2016-11-09 17:08:11 +11:00
Andrew Tridgell
ba9b475782 AP_HAL: added MS5611 on I2C for px4-v1 2016-11-09 17:08:11 +11:00
Andrew Tridgell
4cf6dd1818 HAL_Linux: removed panic on bad SPI device 2016-11-09 17:08:11 +11:00
Andrew Tridgell
20cd165476 HAL_PX4: allow for missing SPIDevice table entries
removed panic
2016-11-09 17:08:10 +11:00
Andrew Tridgell
bd84e592f8 AP_InertialSensor: check for NULL device pointer in probe()
handle missing devices
2016-11-09 17:08:10 +11:00
Andrew Tridgell
3b53caad87 AP_Compass: keep old hmc5843 ID
prevent re-use. thanks to Lucas
2016-11-09 17:08:10 +11:00
Andrew Tridgell
02c2ba1331 AP_Compass: fixed dup semaphore bug
thanks to Lucas for spotting this!
2016-11-09 17:08:10 +11:00
Andrew Tridgell
f31a017ace AP_Compass: changes to HMC5843 driver
this makes the HMC5843 use single-shot mode, which makes it more
robust to bus resets. It also adds WHOAMI checking and enables
automatic temperature compensation.

Unfortunately this makes existing calibration values incompatible, so
a re-cal is required. The device ID has been changed to reflect the
driver change.
2016-11-09 17:08:10 +11:00
Andrew Tridgell
f62851f780 GCS_MAVLink: added remote device operations
this makes debugging devices much easier. You can even write a
primitive SPI or I2C device driver over mavlink.

Support for this is in the devop MAVProxy module
2016-11-09 17:08:10 +11:00
Andrew Tridgell
922d5a74f7 HAL_PX4: print msg when I2C device is closed 2016-11-09 17:08:09 +11:00
Andrew Tridgell
da7ed73051 GCS_MAVLlink: added handle_common_message()
this will make it easier to add common functions for mavlink messages
without having to do a commit for each vehicle
2016-11-09 17:08:09 +11:00
Andrew Tridgell
e5a4dd4e56 HAL_PX4: added perf counter on SPI devices 2016-11-09 17:08:09 +11:00
Andrew Tridgell
8bca8545a2 HAL_PX4: removed unused devname field in SPIDevice 2016-11-09 17:08:08 +11:00
Andrew Tridgell
05769640d1 AP_Compass: support rotations on AK8963 2016-11-09 17:08:08 +11:00
Andrew Tridgell
2716ab8408 AP_Compass: added support for per-instance rotations 2016-11-09 17:08:08 +11:00
Andrew Tridgell
fac895b0e6 AP_Compass: setup read flag for SPI transfers 2016-11-09 17:08:08 +11:00
Andrew Tridgell
18df213069 HAL_PX4: fixed initial SPI bus speed and report new SPI instances 2016-11-09 17:08:08 +11:00
Andrew Tridgell
3d7d773883 AP_InertialSensor: added support for ICM20608 on Pixracer 2016-11-09 17:08:08 +11:00
Andrew Tridgell
4dc5dc87b5 HAL_PX4: added ICM20608 to SPI table 2016-11-09 17:08:08 +11:00
Andrew Tridgell
ea74f8c12c AP_HAL: added ICM20608 INS name 2016-11-09 17:08:07 +11:00
Andrew Tridgell
2c1e9024f1 AP_InertialSensor: detect missing accels or gyros 2016-11-09 17:08:07 +11:00
Andrew Tridgell
106a91c64c AP_InertialSensor: use init_gyro() on startup
this saves the calibration parameters which should be done on
calibration
2016-11-09 17:08:07 +11:00
Andrew Tridgell
408593465f AP_InertialSensor: fixed rotation for mpu9250 on pixracer 2016-11-09 17:08:07 +11:00
Andrew Tridgell
790dd4769b AP_InertialSensor: simplify rotations for MPU9250 2016-11-09 17:08:07 +11:00
Andrew Tridgell
38a1f51b53 AP_HAL: define rotations for the MPU9250 in board/linux.h 2016-11-09 17:08:07 +11:00
Andrew Tridgell
147b253e65 AP_Compass: make device IDs match PX4 drivers
match in-tree drivers to PX4Firmware drivers
2016-11-09 17:08:06 +11:00
Andrew Tridgell
aa4025bdf9 AP_InertialSensor: make INS sensor IDs match for PX4
in-tree driver IDs now match PX4Firmware driver IDs on Pixhawk2
2016-11-09 17:08:06 +11:00
Andrew Tridgell
76b2759317 AP_OpticalFlow: fixed shadowed variable build warning 2016-11-09 17:08:06 +11:00
Andrew Tridgell
9e7e1b2f01 AP_InertialSensor: fixed merge conflicts with patches from Lucas 2016-11-09 17:08:06 +11:00
Andrew Tridgell
1990aa96e1 AP_HAL: added get_bus_id_devtype()
used to do versioning on device types
2016-11-09 17:08:06 +11:00
Lucas De Marchi
104e29acf2 AP_InertialSensor: MPU6000: change accel scale to 16G
Also change the ID of MPU6000 so previous calibration values are not
considered valid.
2016-11-09 17:08:06 +11:00
Lucas De Marchi
dc09661b9e AP_InertialSensor: MPU6000: save driver version
When registering accel and gyro we use the upper 16bits of the id to
store the driver version. When changing the driver behavior in
non-compatible ways, changing this version will trigger a request for
calibration.
2016-11-09 17:08:06 +11:00
Lucas De Marchi
0d3adef8b2 AP_InertialSensor: MPU6000: remove TODO leftover
This will never be done as blindly changing speed is not the way to fix
communication issues.
2016-11-09 17:08:05 +11:00
Andrew Tridgell
0a1616cc71 AP_InertialSensor: use correct device IDs on PX4 driver 2016-11-09 17:08:05 +11:00
Lucas De Marchi
469efb00f6 AP_InertialSensor: save id for gyro and accel instances
This allows each sensor to be uniquely identified in the system by using
either the index inside the backend or for those that use the Device
interface, to use the bus type, location, and device id.

We leave 16-bit for each sensor to be able to change its own
identification in future, which allows them to be changed in an
incompatible manner forcing a re-calibration.
2016-11-09 17:08:05 +11:00
Lucas De Marchi
bbb9bfa95e AP_InertialSensor: save only gyro calibration
When we are initializing the gyro and then saving the calibration we are
also saving the calibration values for the accelerometers. Right now
this is non-problematic, but we want to check that the ID of the
accelerometer corresponds to the ID of the sensor detected. If we also
save accel calibrations we would actually override the ID of the
accelerometer.

Rename the method to _save_gyro_calibration() and save only on gyro
values.
2016-11-09 17:08:05 +11:00
Lucas De Marchi
f81dba2100 AP_InertialSensor: add doc to get_id() of backend
This is different from get_id() of Device and ultimately from each
sensor this this is identifying the backend, not the sensor.
2016-11-09 17:08:05 +11:00
Lucas De Marchi
6b88f3367b AP_Common: remove AP_PRODUCT_ID_* macros
These are not used anymore.
2016-11-09 17:08:05 +11:00
Lucas De Marchi
ace61087a1 AP_InertialSensor: remove product_id
We only leave the parameter there for backward-compatibility. However
product id on the inertial sensor is not much useful since it's only
kept for the first instance.

A better implementation per-gyro and per-accel is needed in order to
avoid problems with sensors taking the offsets configured for another
sensor.
2016-11-09 17:08:05 +11:00
Andrew Tridgell
a6ac02b61f HAL_Linux: implement device IDs for I2C and SPI 2016-11-09 17:08:04 +11:00