Commit Graph

11905 Commits

Author SHA1 Message Date
priseborough fcc07b5560 AP_NavEKF2: Prevent multiple aiding mode changes per update 2016-07-19 12:16:50 +10:00
priseborough f4f347fb75 AP_NavEKF2: add missing parenthesis and console message 2016-07-19 12:16:50 +10:00
priseborough 9a23152ee4 AP_NavEKF2: Fix bugs and consolidate aiding switch logic
Switching in and out of aiding modes was being performed in more than one place and was using two variables.
The reversion out of GPS mode due to prolonged loss of GPS was not working.
This consolidates the logic and ensures that PV_AidingMode is only changed by the setAidingMode function.
2016-07-19 12:16:50 +10:00
priseborough 230ba2700f AP_NavEKF2: fix documentation errors 2016-07-19 12:16:50 +10:00
priseborough b3bfb71431 AP_NavEKF: fix documentation errors 2016-07-19 12:16:50 +10:00
priseborough 01ce3e7f1e AP_AHRS: fix documentation errors 2016-07-19 12:16:49 +10:00
priseborough 7700b1417d AP_InertialNav: Use separated EKF horiz/vert position interfaces 2016-07-19 12:16:49 +10:00
priseborough 5454f76702 AP_AHRS: Add separate interfaces for local horizontal and vertical position 2016-07-19 12:16:49 +10:00
priseborough a8cd037f56 DataFlash: update to match revised EKF1 and EKF2 interface
Uses separate horz/vert position interfaces
2016-07-19 12:16:49 +10:00
priseborough 341d070db8 AP_NavEKF2: Separate filter status update and get functions
The filter status logic calculations were being repeated every time the get function was called.
The logic is now updated once per filter update step and a separate get function added
2016-07-19 12:16:49 +10:00
priseborough b1717649b1 AP_NavEKF2: remove combined NED local position interface 2016-07-19 12:16:49 +10:00
priseborough e374ec634d AP_NavEKF2: Add separate horizontal/vertical local position interfaces 2016-07-19 12:16:49 +10:00
priseborough 487bbc3ed2 AP_NavEKF: Fix reporting of position status
Split publishing of local position into horiz and vert components with separate validity checks
Split status reporting into separate update and get functions and only update once after each loop update. This removes unnecessary re-calculation of the status logic and ensures all consumers get the same data (avoid possible race conditions).
2016-07-19 12:16:48 +10:00
priseborough 04e8726d8a AP_NavEKF2: relax bias convergence check
Enables bias convergence check to pass within 30 seconds when vehicle is static.
2016-07-19 12:16:48 +10:00
priseborough 280395afa1 AP_NavEKF2: Don't declare ready to do aiding unless gyro bias is learned 2016-07-19 12:16:48 +10:00
priseborough 169cd6625d AP_NavEKF2: clean up output predictor 2016-07-19 12:16:48 +10:00
priseborough aaab250f13 AP_NavEKF2: Don't start GPS aiding until gyro calibration has stabilised
If we start GPS aiding before the gyro bias variances have reduced, glitches on the GPS can cause attitude disturbances that degrade flight accuracy during early flight.
2016-07-19 12:16:48 +10:00
Lucas De Marchi 4e2b30b413 Global: workaround toolchain problem on windows
The minimum version for gcc was supposed to be 4.9 for any platform.
However our build instructions are outdated. Remove the problematic
parts that use the sparse-endian.h header while we don't fix the setup
for windows.
2016-07-19 09:30:39 +09:00
Lucas De Marchi 913f88f2be AP_BoardConfig: fix check for PX4_V4
When building for px4-v2 we have an warning because we are checking for
the value of this undefined macro. Just change both checks to use
"defined()".

../../libraries/AP_BoardConfig/AP_BoardConfig.cpp:36:7: warning: "CONFIG_ARCH_BOARD_PX4FMU_V4" is not defined [-Wundef]
 #elif CONFIG_ARCH_BOARD_PX4FMU_V4
       ^
2016-07-19 10:28:56 +10:00
Lucas De Marchi 6d1acc5813 AP_InertialSensor: BMI160: remove stray call to set speed
It's already supposed to be on high speed there.
2016-07-18 11:20:49 -03:00
Andrew Tridgell 6776f8ac76 DataFlash: fixed GPS2 log format 2016-07-18 09:19:05 +10:00
Grant Morphett 8d6b417adb AP_SteerController: Adding support for Rovers driving reverse
This change is mostly for handling the reverse yaw.
2016-07-17 08:15:33 +10:00
Grant Morphett b56799f444 AP_L1_Control: Adding support for rover's operating in reverse
Mostly invovles sorting out the reverse yaw when travelling backwards.
2016-07-17 08:15:33 +10:00
Grant Morphett 4e8666cee9 AP_Mission: Adding new MAV_CMD_DO_SET_REVERSE for Rovers.
Rover now supports reverse via this MAV_CMD.
2016-07-17 08:15:33 +10:00
Grant Morphett 647602ed4d AP_Navigation: Adding set_reverse to virtual parent class 2016-07-17 08:15:33 +10:00
Tom Pittenger acaf0c6a5d SITL: LPF the SIM_WIND_DIR and SIM_WIND_SPD values to eliminate step inputs 2016-07-15 18:37:40 -07:00
Andrew Tridgell 4e8b4f29d9 SITL: added -heavy option to fixed wing model 2016-07-16 08:14:29 +10:00
Andrew Tridgell d3d2ce3e0d AP_TECS: use full throttle in initial takeoff
during the first part of a takeoff when we have not yet reached the
target airspeed this forces the throttle to maximum. This fixes a case
where the throttle may drop too low during the first part of takeoff
and lead to a stall.
2016-07-16 08:14:29 +10:00
Gustavo Jose de Sousa ee7c40be61 AP_InertialSensor: BMI160: add backend
The reason of defining BMI160_MAX_FIFO_SAMPLES as 8 can be found on the
following histogram of the number of samples in the FIFO on each read while
performing the accelerometer calibration process:

Samples Count   Freq Acc. Freq
------------------------------
      1  3842 0.1201  0.120111
      2 13172 0.4118  0.531904
      3  9065 0.2834  0.815300
      4  2710 0.0847  0.900022
      5  2231 0.0697  0.969769
      6   816 0.0255  0.995279
      7   137 0.0043  0.999562
      8    13 0.0004  0.999969
     13     1 0.0000  1.000000
2016-07-15 16:46:06 -03:00
Staroselskii Georgii a1f151a79b AP_HAL_Linux: do not create unnecessary consoles in UARTDriver 2016-07-15 15:31:19 -03:00
Staroselskii Georgii 7b3a5e3158 AP_HAL_Linux: use factory method for creation of UARTDriver backends
Using factory method maked it easier to grasp the lifetime of all object
that get created and destroyed. Instead of spanning this thoughout whole
source file we have it nicely encapsulated in this a little horrendeous
_parseDevicePath that is of course to improve more.
2016-07-15 15:29:05 -03:00
Staroselskii Georgii 0ca635bfb8 AP_HAL_Linux: close() console in dtor 2016-07-15 15:28:10 -03:00
Staroselskii Georgii e7a5945056 AP_HAL_Linux: make flow_control a property of SerialDevice rather than UARTDriver's
Make it possible to change flow control settings for individual devices.
2016-07-15 15:26:49 -03:00
Staroselskii Georgii 897d2fb1fb AP_HAL_Linux: use OwnPtr for _device in UARTDriver
Otherwise we're going to leak memory without any need.
Before this fix we've created ConsoleDevice 4 times in case -A switch hadn't been supplied,
but we hadn't ever deleted those. Now there's no memory leak here.
2016-07-15 15:22:51 -03:00
Staroselskii Georgii 3f1e999fc8 AP_HAL_Linux: remove ConsoleDevice construction from UARTDriver constructor
Since we're going to create ConsoleDevice in UARTDriver either way,
there's no need to do anything except setting the console flag.
2016-07-15 14:56:00 -03:00
Andrew Tridgell 1b8da3bce2 HAL_PX4: implement I2CDevice driver for PX4 2016-07-15 12:24:03 -03:00
Luiz Ywata 1f0f36d603 AP_Notify: NavioLED_I2C: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Lucas De Marchi 24cdef24b8 AP_HAL_Linux: remove wrong ifdef
This was added when the support for navio2 went in, but the same ifdef
is already on the lines above.
2016-07-14 17:32:33 -03:00
Luiz Ywata 3e765e23a9 AP_HAL_Linux: RCOutput_PCA9685: use I2CDevice interface 2016-07-14 17:32:33 -03:00
Luiz Ywata d5449a6f20 AP_HAL: Add read method
Provide a more intuitive api for reading an I2CDevice.
2016-07-14 17:32:33 -03:00
Lucas De Marchi 08ea1ea263 AP_HAL_Linux: RCOutput_Bebop: follow coding style
Minor changes to follow coding style and improve readability:

    - sort headers
    - move struct definition to compilation unit rather than header
    - Add braces to if, for, etc
2016-07-14 17:32:33 -03:00
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