Commit Graph

24744 Commits

Author SHA1 Message Date
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
Andrew Tridgell de7913e8e9 AP_Compass: implement device IDs for compass drivers 2016-11-09 17:08:04 +11:00
Andrew Tridgell 64a5d3938c AP_InertialSensor: implement device IDs for MPU6000 and MPU9250 AuxilaryBus 2016-11-09 17:08:04 +11:00
Andrew Tridgell ac2c25539b AP_InertialSensor: implement device IDs for AuxilaryBus 2016-11-09 17:08:04 +11:00
Andrew Tridgell 16489d2a13 HAL_PX4: implement device IDs for I2C and SPI 2016-11-09 17:08:04 +11:00
Andrew Tridgell 3d48b6bb3a AP_HAL: added device id tuples to Device class
this allows a bus connection and device type tuple to be identifed as
a 24 bit number for use in user visible device IDs. Every bus
connection has a unique device ID.
2016-11-09 17:08:04 +11:00
Andrew Tridgell 4ef92b5e39 AP_InertialSensor: enable all 3 IMUs on PH2 2016-11-09 17:08:04 +11:00
Andrew Tridgell e08babb7df HAL_PX4: added new SPI devices for PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 26ca2dd392 AP_HAL: added more px4 SPI device names 2016-11-09 17:08:03 +11:00
Andrew Tridgell ac0ea12b42 AP_Compass: enable HMC5843 on SPI for PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 88e24dd8bd AP_BoardConfig: added board type 103
for PH2 in-tree drivers
2016-11-09 17:08:03 +11:00
Andrew Tridgell 66026100c3 AP_Baro: enable dual baro on PH2 2016-11-09 17:08:03 +11:00
Andrew Tridgell 4df9b093c3 AP_Baro: fixed missed samples in ms5611 driver 2016-11-09 17:08:03 +11:00
Andrew Tridgell 7c36e14524 AP_ADC: fixed thread usage in AP_ADC_ADS1115 2016-11-09 17:08:03 +11:00
Andrew Tridgell dbd192971f AP_Notify: fixed threading on toshibaled i2c 2016-11-09 17:08:02 +11:00
Andrew Tridgell a9cb03ad74 AP_Notify: fixed threading in two notify backends 2016-11-09 17:08:02 +11:00
Andrew Tridgell 6e2fbf1988 AP_OpticalFlow: fixed threading in opticalflow for linux 2016-11-09 17:08:02 +11:00
Andrew Tridgell 5cf768ced2 AP_InertialSensor: fixed missing return 2016-11-09 17:08:02 +11:00
Andrew Tridgell 4f231f9355 AP_BattMonitor: fixed thread usage for SMBus_I2C 2016-11-09 17:08:02 +11:00
Andrew Tridgell e88519364f AP_RangeFinder: fixed maxbotix I2C semaphore and bus usage 2016-11-09 17:08:02 +11:00
Andrew Tridgell bedee31f61 AP_Baro: fixed semaphore and thread usage in baro drivers 2016-11-09 17:08:02 +11:00
Andrew Tridgell 38ff8b3536 AP_InertialSensor: removed unused product_id function in L3G4200D 2016-11-09 17:08:01 +11:00
Andrew Tridgell 1c631ea037 AP_Compass: cleanup use of backend semaphores
fixed drivers that didn't protect accumulation counters
2016-11-09 17:08:01 +11:00
Andrew Tridgell 9afd51350e AP_Compass: use thread per bus in more drivers
and removed use of timer suspend
2016-11-09 17:08:01 +11:00
Andrew Tridgell 974827aa82 AP_Compass: enabled AK8963 on PX4 2016-11-09 17:08:01 +11:00