Commit Graph

148 Commits

Author SHA1 Message Date
Leonard Hall 993e638752 AC_PosControl: combine xy position control into single method
Also always limit lean angle to maintain altitude
2018-03-16 13:50:57 +09:00
Leonard Hall 74bb7616a7 AC_PosControl: add accel feedforward
also add limit_vector_length and sqrt_controller helper functions
enforce angle limits
rename accel-feedforward to accel-desired
remove freeze_ff_xy
remove unused VEL_XY_MAX_FROM_POS_ERR
remove xy mode
remove jerk limiting code including setters
limit_vector_length uses is_positive
Also modify formatting
2018-03-16 13:50:57 +09:00
Randy Mackay 3badcdcfba AC_PosControl: default gains for sub 2018-01-31 08:48:21 +09:00
Randy Mackay 61933c6f1c AC_PosControl: shorten PSC_ACCELZ param to PSC_ACCZ 2018-01-31 08:48:21 +09:00
Randy Mackay c70d3e0ab8 AC_PosControl: move pids to be local 2018-01-23 12:00:43 +09:00
Randy Mackay 3a73ff1e2e AC_PosControl: replace velocity control with local 2-axis PID 2018-01-23 12:00:43 +09:00
Leonard Hall e249e06714 AC_PosControl: minor enhancement to lean_angles_to_accel 2018-01-20 09:49:58 +09:00
Leonard Hall b9ed8b292a AC_PosControl: pass dt to att control sqrt_controller 2018-01-16 12:13:48 +09:00
Leonard Hall 3e0c24adf9 AC_PosControl: remove out-of-date comments 2018-01-11 21:18:34 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas fa4427fbce AC_AttitudeControl: Add AC_PosControl::get_bearing_to_target() method 2017-12-05 09:17:15 +09:00
Leonard Hall bd284d9fd7 AC_PosControl: correct lean-angle-to-accel formula
Thanks to @luweikxy for finding this issue!
2017-11-24 09:12:00 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas c7c2c4ff2c AC_AttitudeControl: use floating-point multiplication instead of a more expensive floating-point division 2017-10-23 09:20:17 -07:00
Andrew Tridgell 99aad41955 AC_AttitudeControl: added a update_vel_controller_xy() API
this allows for just XY control of velocity for quadplanes
2017-09-09 08:14:09 +10:00
Randy Mackay 3a397584a1 AC_PosControl: z-axis stopping point up to 3m above vehicle
Stopping point while descending remains at 2m for safety
2017-04-28 09:10:02 +09:00
Randy Mackay 132979b12f AC_PosControl: protect against POS_Z_P, ACCEL_Z_P divide-by-zero 2017-03-15 09:22:23 +09:00
Andrew Tridgell 1345bf8737 AC_AttitudeControl: added support for AP_AHRS_View
this allows for tailsitters with a different attitude view
2017-02-18 17:26:43 +11:00
Randy Mackay ff042528fe AC_PosControl: remove alt_max
AC_Avoidance enforces the altitude limit
2017-01-18 09:35:47 +09:00
Pierre Kancir 421524951f AC_PosControl: remove unnecessary parentheses 2016-12-05 10:59:45 -08:00
Randy Mackay 1012333eef AC_PosControl: add ekf position reset handling
Previously this was in AC_WPNav and used only for loiter but it should work for any flight modes that use horizontal or vertical position control
2016-11-24 19:57:56 +09:00
Leonard Hall 42672de606 AC_PosControl: set Alt_Hold filter for PID not just D
We normally don't use the D term here so setting the filter for PID not
just D lets us smooth the throttle response.
2016-10-26 21:00:43 +09: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 5a8db4f271 AC_PosControl: add interface to override horizontal velocity process variable 2016-10-14 10:46:01 +09:00
Jonathan Challinger 77dbf99cee AC_PosControl: fix bug related to ekfNavVelGainScaler 2016-10-11 15:25:59 +09:00
Leonard Hall fdcdcb0033 AC_PosControl: check Z-axis accel imax can always overpower hover throttle
This removes the possibility of the vehicle constantly climbing if the hover throttle becomes a very large value
2016-09-05 14:19:43 +09:00
Leonard Hall 34055944cd AC_PosControl: fix relax_alt_hold_controllers 2016-08-05 12:40:37 +09:00
Jonathan Challinger 630e5378da AC_PosControl: add get_horizontal_error 2016-07-12 18:40:25 +09:00
Andrew Tridgell d1b28aaed9 AC_AttitudeControl: fixed factor of 1000 error in init_takeoff 2016-06-22 11:48:43 +10:00
Leonard Hall dcbb071c07 AC_PosControl: Move hover throttle calculation to AP_Motors 2016-06-18 11:55:49 +09:00
Leonard Hall 1639e22b74 AC_AttitudeControl: set desired_vel for reporting purposes even when not used 2016-06-18 11:55:49 +09:00
dgrat 41661f815f AP_Math: Replace the pythagorous* functions with a variadic template
The new function can deal with a variable number of function parameters.
Additionally, I renamed the functions to norm(), because this is the
standard name used in several other projects.
2016-05-10 11:41:26 -03:00
Andrew Tridgell 23a64e1227 AC_AttitudeControl: fixed accel limit trigonometry
Leonard had mentioned the limit should be tan(angle) not sin(angle). I
noticed this one was wrong.
2016-04-28 16:15:15 +10:00
Leonard Hall c64a505906 AC_PosControl: relax_alt_hold_controllers accepts throttle in 0 to 1 range 2016-04-01 11:59:30 +09:00
Leonard Hall 15be80a25d AC_PosControl: accel_to_throttle outputs 0 to 1 2016-04-01 11:59:30 +09:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Lucas De Marchi 2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
Caio Marcelo de Oliveira Filho ea08b6115d AC_AttControl: use millis/micros/panic functions 2015-11-20 12:27:03 +09:00
Randy Mackay c9340dbeb6 AC_PosControl: run velocity controller z-axis at 400hz 2015-11-18 13:31:21 +09:00
Randy Mackay dbc8ce1d69 AC_PosControl: default z-axis controller to 400hz
No functional change as vehicle code always sets it explicitely
2015-11-18 13:31:20 +09:00
Randy Mackay 323a527734 AC_PosControl: velocity controller uses feed-forward althold 2015-11-18 13:31:19 +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
Randy Mackay 550ba478c9 AC_PosControl: add shift_pos_xy_target 2015-10-30 12:24:08 +09:00
Randy Mackay ee0abb1750 AC_PosControl: add set_jerk_xy 2015-10-29 12:10:44 +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
Leonard Hall cf5db31053 AC_PosControl: allow limiting lean angle to avoid alt loss 2015-09-07 15:10:10 +09:00
Leonard Hall b58cc7ea8d AC_PosControl: move accel constraint to accel_to_lean_angles 2015-09-07 14:51:43 +09:00
Gustavo Jose de Sousa d49f10d2e5 AC_AttitudeControl: 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:41 +10:00
Robert Lefebvre 14882bc6a8 AC_AttitudeControl: Remove unused takeoff jump #define 2015-07-14 20:16:58 +09:00