Commit Graph

407 Commits

Author SHA1 Message Date
Lucas De Marchi 0ccd2de12b AP_AHRS: fix use of undefined macro
../../libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp:63:5: warning: "WITH_GPS" is not defined [-Wundef]
 #if WITH_GPS
     ^

g_gps was not even declared so remove it.
2016-02-19 12:35:20 -02:00
Jonathan Challinger cbf2309023 AP_AHRS: add get_mag_field_NED and get_mag_field_correction 2016-01-23 10:35:36 +09:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Randy Mackay f6b909d0a5 AHRS_NavEKF: resolve compiler warning re signed vs unsigned comparison 2016-01-07 12:31:47 +09:00
Andrew Tridgell f8b52c6a67 AP_AHRS: try to start EKF2 slightly before EKF2
this gives priority to EKF2 on memory
2016-01-07 08:34:32 +11:00
Andrew Tridgell ea823a818c AP_AHRS: enable EKF2 by default in AHRS 2016-01-05 16:42:01 +11:00
Jonathan Challinger 5cb7331095 AP_AHRS: fix example build 2015-12-29 10:46:35 -08:00
Jonathan Challinger a2999ece54 AP_AHRS_NavEKF: add setTakeoffExpected, setTouchdownExpected 2015-12-28 13:51:24 +09:00
Lucas De Marchi a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Andrew Tridgell 6a5c5969fa AP_AHRS: fixed example build 2015-12-27 14:57:32 +09:00
Jonathan Challinger 6682b27456 AP_AHRS: rename get_dcm_matrix to get_rotation_body_to_ned 2015-12-18 18:08:37 +11:00
Julien BERAUD 924a94633d AP_AHRS: Fix build
Due to interdependancy between optical flow and AHRS, it is not possible
to include full class definition which rely on each other
2015-12-18 17:56:06 +11:00
Lucas De Marchi 2b26a2eebe AP_AHRS: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:42 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Andrew Tridgell 1e8c391024 AP_AHRS: fixed float exception on start in SITL
zero DCM matrix
2015-12-01 15:19:45 +11:00
Andrew Tridgell b3e6129fd4 AP_AHRS: added EKF type 10 for SITL
this bypasses all attitude and position estimators and uses the SITL
state directly. It can be used for when the SITL backend cannot
provide perfect sensor data
2015-11-22 17:30:28 +11:00
Andrew Tridgell 7b38f2185f AP_AHRS: use the right DCM matrix for right EKF
this fixes a bug where the EKF2 DCM matrix would be used for
get_dcm_matrix() when EKF1 was active
2015-11-20 18:34:08 +11:00
Caio Marcelo de Oliveira Filho 3a17c858e3 AP_AHRS: use millis/micros/panic functions 2015-11-20 12:29:00 +09:00
Caio Marcelo de Oliveira Filho 4ea45b8df1 AP_AHRS_NavEKF: use millis/micros/panic functions 2015-11-20 12:28:53 +09:00
Caio Marcelo de Oliveira Filho 55e61538b3 AP_AHRS_DCM: use millis/micros/panic functions 2015-11-20 12:28:45 +09:00
Andrew Tridgell 8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Paul Riseborough 803817821d AP_AHRS: Support changes to EKF2 interfaces that specify the instance
An instance of -1 is specified which causes data for the primary instance to be returned.
2015-11-08 15:37:28 +11:00
Lucas De Marchi dd784189a1 AP_AHRS: remove comment about avr-libc 2015-11-04 12:14:16 +11:00
Lucas De Marchi da86e29c27 AP_AHRS: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 124937ab61 AP_AHRS: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Paul Riseborough 7ed36d8e65 AP_AHRS: Enable pre-flight GPS check status reporting for EKF2 2015-11-02 14:12:17 +11:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Randy Mackay 4e959ef6f9 AP_AHRS: constify getLastPosNorthEastReset
Also constify getLastVelNortEastReset
2015-10-30 12:24:13 +09:00
Randy Mackay 7c20577ee0 AP_AHRS: constify getLastYawResetAngle 2015-10-30 12:24:10 +09:00
Paul Riseborough f67f6b01f4 AP_AHRS: Publish the EKF position and velocity reset deltas 2015-10-30 12:24:05 +09: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
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 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
Paul Riseborough 0722ebe8a0 AP_AHRS: Add EKF variance checks 2015-10-20 15:21:38 +11:00
Paul Riseborough ae830b44c4 AP_AHRS: Make EKF2 PosDownDerivative interface follow coding conventions
Updates arising from peer review.
2015-10-20 15:21:37 +11:00
Paul Riseborough e8037f94ad AP_AHRS: Make EKF2 PosDownDerivative interface follow coding conventions
Updates arising from peer review
2015-10-20 15:21:37 +11:00
Paul Riseborough 58d57994f4 AP_AHRS: Rectify coding errors found during peer review
Fixes code that didn't take into account fall-through behaviour of C++ switch statements
Makes get_rigin furnction more generic allowing the consumer to decide what to do with an invalid origin
2015-10-20 15:21:36 +11:00
Paul Riseborough e65ae51564 AP_AHRS: Enable AP_InertialNav to access all EKF functions via AP_AHRS
This patch adds additional methods to the the AHRS library so that the AP_InertialNav library dow nto have to access the EKF directly. This enables Copter to fly using the EKF nominated by AHRS_EKF_TYPE.
It will also pave the way to elimination of the AP_InertialNav library.
2015-10-20 15:21:36 +11:00
Gustavo Jose de Sousa 84f811fe76 AP_AHRS: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:00 +09:00
Andrew Tridgell 232fc8a64d AP_AHRS: added send_ekf_status_report() 2015-09-29 10:58:54 +10:00