Commit Graph

9535 Commits

Author SHA1 Message Date
Randy Mackay 73f4533995 AC_PosControl: minor comment update 2015-10-28 20:21:53 +09:00
Randy Mackay 895a40893d AC_PosControl: use_desvel_ff flag added
This allows turning on/off desired velocity feedforward without setting desired_vel.z to zero.  Setting desired_vel.z to zero has the side effect of disrupting the landing detection which needs to know if we are trying to descend
2015-10-28 20:21:52 +09:00
Leonard Hall aec66c5db6 AC_PosControl: faster z-axis slowdown when over speed 2015-10-28 20:21:38 +09:00
Leonard Hall 245f7ce268 AC_PosControl: allow desired vel z to be above speed limit 2015-10-28 17:59:36 +09:00
Leonard Hall f55c31a157 AC_PosControl: add alt hold without feed forward 2015-10-28 17:57:20 +09:00
Andrew Tridgell aee2543b75 AP_Parachute: fixed release bug
if release() is called within 1 millisecond of update() the release
wouldn't happen
2015-10-27 16:06:34 +11:00
Andrew Tridgell 0d9715cfe8 AP_Parachute: added a released() function
used to help with throttle suppression in plane
2015-10-27 16:06:34 +11:00
Randy Mackay ca942f39dd AP_Motors_Heli: remove unused allow_arming check 2015-10-27 09:14:40 +09:00
Andrew Tridgell 724f5511aa SITL: support multiple jsbsim aircraft types
use -f jsbsim:ModelName
2015-10-27 10:01:34 +11:00
Randy Mackay e9cec1203a GCS_MAVLink: version update after generate 2015-10-26 16:28:54 +09:00
Randy Mackay e51498aa45 GCS_MAVLink: generate after adding DO_SEND_BANNER 2015-10-26 16:28:52 +09:00
Jonathan Challinger 36bb5a25a2 GCS_MAVLink: add MAV_CMD_DO_SEND_BANNER 2015-10-26 16:28:49 +09:00
squilter 9de2ec04f6 AC_PrecLand: update comments to reflect change from bf_angle to angle 2015-10-26 09:45:05 +09:00
squilter 9e7099f5ee AC_PrecLand: implement frame of reference 2015-10-26 09:45:03 +09:00
squilter e409bd0a58 AC_PrecLand: rename bf_angle to angle 2015-10-26 09:45:01 +09:00
Andrew Tridgell c228ea4371 AP_NavEKF2: prevent a valgrind error on startup 2015-10-26 11:34:32 +11:00
Jonathan Challinger c762865d66 AP_Mount: use configured function to determine if MNT_TYPE has been configured 2015-10-26 11:15:54 +11:00
Jonathan Challinger f0f5239d8f AP_L1_Control: use set_default for runtime param defaults 2015-10-26 11:15:54 +11:00
Jonathan Challinger 21e7d46944 RC_Channel: use set_default for runtime param defaults 2015-10-26 11:15:54 +11:00
Jonathan Challinger 39246c13ad AP_Param: add set_default, configured 2015-10-26 11:15:54 +11:00
Paul Riseborough 87ea9acc7f AP_NavEKF2: Fix mavlink parameter label 2015-10-26 08:05:15 +11:00
Paul Riseborough 1cf626692c AP_NavEKF: Reduce impact of altimeter flow disturbance error on Copter alt hold
This increase in assumed altimeter noise and reduction in accel noise has been flight tested by L.Hall with noticeable reduction in the immediate response to Baro errors during moving flight.
This increases the time constant of response to baro errors such that the pilot can more easily compensate.
2015-10-26 08:05:15 +11:00
Paul Riseborough e692e30988 AP_NavEKF2: Reduce allowance for magnetometer timing errors
The previous gain from rate to magnetometer error was excessive. The revised value is equivalent to a magnetic field length of 0.5 with a timing uncertainty of 0.01 sec
2015-10-26 08:05:15 +11:00
Paul Riseborough 4c5ba60578 AP_NavEKF2: Remove dead code 2015-10-26 08:05:15 +11:00
Andrew Tridgell 142aa59bce AP_InertialSensor: fixed vibration logging after recent changes 2015-10-26 07:26:17 +11:00
Lucas De Marchi 9eaf7c5660 AP_HAL: add format attribute to panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 2322b8014d AP_HAL: use common macro for printf formatting 2015-10-24 14:26:36 +11:00
Lucas De Marchi dc95145de2 AP_Common: add attribute to sanitize prinf-like functions
Make the compiler emit warnings if the variables don't match the
printf format string. To be added in functions with printf-like
arguments.
2015-10-24 14:26:36 +11:00
Lucas De Marchi 3650eb468f AP_HAL_FLYMAPLE: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi e2d1fab863 AP_HAL_Empty: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 6027a02fe9 AP_HAL_SITL: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi e9d92c446c AP_HAL_VRBRAIN: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi f791767fb2 AP_HAL_PX4: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi 4b54bcbfad AP_HAL_Linux: use variadic panic()
While at it also add a prefix with the name of the driver.
2015-10-24 14:26:36 +11:00
Lucas De Marchi 2af4244854 AP_HAL_Linux: Scheduler: implement variadic version of panic() 2015-10-24 14:26:36 +11:00
Lucas De Marchi ad61a93c14 AP_HAL: turn panic() into a variadic method
Change the declaration on all HAL implementations so panic() in future
may implement a printf-like interface.
2015-10-24 14:26:35 +11:00
Lucas De Marchi 0b4aa5ac85 AP_HAL: Scheduler: reorder includes
Follow the following order for includes:

   - Corresponding header file (if exists)
   - System headers
   - Other ArduPilot library headers
   - "Local" headers (from the same library)
2015-10-24 14:26:35 +11:00
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
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 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
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 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
Paul Riseborough 6c017ffcb5 AP_NavEKF: Predict covariance more often to prevent instability on startup
If the baro data and magnetometer data are interleaved (arriving every 100 msec and offset by 50 msec), then the filter will go unstable during startup and fail to complete checks.
2015-10-22 09:57:38 +09:00
Gustavo Jose de Sousa 63b42e0632 AP_Compass: Calibrator: make calculations for theta only once
Additionally, format comment on sample acceptance formulas nicely.
2015-10-22 08:19:35 +11:00
Gustavo Jose de Sousa f8433f82e6 AP_Compass: simplify calibration transition to COMPASS_CAL_RUNNING_STEP_ONE 2015-10-22 08:19:35 +11:00
Lucas De Marchi f21ee7694a AP_HAL_Linux: don't use relative includes
Use brackets to include from AP_HAL and reorder headers.
2015-10-21 15:54:27 -02:00
Lucas De Marchi eef4d5819f AP_HAL: HAL: don't use relative includes
Includes in the same dir should not be relative. Also sort them
alphabetically.
2015-10-21 15:54:27 -02:00
Lucas De Marchi 74ccbdb6f7 AP_HAL: AnalogIn: add missing include
Since we are using uint8_t and uint16_t types we need to include the
correspondent system header. Otherwise it would depend on the include
order of who is including this particular header, causing failures as we
move headers around.
2015-10-21 15:54:27 -02:00
Andrew Tridgell 6b048b4045 HAL_SITL: use SimRover 2015-10-21 22:04:21 +11:00
Andrew Tridgell 05876b7e1b SITL: Changed Rover to SimRover
this avoids the rover crash in master
2015-10-21 22:04:19 +11:00
Paul Riseborough b08817554e AP_NavEKF2: Ensure consistent position and velocity fusion rates when not using GPS
This sets the fusion of the synthetic position and velocity to occur at the same time as the barometer

This makes filter tuning more consistent between GPS and non-GPS useage
2015-10-21 17:27:00 +11:00
Paul Riseborough 1c347e8859 AP_NavEKF: Prevent high measurement data rates from overflowing buffers
High measurement data rates can fill buffers with data that is always new and never fused because it is over-written before it falls behind the measurement time horizon.
2015-10-21 17:27:00 +11:00
Paul Riseborough d1a090dda8 AP_NavEKF: Fix bug fetching data from measurement buffers
This bug can result in valid data being rejected and fused at the wrong time horizon.
2015-10-21 17:27:00 +11:00
Paul Riseborough aabb9b4e02 AP_NavEKF2: handle uncertain build type 2015-10-21 17:27:00 +11:00
Paul Riseborough e6312d91ce AP_NavEKF2: Correct variable name 2015-10-21 17:27:00 +11:00
Paul Riseborough 4640673cb1 AP_NavEKF2: Fix bug causing incorrect fusion timing 2015-10-21 17:27:00 +11:00
Andrew Tridgell 4a8a24a1a2 AP_Compass: don't update last_update_usec for raw fields
this fixes a problem where the EKF gets compass samples at 50Hz
instead of the expected 10Hz
2015-10-21 13:22:24 +11:00
Tom Pittenger 695efb8df3 AP_L1_Control: added integrator to help xtrack error converge to zero
new param: NAVL1_XTRACK_I
    // @Description: Crosstrack error integrator gain. This gain is applied to the crosstrack error to ensure it converges to zero. Set to zero to disable. Smaller values converge slower, higher values will cause crosstrack error oscillation.
fixes https://github.com/diydrones/ardupilot/issues/2650

when param is changed the integrator is set to zero. This makes for easier tuning by seeing it converge to zero on each change.
2015-10-21 12:49:43 +11:00
Caio Marcelo de Oliveira Filho f7c73fbb13 AP_AHRS: remove AHRS_EKF_USE_ALWAYS define
This option now is passed when instantiating the code in ArduCopter, so
selecting the default value at compile time is not necessary anymore.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:11 +11:00
Caio Marcelo de Oliveira Filho 9d2e3157fe AP_AHRS: add a runtime flag for always using EKF
The AHRS_EKF_USE_ALWAYS define is used to force EKF to be always
used. It is defined only for building ArduCopter. Change it to be a
runtime flag. Keep its default value still based on the original define,
once the Copter uses it the define will be removed.

The motivation is to move vehicle specifc code out of the general
libraries. This patch shouldn't change behavior.
2015-10-21 11:01:10 +11:00
Caio Marcelo de Oliveira Filho e87db31149 AP_AHRS: remove unused define
AHRS_EKF_USE_DEFAULT is not used since commit
7ba45444a2 "AP_AHRS: added selection of
EKF type using AHRS_EKF_TYPE".
2015-10-21 11:01:10 +11:00
Peter Barker 38ca9dee03 GCS_MAVLink: use simple log entry number to reference df logs 2015-10-21 10:50:32 +11:00
Peter Barker e481497574 DataFlash: delete oldest file rather than the lowest-numbered file
Also reference log numbers by their list index to accomodate log number
wrapping in DataFlash_File
2015-10-21 10:50:32 +11:00
wsilva32 ab7148386c AP_HAL_AVR_SITL: Limit SITL compass reports to 100Hz
Similarly to how the SITL baro currently works, setHIL is only called at 100Hz.
2015-10-21 10:39:27 +11:00
wsilva32 da9118fbd0 AP_Baro: average SITL baro measurements using update() 2015-10-21 10:25:08 +11:00
Lucas De Marchi d276029e35 AP_BattMonitor: fix class name after rename in AP_HAL_Linux 2015-10-21 10:11:19 +11:00
Lucas De Marchi 2ac96b942c AP_HAL_Linux: remove prefix from AP_HAL_Linux classes
We have already a Linux namespace, so there's no need to prefix Linux on
all names.
2015-10-21 10:11:19 +11:00
Lucas De Marchi 19b31ccff1 DataFlash: remove check for max compass instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 1a4a26de2b AP_Compass: remove check for max compass instances
For all supported boards the maximum number of instances is 3. The
number of HIL_COMPASSES was already defined as 2 instead of 3, so this
is left as before.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 4004d5bf34 AP_Compass: remove check for HAL_CPU_CLASS
We don't support HAL_CPU_CLASS <= HAL_CPU_CLASS_16 anymore. This makes
COMPASS_MAX_INSTANCES and COMPASS_MAX_BACKEND constant for all supported
boards.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 36150348bb GCS_MAVLink: remove check for max BARO instances
For all supported boards we allow more than 1 baro instance.
2015-10-21 10:05:18 +11:00
Lucas De Marchi d83609b24c DataFlash: remove check for max BARO instances
For all supported boards we allow more than 1 baro instance.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 4d3229daa2 AP_Baro: remove check for HAL_CPU_CLASS
We don't support HAL_CPU_CLASS <= HAL_CPU_CLASS_16 anymore. This makes
BARO_MAX_INSTANCES and BARO_MAX_DRIVERS constant for all supported
boards.
2015-10-21 10:05:18 +11:00
Lucas De Marchi d1ac6cbd4c GCS_MAVLink: remove check for vibe check
For all supported boards we have vibration check.
2015-10-21 10:05:18 +11:00
Lucas De Marchi 121eeb4b58 DataFlash: remove check for vibe check
For all supported boards we have vibration check.
2015-10-21 10:05:17 +11:00
Lucas De Marchi 30a50b362f AP_InertialSensor: remove check for vibe check
For all supported boards we have vibration check.
2015-10-21 10:05:17 +11:00
Lucas De Marchi db62e55753 AP_InertialSensor: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Lucas De Marchi ae77c4b692 GCS_MAVLink: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Lucas De Marchi f99d64e621 DataFlash: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Lucas De Marchi 3114a988f8 AP_Arming: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Lucas De Marchi a147b97d2b AP_InertialSensor: remove check for HAL_CPU_CLASS
We don't support HAL_CPU_CLASS <= HAL_CPU_CLASS_16 anymore. This makes
INS_MAX_INSTANCES, INS_MAX_BACKENDS and INS_VIBRATION_CHECK constant for
all supported boards.
2015-10-21 10:05:17 +11:00
Lucas De Marchi 4480956c68 AP_InertialSensor: MPU6000: remove dead code for !FAST_SAMPLING
The code with ifdef for !FAST_SAMPLING is bit rotting and the example
for AP_InertialSensor is currently broken for this case. Instead of
adding more ifdefs, remove the legacy implementation for !FAST_SAMPLING
since we don't support it anymore.

Reported by Grant:

	/home/grant/3dr/ardupilot/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp:
	In member function 'void AP_InertialSensor_MPU6000::_accumulate(uint8_t*,
	uint8_t)':
	/home/grant/3dr/ardupilot/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp:776:20:
	error: no match for 'operator+=' (operand types are 'Vector3l {aka
	Vector3<long int>}' and 'Vector3f {aka Vector3<float>}')
		 _accel_sum += accel;

	/home/grant/3dr/ardupilot/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp:777:19:
	error: no match for 'operator+=' (operand types are 'Vector3l {aka
	Vector3<long int>}' and 'Vector3f {aka Vector3<float>}')
		 _gyro_sum += gyro;
2015-10-21 10:05:17 +11:00
Caio Marcelo de Oliveira Filho 75add595a0 AP_HAL_Empty: remove empty example
There are hello world examples elsewhere, and a bit misleading. It
doesn't test the Empty implementation, but the current board
implementation.
2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 5781164624 AP_HAL_PX4: remove unnecessary includes from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 22137b51e3 AP_PerfMon: remove unnecessary board include from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho ff13a7bf1f GCS_Console: remove unnecessary board include from examples 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 5ad8077016 AP_Parachute: remove unnecessary board include from examples 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 417651b1dc AP_Motors: remove unnecessary board includes from examples 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 1fc801c2c9 AP_ADC: remove unnecessary board includes from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 918a339660 AP_Declination: remove unnecessary board include from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 42a111f5df AP_Mount: remove unnecessary board include from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho de98ec7c1a AP_OpticalFlow: fix build of example for PX4 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho ae9bc62e84 AP_OpticalFlow: remove unnecessary includes from example 2015-10-21 09:16:12 +11:00
Caio Marcelo de Oliveira Filho 817248b2f5 AP_Airspeed: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho db1491f079 AP_GPS: remove unnecessary board includes from examples 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho d840fc0680 AP_Notify: remove unnecessary includes from examples 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho d51adf2523 AP_Notify: fix build of ToshibaLED_test in PX4
The unused variables were causing error due to shadowing. The
AP_Scheduler library was missing from make.inc.
2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 191cff2035 AP_InertialSensor: remove unnecessary includes from examples 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 118de8d01f AP_Mission: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 5d2279a554 AP_RangeFinder: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 6566deff66 AP_RangeFinder: fix compilation for Linux/SITL
Add libraries that those boards depend on. This should be handled in the
future elsewhere (and once for each board), but for now let's make it
compile again.
2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 4731f87683 AP_Common: add Makefile and clean up includes 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho a3169d0a34 AP_Compass: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 9b73fcb6f8 AP_AHRS: remove unnecessary includes in the example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 24178c3e10 AP_Baro: remove unnecessary includes in example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho b028219c94 DataFlash: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho 03b0c76553 StorageManager: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho d32207008d Filter: remove unnecessary includes from examples 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho 8e1e77007e AP_BattMonitor: remove unnecessary includes in example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho 9a2e0c2fd9 AC_PID: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho 09579cb6e3 GCS_MAVLink: remove unnecessary includes 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho e8d9c4dc9b PID: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho 12850742f9 AP_Scheduler: remove unnecessary includes from example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho b98bf2a65e AP_HAL: remove unnecessary includes from examples 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho c95a89411c AP_HAL_Linux: remove unnecessary includes in example 2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho e36728d1db RC_Channel: make example compile again
By adding a missing library dependency. Also remove unnecessary
includes, in particular including each board HAL file is not needed
anymore.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho 5020db4481 AP_Math: remove unnecessary includes
Remove unnecessary includes, in particular the includes for specific
boards. The list of libraries for 'polygon' example was updated so that
the example compiles again.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho b29d6eff5d AP_HAL: add an AP_HAL_MAIN_CALLBACKS() macro
This is going to be used by vehicles that already have an object with
setup/loop functions. The vehicle object will just implement the
HAL::Callbacks interface.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho 19b4ca60c4 AP_HAL: provide AP_HAL_MAIN()
Move the macros to a single place and reduce the variations not based on
board, but based on

- The name of the entry-point function, specified by AP_MAIN;
- Whether it contains argc/argv arguments or not.

The goal here is that programs (vehicles and examples) don't need to
include all possible boards to define a main function. Further patches
will change the programs.
2015-10-21 09:16:09 +11:00
Caio Marcelo de Oliveira Filho e30457a84d AP_HAL_VRBRAIN: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho cb61bdd8d1 AP_HAL_PX4: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho e18884a328 AP_HAL_AVR: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 1649104382 AP_HAL_FLYMAPLE: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 3c22564307 AP_HAL_Linux: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho e4ef0e43c0 AP_HAL_SITL: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 0c837326b5 AP_HAL_Empty: merge init() and run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 6fc60e2d5e AP_HAL: remove unused init() from the interface
And make run() pure virtual to ensure future implementations provide it.
2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho fe1dd1be25 AP_HAL_VRBRAIN: implement HAL::run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 0dab23c4df AP_HAL_PX4: implement HAL::run() 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 3fe1d86c80 AP_HAL_AVR: implement HAL::run() for APM1 and APM2 2015-10-21 09:16:08 +11:00
Caio Marcelo de Oliveira Filho 51bc25a2ab AP_HAL_FLYMAPLE: implement HAL::run() 2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 32dc822470 AP_HAL_Linux: implement HAL::run()
Added a note about the different ordering between setup callback and
scheduler initialized call.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho c6292ff097 AP_HAL_SITL: implement HAL::run() 2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 346ab77c27 AP_HAL_Empty: implement HAL::run() 2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 72cd5ef185 AP_HAL: add run() method
Add run method, that encapsulate any mainloop logic on behalf of the
client code. The setup/loop functions are passed via a HAL::Callbacks
interface. The AP_HAL_MAIN() macro should be kept as trivial as
possible.

This interface should be implemented by the existing vehicle objects. To
make easy for the examples (that don't have the equivalent of vehicle
objects), a FunCallbacks was added to bridge to the functions directly.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Andrew Tridgell 79d85f7e10 AP_AHRS: wait for up to 10 samples to get a valid accel vector
the initial accel vectors can be invalid
2015-10-21 09:09:11 +11:00
Andrew Tridgell eac91430a2 AP_AHRS: update _dcm_attitude() on reset()
this prevents the roll/pitch being overwritten by the AHRS_NavEKF
update code on next update
2015-10-21 08:58:30 +11:00
Jonathan Challinger c35605fa04 AP_AHRS_DCM: align tilt during initialization 2015-10-21 08:34:02 +11:00
Jonathan Challinger 78af6d61de AP_Compass: only play compass cal cancel tone if a cal was running 2015-10-21 08:24:49 +11:00
Jonathan Challinger 3b480bd6ec AP_InertialSensor: fix order of accelerometer corrections 2015-10-21 08:22:36 +11:00
Jonathan Challinger 562db11159 AP_Compass: fix potential AP_Notify concurrency problem 2015-10-20 20:54:02 +09:00
Paul Riseborough cd8b9c7d26 AP_NavEKF: prevent high rate mag data locking out other data fusion 2015-10-20 20:16:04 +11:00
Paul Riseborough ab8c28a7cc AP_NavEKF: Fix bug allowing takeoff in GPS modes without aiding
The legacy EKF switches GPs aiding on on arming, whereas the new EKF switches it on based on GPS data quality.
This means the decision to arm and therefore the predicted solution flags must now reflect the actual status of the navigation solution as it will no longer change when motor arming occurs.
2015-10-20 20:16:00 +11:00
Paul Riseborough e076ed7f66 AP_NavEKF2: Remove compiler warning message 2015-10-20 18:16:16 +11:00
Andrew Tridgell b0aa7cb990 DataFlash: use new perf API 2015-10-20 18:16:16 +11:00
Andrew Tridgell cb0f7cb370 NavEKF2: use new perf counter API 2015-10-20 18:16:15 +11:00
Andrew Tridgell f66966ccae NavEKF: use new perf counter API 2015-10-20 18:16:15 +11:00
Andrew Tridgell 8dbb51c64e HAL_PX4: implement AP_HAL::Util perf calls for PX4 2015-10-20 18:09:57 +11:00
Andrew Tridgell 28fa05c965 AP_HAL: added generic perf counter
simple wrapper around PX4 API, but ready for use by other HALs
2015-10-20 18:09:57 +11:00
Paul Riseborough 60c2e81d19 AP_NavEKF2: Apply optimisations to declination fusion covariance update
These are the same type of optimisations that were successful with the magnetometer fusion
2015-10-20 15:21:41 +11:00
Paul Riseborough 0054291cf4 AP_NavEKF2: Apply optimisations to side-slip fusion covariance update
These are the same optimisations that were successful with the magnetometer fusion
2015-10-20 15:21:40 +11:00
Paul Riseborough 5e4bc4e954 AP_NavEKF2: Apply optimisations to airspeed fusion covariance update
These are the same optimisations that were successful with the magnetometer fusion
2015-10-20 15:21:40 +11:00
Paul Riseborough a29147d6d2 AP_NavEKF2: Apply optimisations to optical flow covariance update
These are the same optimisations that were successful with the magnetometer fusion
2015-10-20 15:21:40 +11:00
Paul Riseborough b5e43288d4 AP_NavEKF2: Down to 12 from 14 usec for perf test[8] 2015-10-20 15:21:40 +11:00
Paul Riseborough 0f530bb5a0 AP_NavEKF2: Correct comments 2015-10-20 15:21:40 +11:00
Andrew Tridgell d1dfd5fd01 AP_NavEKF2: use common header for optimisation level and irq disable 2015-10-20 15:21:40 +11:00
Andrew Tridgell a017ae7e00 AP_NavEKF2: down to 218us for test[9] 2015-10-20 15:21:40 +11:00
Andrew Tridgell fc23be8025 AP_NavEKF2: enable fine grained perf tuning for mag fusion 2015-10-20 15:21:40 +11:00
Andrew Tridgell b6c1352e4c AP_NavEKF2: added 10 test perf counters
used for fine grained performance tuning
2015-10-20 15:21:40 +11:00
Paul Riseborough 824436dfb6 AP_NavEKF2: Explicitly define constants as floats 2015-10-20 15:21:40 +11:00
Paul Riseborough 2fbd050418 AP_NavEKF2: Use blended accelerometer data
If high vibration levels cause offsets between the two, it switches to the accelerometer with lower vibration levels. The default behaviour is to use the average of both accelerometers.
2015-10-20 15:21:40 +11:00