Commit Graph

11864 Commits

Author SHA1 Message Date
Luiz Ywata
7fb5db8077 AP_HAL_Linux: RCOutput_Bebop: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi
a34a5c1aa3 AP_Notify: Display_SSD1306_I2C: Fix after conversion to I2CDevice
- Initialize device on hw_init() method, allowing it not to be
      present
    - Add missing lock
    - Add packed attribute to structs
    - Move defines to source file
2016-07-14 17:32:33 -03:00
Luiz Ywata
f26692de92 AP_Notify: Display_SSD1306_I2C: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi
213c38afaf AP_Notify: ToshibaLED_I2C: add part number comment
It's easier to find the datasheet for this driver with the part number
rather than a generic "toshiba led".
2016-07-14 17:32:33 -03:00
Lucas De Marchi
5618008935 AP_Notify: ToshibaLED_I2C: Fix driver after I2CDevice conversion
- Add missing semaphore take on bus
    - Initialize device on init function rather than constructor: the
      constructor may run before I2CDeviceManager is initialized since our
      AP_Notify objects are static so it can't be used.
2016-07-14 17:32:33 -03:00
Luiz Ywata
0b69e43464 AP_Notify: ToshibaLED_I2C: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
e5d519edec AP_ADC: AP_ADC_ADS1115: release bus lock as soon as possible 2016-07-14 17:32:32 -03:00
Lucas De Marchi
85c0c98194 AP_ADC: ADS1115: fix driver after conversion to I2CDevice
In _start_conversion(), the check for return code of _dev->transfer() was
inverted. The structure also needs to be PACKED, otherwise there will be
a hole in the middle.  Fix these issues and use be16_t where it makes
sense.

In read() we need to check for the second byte of config register, so
either make it an array of uint8_t or convert from big endian to host
endianness.  It's simpler to leave it as it was, accessing just the
first byte. Also the conversion value is in be16 type an needs to be
converted to host endiannes, not the opposite.

Fix bus number: all boards that use it expect it to be on bus 1, not 0.
2016-07-14 17:32:32 -03:00
Luiz Ywata
038389f583 AP_ADC_ADS1115: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
de5025a46f AP_Airspeed: I2C: fix after conversion to I2CDevice
- Allow to fail init
2016-07-14 17:32:32 -03:00
Luiz Ywata
6c87b2aa7c AP_Airspeed: AP_Airspeed_I2C: use I2CDevice interface 2016-07-14 17:32:32 -03:00
Lucas De Marchi
5ef1568137 AP_HAL_Empty: fix sitl
Sitl or anyone using AP_HAL_Empty implementation doesn't have any
I2CDevice, so it's pointless to return an empty one.
2016-07-14 17:32:32 -03:00
Andrew Tridgell
7d48b25207 AP_Module: use ifdef in function, not caller
suggestion by Lucas
2016-07-14 13:39:48 +10:00
Andrew Tridgell
eee9fc88a1 AP_InertialSensor: avoid ifdef for AP_MODULE_SUPPORTED 2016-07-14 13:39:47 +10:00
Andrew Tridgell
e82468a529 AP_AHRS: avoid ifdef for AP_MODULE_SUPPORTED 2016-07-14 13:39:47 +10:00
Andrew Tridgell
5ce472ab8a AP_Module: changed hook prefix to ap_hook_ 2016-07-14 13:39:47 +10:00
Andrew Tridgell
e8d8ca5eef AP_Module: updated example module 2016-07-14 13:39:47 +10:00
Andrew Tridgell
847bfda48a HAL_Linux: adjust include ordering 2016-07-14 13:39:47 +10:00
Andrew Tridgell
dd5d0ffbad HAL_Linux: use default module directory 2016-07-14 13:39:47 +10:00
Andrew Tridgell
f29323871f AP_Module: added default module directory 2016-07-14 13:39:47 +10:00
Andrew Tridgell
33ce1213a2 AP_InertialSensor: call gyro_sample and accel_sample AP_Module hooks 2016-07-14 13:39:47 +10:00
Andrew Tridgell
6b6a02e67e AP_Module: also allow export of raw gyro and accel samples
allows for oversampling in image correction
2016-07-14 13:39:46 +10:00
Andrew Tridgell
36181b78de AP_AHRS: fixed build for px4 2016-07-14 13:39:46 +10:00
Andrew Tridgell
7a2d67bde9 AP_Module: added AP_MODULE_SUPPORTED define 2016-07-14 13:39:46 +10:00
Andrew Tridgell
107f76828d HAL_Linux: added AP_Module support 2016-07-14 13:39:46 +10:00
Andrew Tridgell
15a01eefb1 AP_AHRS: added AHRS_update hook 2016-07-14 13:39:46 +10:00
Andrew Tridgell
bd00beaf99 AP_Module: added external module hook library
this allows for external modules to be called at defined hook
locations in ArduPilot. The initial example is a module that consumes
the AHRS state, but this can be generalised to a wide variety of hooks
2016-07-14 13:39:46 +10:00
Andrew Tridgell
f3f34be9c4 SITL: added comment on heli interlock 2016-07-12 20:50:22 +10:00
Jonathan Challinger
630e5378da AC_PosControl: add get_horizontal_error 2016-07-12 18:40:25 +09:00
Jonathan Challinger
8fe0c1b05b AC_PrecLand: don't run if not enabled 2016-07-12 18:40:25 +09:00
Jonathan Challinger
e84d1581ab AC_PrecLand: use new irlock interface, refactor backend interface 2016-07-12 18:40:25 +09:00
Jonathan Challinger
6254608c45 AP_IRLock: refactor interface 2016-07-12 18:40:25 +09:00
Andrew Tridgell
4f17093add SITL: give a bit more pitch on tail in XPlane heli 2016-07-12 19:08:50 +10:00
Andrew Tridgell
fdd20830d6 SITL: use flaps for collective on helis in X-Plane 10
works for more helis
2016-07-12 19:08:50 +10:00
Randy Mackay
6e224158f1 AP_GPS_MAV: use GPS_INPUT_IGNORE_FLAGS 2016-07-12 15:44:46 +09:00
Randy Mackay
e34aa0bc72 AP_GPS_MAV: minor formatting fixes
No functional change
2016-07-12 15:44:19 +09:00
Allan Matthew
4249f7dbe6 AP_GPS: Add GPS_MAV type and accept GPS_INPUT message 2016-07-12 15:34:27 +09:00
Tom Pittenger
84ce499a0d AP_Baro: remove zero-init in constructor 2016-07-11 22:11:34 -07:00
Tom Pittenger
1d81df8144 Revert "AP_Baro: coverity scan - variables not initialized in constructor"
This reverts commit 8d2872d3ab.
2016-07-11 22:02:41 -07:00
Tom Pittenger
9fb4a928e5 Revert "AP_Airspeed: coverity scan - variables not initialized in constructor"
This reverts commit 93462d0fe3.
2016-07-11 22:02:22 -07:00
Tom Pittenger
fc02908c0d Revert "GCS_MAVLink: coverity scan - variables not initialized in constructor"
This reverts commit bd8debdf8b.
2016-07-11 22:01:50 -07:00
Tom Pittenger
773372d2f3 Revert "AP_TECS: coverity scan - variables not initialized in constructor"
This reverts commit 753c0d47f0.
2016-07-11 22:01:26 -07:00
Tom Pittenger
c38c3ae7fe Revert "AP_TECS: coverity scan: init variable struct"
This reverts commit 19713200e5.
2016-07-11 22:01:02 -07:00
Tom Pittenger
be752164f4 Revert "AP_L1_Control: coverity scan - variables not initialized in constructor"
This reverts commit d558f32142.
2016-07-11 21:59:12 -07:00
Andrew Tridgell
871219d199 SITL: support helicopters with X-Plane 10
we get collective from "throttle2" and get interlock from generator1 on/off
2016-07-12 14:40:08 +10:00
priseborough
8793c75da0 AP_NavEKF2: clean up mag field learned logic 2016-07-11 00:44:33 +10:00
priseborough
e6592186fc AP_NavEKF2: Tuning update
Slow down magnetic field learning
2016-07-10 08:21:18 +10:00
priseborough
10470b2dc1 AP_NavEKF2: fix bug in initialisation of declination co-variances
Co-variances were being re-zeroed after being set. This meant that the initial declination learning was sensitive to measurement errors which could result in poor initial yaw accuracy.
2016-07-10 08:21:18 +10:00
priseborough
6b04a81b8d AP_NavEKF2: Fix plane in-flight yaw reset bug
Fixes bugs that prevented planes being able to reset yaw to GPS to recovery from takeoff with a bad magnetoemter.

1) If the velocity innovation check had not failed by the time the in-air transition occurred, then the yaw reset would not be performed
2) The velocity states were not being reset
3) The non fly-forward vehicle (copter) reset could occur first and effectively lock out the fly-forward vehicle (plane) yaw check.
2016-07-10 08:21:18 +10:00
priseborough
51dbed2338 AP_NavEKF2: remember mag field states between flight on same power cycle
Remember the mag bias and earth field states learned during flight when the vehicle  lands.
This improves performance for vehicles that do multiple flight on one power cycle
2016-07-10 08:21:18 +10:00