Commit Graph

234 Commits

Author SHA1 Message Date
Peter Barker 5d49d29c27 AP_AHRS: move wind-estimation-enabled state to frontend 2021-08-18 18:37:39 +10:00
Peter Barker 1cfd9f57ce AP_AHRS: move VehicleClass handling to AHRS frontend
.... and renaming the enumeration while we're at it
2021-08-17 10:34:07 +10:00
Peter Barker 29aed55a74 AP_AHRS: remove pointless zeroing of gyro_estimate vector
This value is assigned to in the following "if" block in both the for
and against cases, and isn't used to determine the new value.
2021-08-12 08:52:24 +10:00
Peter Barker 73bad9fd2d AP_AHRS: move fly_forward flag to front end
This same flag is requested by the DAL so AN_NavEKF2 and AP_NavEKF3 can
use it in their estimates - so AP_AHRS_DCM accessing it via the same
mechanism is not out-of-shape
2021-08-11 15:36:22 -07:00
Peter Barker e9c56a2b0a AP_AHRS: move takeoff/touchdown flags to frontend 2021-08-11 18:45:34 +10:00
Peter Barker ecd488b3c3 AP_AHRS: move trim-related functionality to front end 2021-08-10 09:41:19 +10:00
Peter Barker 7f4a4a99d6 AP_AHRS: move home and origin methods to frontend 2021-08-05 10:37:47 +10:00
bugobliterator 62b6350af1 AP_AHRS: use typename SIM instead of SITL as it conflicts with namespace name 2021-08-05 07:25:31 +10:00
Peter Barker 107e647d00 AP_AHRS: correct compilation under SITL with no EKF3 2021-08-04 18:15:55 +10:00
Peter Barker ca58aa9c5f AP_AHRS: stop using AHRS as conduit for Compass pointer 2021-07-30 12:19:42 +10:00
Peter Barker e4bceb2417 AP_AHRS: move AOA/SSA to AP_AHRS, don't recalc on fetch 2021-07-30 11:23:06 +10:00
Iampete1 9cceb2d5c1 AP_AHRS: update orientation param values 2021-07-28 18:09:05 +10:00
Peter Barker f557d41145 AP_AHRS: rotate quaternions into vehicle body frame
DCM was having it both ways depending on whether it was
primary/secondary.

These are mostly uses for reporting, in which case you would expect the
quaternion to match the eulers.
2021-07-28 17:20:28 +10:00
Peter Barker 5160b4f6ca AP_AHRS: move AP_NMEA_Output to AHRS frontend 2021-07-27 16:55:35 +10:00
Peter Barker 4f9201a160 AP_AHRS: move parameters back into AP_AHRS.h
metadata collection kind of dies otherwise
2021-07-22 21:21:40 +10:00
Peter Barker b7d4166b28 AP_AHRS: rename AP_AHRS_NavEKF.* to AP_AHRS.* 2021-07-22 21:21:40 +10:00
Peter Barker 97b394a5ef AP_AHRS: rename AP_AHRS.* to AP_AHRS_Backend.* 2021-07-22 21:21:40 +10:00
Peter Barker b450a96698 AP_AHRS: shuffle AP_AHRS classes 2021-07-21 21:01:39 +10:00
Peter Barker 0d391533b0 AP_AHRS: remove ability to use DCM as AHRS 2021-07-21 21:01:39 +10:00
Andrew Tridgell cd3ac639fe AP_AHRS: added AHRS_GPS_USE=2 for no baro
this allows DCM to use the GPS instead of the baro for height
2021-07-08 07:56:51 +10:00
Peter Barker 9eeec61cec AP_AHRS: new APIs for takeoff/touchdown expected
timeout handling now in AP_AHRS, and state stored in AHRS and
requested by AP_DAL
2021-06-02 11:13:16 +09:00
Peter Barker 358069df24 AP_AHRS: use ground_course in preference to ground_course_cd 2021-01-26 10:22:28 +11:00
Andrew Tridgell 1ce77111e5 AP_AHRS: allow override of default EKF type 2021-01-20 10:06:45 +11:00
Randy Mackay 1b3ad9cd8d AP_AHRS: use ekf3 by default 2021-01-16 08:24:23 +09:00
Josh Henderson 62ff9a4d4b AP_AHRS: move logging functions to AHRS 2021-01-12 10:13:22 +11:00
Iampete1 d7e8ad1c13 AP_AHRS: add ARSPD_OPTION note to WIND_MAX 2020-10-27 11:21:04 +11:00
Peter Barker ad435dcdbb AP_AHRS: remove unused base-class airspeed_estimate method 2020-08-04 10:08:22 +10:00
Andrew Tridgell f896213770 AP_AHRS: drop rotate prefix on 2D rotates 2020-06-04 09:49:52 +10:00
Andrew Tridgell 393a8785f3 AP_AHRS: implement get_vibration method on AHRS 2020-03-12 08:36:40 +11:00
Peter Hall f6897632f8 AP_AHRS: move to airspeed_estimate with pointer 2020-01-14 22:34:37 -07:00
vierfuffzig 2af0be3947 AP_AHRS: fix custom orientation ToRad conversion 2019-10-01 09:35:09 +10:00
Michael du Breuil 1226eb825a AP_AHRS: Reduce scope of AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 4aa33bec49 AP_AHRS: Remove AP_GPS.h from AP_AHRS.h 2019-06-18 10:02:05 +10:00
Jaaaky fb311208ab AP_AHRS: Fix DCM gndVelADS on groundspeed_vector() with airspeed_use 2019-06-13 16:31:12 +10:00
Francisco Ferreira 869a369cc0 AP_AHRS: support NMEA output 2019-05-21 09:41:15 +10:00
Tom Pittenger a577223ac6 AP_AHRS: rename dataflash to logger 2019-03-28 16:40:57 +11:00
Peter Barker 63e894e7e1 AP_AHRS: rename set_orientation to update_orientation
set_ should be reserved for setters
2019-02-26 10:28:09 +11:00
Tom Pittenger c10fd9cafb AP_AHRS: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Peter Barker 6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Pierre Kancir d87853d93e AP_AHRS: pass vector by const reference 2018-12-22 08:31:32 +09:00
Andrew Tridgell 09dde518df AP_AHRS: fixed dead-reckoning groundspeed vector
this is essential for RTL in planes on GPS loss
2018-11-19 07:32:20 +11:00
Andrew Tridgell 33b26da2eb AP_AHRS: small cleanups
always pass the pitch trim, and removed unusued variables
2018-11-12 17:05:04 +11:00
IamPete1 e1cdf9fe0a AP_AHRS: add trimed view 2018-11-12 17:05:04 +11:00
Peter Barker 9793703a76 AP_AHRS: move Log_Write_Home_And_Origin into AP_AHRS 2018-05-17 10:13:42 +10:00
Jacob Walser 74be9f0bda AP_AHRS: Add support for custom board orientations 2018-04-24 13:04:37 +01:00
Jacob Walser b820da5c6f AP_AHRS: update AHRS_ORIENTATION metadata 2018-04-24 13:04:37 +01:00
Peter Barker 1dabcc473d AP_AHRS: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker dc30197ca7 AP_AHRS: add AP::ahrs() singleton 2018-03-07 12:34:39 +00:00
Andrew Tridgell 0b5e3936fe AP_AHRS: added earth to body 2D rotations 2018-02-08 17:36:33 +11:00
Peter Barker e15442355a AP_AHRS: use GPS singleton 2017-12-27 00:58:02 +00:00
khancyr 2732226664 AP_AHRS: use direct assignation and correct some style 2017-12-18 22:43:59 +00:00
khancyr dae636b39e AP_AHRS: correct some constcorrectness 2017-12-18 22:43:59 +00:00
Samuel Tabor 05492be269 AP_AHRS: clarify scope of AHRS_GPS_USE parameter 2017-11-20 13:53:36 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas 98a43cc4b5 AP_AHRS: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Eugene Shamaev 5c080ce875 AP_AHRS: calculation and reporting of AOA and SSA 2017-04-19 20:48:42 +10:00
Randy Mackay d3aca5544e AP_AHRS: get_gyro_latest returns latest rates from IMU with drift correction
Pulling the gyro values from the IMU allows our rate controllers to run before the EKF
2017-03-03 13:14:28 +11:00
Andrew Tridgell c62c64d27b AP_AHRS: added support for AP_AHRS_View 2017-02-18 17:26:43 +11:00
mirkix d2431dafd0 AP_AHRS: fix description 2017-01-17 18:55:46 +00:00
priseborough 33a7c682a3 AP_AHRS: Add EKF3 and remove EKF1 2016-12-19 08:07:10 +11:00
Peter Barker 9a8d3d6e7c AP_AHRS: add missing parameter metadata 2016-10-27 09:15:03 -07:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Jonathan Challinger e20687fbce AP_AHRS: cache trim rotation 2016-10-13 10:02:14 +11:00
Jonathan Challinger a03fa2d3cf AP_AHRS: use exact matrix for trim rotations 2016-10-13 10:02:13 +11:00
Andrew Tridgell ea823a818c AP_AHRS: enable EKF2 by default in AHRS 2016-01-05 16:42:01 +11:00
Jonathan Challinger 6682b27456 AP_AHRS: rename get_dcm_matrix to get_rotation_body_to_ned 2015-12-18 18:08:37 +11:00
Lucas De Marchi dd784189a1 AP_AHRS: remove comment about avr-libc 2015-11-04 12:14:16 +11: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
Andrew Tridgell 0677c2c80c AP_AHRS: run astyle for formatting 2015-09-23 17:31:00 +10:00
Andrew Tridgell 7ba45444a2 AP_AHRS: added selection of EKF type using AHRS_EKF_TYPE 2015-09-23 11:57:18 +10:00
Grant Morphett b2751d876c AP_AHRS: Fixed spelling error in parameter desc. 2015-09-16 09:33:30 +09:00
Gustavo Jose de Sousa 54d5277842 AP_AHRS: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:42 +10:00
Andrew Tridgell 00ca493860 AP_AHRS: prevent a floating exception in update_trig 2015-05-27 22:10:39 +10:00
Paul Riseborough c2ac80cc63 AP_AHRS: Prevent copter from switching to DCM unless EKF has severe errors 2015-05-13 16:11:13 +09:00
Randy Mackay 6e30093924 AP_AHRS: correct sanity checks on update_trig 2015-04-23 09:45:43 +09:00
Jonathan Challinger 6a6ccb4f32 AP_AHRS: add sanity checks 2015-04-22 21:50:51 +09:00
Randy Mackay 98efcd5f03 AHRS: always use EKF for copter 2015-03-19 15:15:51 +09:00
Andrew Tridgell ed0a56cc3c AP_AHRS: cope with the changed semantics of airspeed.use() 2015-01-20 11:27:58 +11:00
Randy Mackay 9e731550fd AHRS: default EKF on for copter 2014-12-01 17:29:39 +09:00
Andrew Tridgell 26de54c29a AP_AHRS: cope with 90 degree pitch in update_trig()
this prevents a numerical error in Replay
2014-10-25 11:21:04 +11:00
Andrew Tridgell 4ad643b233 AP_AHRS: use a common function for updating the CD values
this ensures the wrapping of yaw is consistent between the 3 use cases
2014-10-15 13:18:08 +11:00
Andrew Tridgell f07e4dee52 AP_AHRS: convert to new GPS API 2014-04-01 06:38:24 +11:00
Andrew Tridgell 0b45d2bc06 AP_AHRS: removed the AHRS_GPS_DELAY parameter
the best value has turned out to be 1, and tweaking it has not turned
out to be useful, so this simplifies the code in preparation for
adding the anti-aliasing handling with multiple accelerometers
2014-02-27 08:57:44 +11:00
Andrew Tridgell 392995ef84 AP_AHRS: make AHRS handle altitude
AHRS now holds the home position
2014-02-15 05:29:47 +11:00
Andrew Tridgell 8c5cde4efd AP_AHRS: allow NavEKF to be enabled at runtime with AHRS_EKF_USE=1 2014-02-15 05:28:10 +11:00
Randy Mackay 3dc6ea682c AHRS: add update_trig
Calculates helper trig values including cos_roll, cos_pitch
2014-02-08 18:16:39 +09:00
Paul Riseborough f2c2811ef3 AP_AHRS & AP_Math: fixed bug in use of AHRS_TRIM parameters 2014-01-19 07:19:43 +11:00
Andrew Tridgell a96840e194 AP_AHRS: changed default GPS lag to 1 sample
this is based on detailed logs from a LEA-6H and NEO-7N
2013-12-30 10:33:48 +11:00
Andrew Tridgell 410d356979 AP_AHRS: make airspeed_estimate const 2013-12-29 18:39:01 +11:00
Andrew Tridgell 56bcda7252 AP_AHRS: lower default roll and yaw drift correction speed
the gyros sustain accuracy over much longer time periods than
previously expected
2013-11-05 14:52:39 +11:00
Andrew Tridgell 02d6f012ce AP_AHRS: added accel sum delay buffer to account for GPS lag 2013-11-04 21:21:42 +11:00
Andrew Tridgell c56017d8f1 AP_AHRS: added in new orientations 2013-08-30 14:19:17 +10:00
Andrew Tridgell 587fb58720 AP_AHRS: fixed license text
APM is under GPL, not LGPL
2013-08-30 13:01:32 +10:00
Andrew Tridgell 57d2dd814d AP_AHRS: added get_position_lag() call
provide position lag to libraries
2013-08-13 12:07:35 +10:00
Andrew Tridgell 0d36832b82 AP_AHRS: use const reference not pointers for locations
this makes life easier for the new AP_Mission library

Pair-Programmed-With: Brandon Jones <brnjones@gmail.com>
2013-08-05 10:24:12 +10:00
Andrew Tridgell ec73fadc45 AP_AHRS: added true airspeed support in AHRS
use true airspeed for wind calculations, and allow other drivers to
ask for the current ratio
2013-07-22 12:50:01 +10:00
Andrew Tridgell b721bcc129 AP_AHRS: removed get_roll_rate_earth() and get_pitch_rate_earth()
these are not used any more
2013-07-13 21:45:58 +10:00
Randy Mackay 7860d06b91 AHRS: typo fix for ORIENTATION param description 2013-07-10 14:56:48 +09:00
Andrew Tridgell 279f6d00f0 AP_AHRS: changes for GPS field changes 2013-07-10 14:04:22 +10:00
Randy Mackay ded31582de AP_AHRS: add Roll90Yaw90 to parameter description
Thanks to Rainer Walther for spotting this
2013-07-07 13:06:40 -10:00
Andrew Tridgell 14628990e6 AP_AHRS: make wind estimation configurable
rover doesn't want it
2013-05-24 11:21:42 +10:00
Randy Mackay b27ddf0f63 AP_AHRS: add parameter descriptions 2013-05-21 15:39:03 +09:00
Andrew Tridgell c08c084191 AP_AHRS: added get_projected_position()
this is used to project the position forward by the GPS lag
2013-05-17 08:32:21 +10:00
Andrew Tridgell a17b85c661 AP_AHRS: use vectors for ground vector complimentary filter 2013-05-13 11:27:55 +10:00
Andrew Tridgell 943a1d8c8d AP_AHRS: added AHRS_GPS_MINSATS option
if the number of visible satellites is below AHRS_GPS_MINSATS then
don't use the GPS for acceleration correction for attitude
2013-05-05 12:48:01 +10:00
Andrew Tridgell ba83950fc4 libraries: replace constrain() with constrain_float()
this makes the type much more obvious. Thanks to Tobias for the
suggestion.
2013-05-02 10:25:40 +10:00
Andrew Tridgell 014c9376e7 AP_AHRS: use const references where possible 2013-04-22 13:26:49 +10:00
Andrew Tridgell a4d25f5a82 AHRS: removed AHRS_BARO_USE option
this option has caused users too much trouble. The vertical velocity
is too noisy from the baro
2013-04-15 10:52:31 +10:00
Andrew Tridgell 87b0fb05ce AHRS: changed default RP and YAW gain to 0.3
this reduces the impact of hard acceleration on takeoff, and reduces
the impact of GPS lag

Note that this doesn't affect copters, as they override to 0.1
2013-04-15 10:52:31 +10:00
priseborough b63d0969b7 AP_AHRS: Addition of a first order complementary filter to AP_AHRS::groundspeed_vector
Addition of a complementary filter to estimation of the ground velocity vector for use by the L1-nav
2013-04-12 12:48:09 +10:00
Andrew Tridgell 05ecb8d8fa AP_AHRS: fixed functions that need to be virtual
functions overridden in a child class need to be marked virtual, or
you get the parent class function
2013-04-12 12:48:08 +10:00
Andrew Tridgell ee81b0f729 AP_AHRS: added wind_correct_bearing() and groundspeed_vector()
these are very useful for navigation libraries
2013-04-12 12:48:08 +10:00
Randy Mackay 24044dc0c4 AHRS: add support for GPS fix type 2D 2013-03-27 11:41:43 +09:00
Randy Mackay 3321db8dde AHRS: limit trim to 10 degrees 2013-02-19 18:50:57 +09:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00
Andrew Tridgell f644a356c9 AP_AHRS: document more rotation combinations 2013-01-13 17:32:48 +11:00
Andrew Tridgell 848fc3e32d AP_AHRS: added AHRS_ORIENTATION parameter 2013-01-13 17:32:48 +11:00
rmackay9 9e5861ccaf AP_AHRS: small fix to parameter comments 2013-01-02 16:08:38 +09:00
rmackay9 77331f6538 AP_AHRS: another attempt at updating the TRIM parameter descriptions 2013-01-02 15:47:59 +09:00
rmackay9 e6c10f4f0b AP_ARHS: add description to AHRS_TRIM parameters 2013-01-02 15:44:42 +09:00
rmackay9 bd0e018ca0 ArduCopter: restore auto-trim method but now use AHRS.add_trim 2013-01-02 09:20:08 +11:00
Andrew Tridgell e282554035 AHRS: removed some debug code 2012-12-20 14:53:23 +11:00
Andrew Tridgell 5840ded767 AHRS: removed constrain() defines 2012-12-20 14:51:34 +11:00
Pat Hickey 9bf69d4e0d AP_AHRS: port to AP_HAL 2012-12-20 14:51:29 +11:00
rmackay9 24317e721b AC_PID, AP_AHRS: added descriptions to some parameters 2012-12-10 22:28:39 +09:00
Andrew Tridgell 1dad9e4e94 AHRS: improved some more doc strings 2012-11-27 15:56:53 +11:00
Andrew Tridgell eb1d5c2c68 AHRS: improved docs for AHRS_GPS_USE
some people are setting this to zero to prevent jitter, which results
in their plane flying off into the distance and never coming back
2012-11-27 15:41:52 +11:00
Andrew Tridgell 5a214acca3 AHRS: changed the docs for AHRS_YAW_P and AHRS_RP_P
a user had set AHRS_YAW_P to zero. Make it clear that zero is not a
good value. MichaelO will change MP to give a warning for a value
below 0.1
2012-11-19 22:50:05 +11:00
rmackay9 83ae8e47be AP_AHRS: replace IMU with INS and add roll and pitch trim 2012-11-07 19:20:32 +09:00
Andrew Tridgell 458a42654b DCM: disable use of baro for vertical accel by default
this has caused problems with too many users
2012-09-20 17:34:32 +10:00
Andrew Tridgell fba1692d69 AHRS: added AHRS_BARO_USE parameter
allow disabling of the use of the barometer for vertical acceleration
compensation
2012-09-12 14:42:04 +10:00
Andrew Tridgell de28cc8b28 AHRS: added AHRS_WIND_MAX option
this allows APM to cope better with airspeed sensor failure, but
ensuring airspeed stays within AHRS_WIND_MAX of ground speed
2012-09-08 11:37:07 +10:00
Andrew Tridgell 2be785899b AHRS: added airspeed_estimate() function
this allows the APM code to use an airspeed estimate for navigation
2012-08-25 17:49:26 +10:00
Andrew Tridgell 134cd51d17 AHRS: moved var_info[] into top level AP_AHRS class 2012-08-21 15:58:09 +10:00