Commit Graph

18894 Commits

Author SHA1 Message Date
Paul Riseborough 55ac8f0230 AP_NavEKF2: Update parameter values.
Testing on different platforms has shown that the new EKF has smaller innovations enabling innovation consistency checks that reject GPS and baro errors to be tightened.
The position and velocity thresholds for plane have been left the same because planes are less sensitive to GPS glitches as they fly higher and with more separation to surrounding objects. They are also more prone to bad inertial data due to the installation practices.
The altitude noise has been increased on plane to allow for the larger baro disturbances that result from the higher speeds and lack of a proper static pressure source. The innovation consistency gate has been adjusted to provide the same baro error limit of ~20m before baro is rejected.
2015-10-24 07:26:50 +11:00
Paul Riseborough 1e7ac873b9 AP_NavEKF2: Improve handling of GPS loss and recovery for planes
Extended GPS loss can result in the earth field states becoming  rotated and making it difficult for the EKF to recover its heading when GPS is regained.
During prolonged GPS outages, the position covariance can become large enough to cause the reset function to continually activate. This is fixed by ensuring that position covariances are always reset when the position is reset.
The innovation variance was being used incorrectly instead of the state variance to trigger the glitch reset.
2015-10-24 07:17:11 +11:00
Paul Riseborough cd5ec3a3e0 AP_NavEKF2: Reduce angle errors when flying without GPS
Turn off aiding during >1g manoeuvres when not using GPS
Use larger velocity and position uncertainties when flying without GPS
2015-10-23 19:04:30 +11:00
Paul Riseborough 1eaf318b9b AP_NavEKF2: Faster learning of gyro scale factors 2015-10-23 19:04:30 +11:00
Paul Riseborough a2f5962f77 AP_NavEKF2: Reduce effect of baro disturbances 2015-10-23 19:04:30 +11:00
Paul Riseborough 5eb7cf1fbf AP_NavEKF: Reduce roll/pitch disturbance when magnetic field is reset
Because we have changed the yaw angle and have taken a point sample on the magnetic field, covariances associated with the magnetic field states will be invalid and subsequent innovations could cause an unwanted disturbance in roll and pitch.
The reset of the Euler angles to a new yaw orientation was being done using roll and pitch from the output observer states, not the EKF state vector which meant that when roll and pitch were changing, the reset to a new yaw angle would also cause a roll and pitch disturbance.
2015-10-23 19:04:30 +11:00
Peter Barker 5da7d6eac2 Replay: set INS_GYRO_CAL to never to avoid losing samples 2015-10-23 12:37:44 +11:00
Lucas De Marchi 79dee5aaa9 AP_HAL: fix warning due to missing prototype after HAL rework
This was introduced with the HAL rework:

In file included from /p/ardupilot/libraries/AP_HAL/AP_HAL.h:11:0,
                 from /p/ardupilot/ArduCopter/Copter.h:35,
                 from /p/ardupilot/ArduCopter/ArduCopter.cpp:76:
/p/ardupilot/ArduCopter/ArduCopter.cpp: In function 'int ArduPilot_main(int, char* const*)':
/p/ardupilot/libraries/AP_HAL/AP_HAL_Main.h:11:26: warning: no previous declaration for 'int ArduPilot_main(int, char* const*)' [-Wmissing-declarations]
 #define AP_MAIN __EXPORT ArduPilot_main
                          ^

It's due to PX4 using that warning as opposed to Linux. Since it harmless, add
the prototype for everybody.
2015-10-23 07:47:19 +11:00
Lucas De Marchi b326856635 AP_HAL_Linux: fix warning due to limited storage
ardupilot/libraries/AP_HAL_Linux/Storage_FRAM.cpp: In member
function 'int32_t Linux::Storage_FRAM::read(uint16_t, uint8_t*, uint16_t)':
/home/lucas/p/dronecode/ardupilot/libraries/AP_HAL_Linux/Storage_FRAM.cpp:183:24: war
ning: comparison is always false due to limited range of data type [-Wtype-limits]
         if(Buff[i-fptr]==-1){
                        ^
2015-10-23 07:47:19 +11:00
Caio Marcelo de Oliveira Filho 11b599bcd0 SITL: use #pragma once
For the general case, pragma once is better replacement for of include
guards. One line instead of three, less scopes to close in the end of
the file, no chance to having the outdated names in the define symbol.
2015-10-22 13:36:19 -02:00
Caio Marcelo de Oliveira Filho 288dc2a385 SITL: clean up includes
Remove unnecessary includes, reorder them in blocks separated by a blank
line

   - Corresponding header file (if exists)
   - System headers
   - Other ArduPilot library headers
   - "Local" headers (from the same library)
2015-10-22 13:36:19 -02:00
Caio Marcelo de Oliveira Filho 8a55b26443 SITL: no need to use #ifdefs
Now that SITL is compiled only when it's needed (i.e. using the SITL
board), there's no need to ifdef its files based on the
CONFIG_HAL_BOARD. So remove them.
2015-10-22 13:36:19 -02:00
Caio Marcelo de Oliveira Filho f27f8f2f5d Tools: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho 62d4c05a8e ArduPlane: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho bf6d1afd59 ArduCopter: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho bad68829ae APMrover2: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho a3fb1c0e4f AntennaTracker: include SITL only for SITL board
Include board-specific files only when the board is used. Since these
should be exceptional cases, let the includer handle the ifdef instead
of putting ifdefs in every platform-specific header.

In the future we should evaluate whether the HAL for the board should
instantiate this.
2015-10-22 13:36:14 -02:00
Caio Marcelo de Oliveira Filho e2fa456742 SITL: remove "constructor" comment 2015-10-22 11:16:39 -02:00
Caio Marcelo de Oliveira Filho 5ddd802320 SITL: use coding style in class declarations 2015-10-22 11:15:34 -02:00
Caio Marcelo de Oliveira Filho f0a20cdc7c SITL: remove trailing whitespace 2015-10-22 11:15:20 -02:00
Caio Marcelo de Oliveira Filho 49a42dc985 SITL: use a SITL namespace 2015-10-22 11:04:42 -02:00
Gustavo Jose de Sousa be8070e335 AP_InertialSensor: MPU9250: publish gyro raw sample rate
So that delta angle calculation is enabled.
2015-10-22 16:53:12 +11:00
Gustavo Jose de Sousa 887f81274d AP_InertialSensor: MPU6000: publish gyro raw sample rate
So that delta angle calculation is enabled.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 31a49d318c AP_InertialSensor: PX4: publish gyro raw sample rate
That enables delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 25a499a41f AP_InertialSensor: use raw sample rate terminology
In order to avoid confusion between sample rate from sensor and sample rate
from the frontend class (AP_InertialSensor), use "raw sample rate" to refer to
the former.

The changes in the code were basically done with the following commands:

git grep -wl _accel_sample_rates | xargs sed -i "s,\<_accel_sample_rates\>,_accel_raw_sample_rates,g"
git grep -wl _set_accel_sample_rate | xargs sed -i "s,\<_set_accel_sample_rate\>,_set_accel_raw_sample_rate,g"
git grep -wl _accel_sample_rate | xargs sed -i "s,\<_accel_sample_rate\>,_accel_raw_sample_rate,g"

git grep -wl _gyro_sample_rates | xargs sed -i "s,\<_gyro_sample_rates\>,_gyro_raw_sample_rates,g"
git grep -wl _set_gyro_sample_rate | xargs sed -i "s,\<_set_gyro_sample_rate\>,_set_gyro_raw_sample_rate,g"
git grep -wl _gyro_sample_rate | xargs sed -i "s,\<_gyro_sample_rate\>,_gyro_raw_sample_rate,g"

And also with minor changes on indentation and comments.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 6feea5f64f AP_InertialSensor: Backend: remove function _publish_delta_angle()
Delta angle calculation is now unified, so there is no need for such a method.
That also avoids developers thinking they need that method being called
somewhere in their new drivers.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 7fef515555 AP_InertialSensor: unify delta angle calculation
This commit basically moves delta angle calculation that was previously done in
AP_InertialSensor_PX4 to a common place. Instances must publish their gyro raw
sample rate to enable delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 4e83f7b02c AP_InertialSensor: PX4: don't calculate delta angle
Delta angle calculation will be unified.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa 9e05041234 AP_InertialSensor: allow publishing gyro raw sample rate to frontend
That information will be used for a unified delta angle calculation.
2015-10-22 16:53:11 +11:00
Gustavo Jose de Sousa dfd671c54e AP_InertialSensor: Backend: add hook for new gyro sample arrival
That hook will do common tasks for when new gyro raw sample is available.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa a3e2c82491 AP_InertialSensor: Backend: remove function _publish_delta_velocity()
The delta velocity calculation is now unified, so there is no need for such a
method. That also avoids delevopers thinking they need that method being called
somewhere in their new drivers.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa 75fdac648f AP_InertialSensor: unify delta velocity calculation
This commit basically moves delta velocity calculation that was previously done
in AP_InertialSensor_PX4 to a common place. Instances must publish their accel
raw sample rate to enable delta velocity calculation.
2015-10-22 16:53:10 +11:00
Gustavo Jose de Sousa f769a39449 AP_InertialSensor: PX4: don't calculate delta velocity
Delta velocity calculation will be unified.
2015-10-22 16:31:07 +11:00
Peter Barker e502f353c1 Replay: handle df format changes - IMT vs IMU 2015-10-22 16:28:11 +11:00
Paul Riseborough 44f42fe72d AP_NavEK: Reduce settling time after start-up disturbance
Now that we are using  a consistent 50Hz minimum update rate for the covariance prediction we do not need a different initial gyro bias uncertainty for plane and copter to maintain filter stability margins.
The default value of 0.1 rad/s was too high and gave excessive settling time of the filter attitude after startup.
The initial attitude uncertainty has been increased to allow for some movement during startup.
2015-10-22 16:23:14 +11:00
Lucas De Marchi 29aa7001bf build: add minlure target 2015-10-22 12:04:53 +11:00
Lucas De Marchi cdaf67b749 AP_HAL_Linux: use PCA9685 for output in minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi b75524a152 AP_HAL_Linux: use UART RC input for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi f915d2ff6f AP_Notify: don't define devices for minlure
It still doesn't have a notify device.
2015-10-22 12:04:53 +11:00
Lucas De Marchi f72a5614d5 AP_HAL_Linux: add I2C buses for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi 959e061514 AP_HAL_Linux: add spi device for minlure 2015-10-22 12:04:53 +11:00
Lucas De Marchi ed36ae9ef7 AP_InertialSensor: MPU6000: add rotation for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 386547427d AP_Baro: support MS5611 on second i2c bus 2015-10-22 12:04:52 +11:00
Lucas De Marchi e6b942ffb0 AP_Compass: use HMC5843 behind MPU6000 for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 4992375bab AP_HAL_Linux: add GPIO definitions for minlure 2015-10-22 12:04:52 +11:00
Lucas De Marchi 8153f57f06 AP_HAL: add board definitions for minlure 2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa 7daa3201fd AP_HAL_Linux: add test for GPIO 2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa cdf70f6fe5 AP_HAL_Linux: add GPIO_Sysfs
This commit adds the class Linux::GPIO_Sysfs. This class provides a generic
implementation of AP_HAL::GPIO on Linux by using GPIO Sysfs Interface
(https://www.kernel.org/doc/Documentation/gpio/sysfs.txt).

The channel() interface should be preferred in places that need to be
fast. Since it maintains the file descriptor open this is much faster
than opening and closing it.
2015-10-22 12:04:52 +11:00
Gustavo Jose de Sousa 88146f1f02 AP_HAL_Linux: make board specific GPIO inclusions last
Board specific inclusions should be the last inclusions so that any
eventual dependency may be fulfilled.
2015-10-22 12:04:52 +11:00
Fabio Mello 20e209120f AP_HAL_Linux: add support for RCInput through UART
We are using a microcontroller to read the PWM input from RC. The read
values are sent to our board using a simple serial protocol through the
UART interface.

This patch interprets these values and passes them forward to the APM.
2015-10-22 12:04:52 +11:00