Commit Graph

93 Commits

Author SHA1 Message Date
Andrew Tridgell cb924d1363 AP_L1_Control: make reached_loiter_target() more reliable
if our target loiter radius is unachievable then we can reach the
loiter target on initial capture but be unable to maintain it. This
ensures that once we capture we return true on reached_loiter_target()

This is critical for any mission type where we take an action on
reached_loiter_target() and another condition (such as being lined up
for a waypoint). Otherwise we may continue loitering forever
2024-10-01 07:15:44 +10:00
Peter Barker 42282dab65 AP_L1_Control: remove use of AP_AHRS from most headers
don't need to know the details, just that it is a class
2024-09-03 10:35:54 +10:00
Peter Barker 91fbe46466 AP_L1_Control: make AHRS attitude member variables private 2024-01-14 12:47:47 +11:00
Mark Agate 1769453520 AP_L1_Control: check vehicle yaw (heading) and ground track agree 2023-09-05 10:07:14 +10:00
abaghiyan ae1eb93aec AP_L1_Control: Made changes to avoid zero division in proposed formula
According suggestion from Andrew Tridgell: https://github.com/ArduPilot/ardupilot/pull/24331#discussion_r1267798397
2023-08-01 10:01:47 +10:00
abaghiyan c2f4661b90 AP_L1_Control: Fixed formula in AP_L1_Control::nav_roll_cd
See details here: https://github.com/ArduPilot/ardupilot/issues/24319
2023-08-01 10:01:47 +10:00
Peter Barker 787dc5ccf1 AP_L1_Control: avoid using struct Location
clang reports this could be a problem when compiling under some EABIs.  Remove it from most places as it is just noise, replace with class where we want to avoid including Location.h
2023-02-04 22:51:54 +11:00
jackhong12 4a4f361a17 all: use CLASS_NO_COPY() macro 2022-10-04 11:23:04 +11:00
Tatsuya Yamaguchi 78699e39d5 AP_L1_Control: use AP_GROUPINFO instead of AP_GROUPINFO_FRAME 2022-05-10 09:35:11 +10:00
xianglunkai beb194b4a1 AP_L1_Control: update_waypoint wrap added to nav_bearing
Co-authored-by: Iampete1 <iampete@hotmail.co.uk>
2022-02-16 18:29:48 +11:00
Peter Barker cd88ec65fa AP_L1_Control: rename AP_AHRS::get_position to get_location 2022-01-25 10:47:22 +11:00
murata 23253d0d26 AP_L1_Control: Simplify the decision process by initializing the stack variables 2021-12-11 12:27:40 -08:00
Iampete1 29455adab4 AP_L1_Control: remove SpdHgt and use TECS direct 2021-11-13 08:05:39 +11:00
Patrick José Pereira d006012cee AP_L1_Control: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-02-03 18:45:14 +11:00
murata 2eee8e389d AP_L1_Control: Set the gravitational acceleration value to the defined value 2021-01-05 09:11:14 +09:00
Peter Barker fd9068de8a AP_L1_Control: correct zeroing of cross-track integrator
This routine is generally only called at 10Hz, so the integrator was
regularly reset.
2020-11-05 17:32:38 +11:00
Peter Barker 8ee411e998 AP_L1_Control: wrap_180_cd no longer solely returns floats 2019-09-18 12:57:02 +10:00
Pierre Kancir 25507d4d7b AP_L1_Control: use get_distance_NE instead of location_diff 2019-04-08 08:00:52 -07:00
Pierre Kancir 2efe32e4b1 AP_L1_Control: move get_bearing_cd to Location and rename to get_bearing_to 2019-04-06 09:10:28 +11:00
Peter Barker 4d62c996b7 AP_L1_Control: add missing override keywords 2019-02-22 15:01:09 +00:00
Peter Barker 9324fef92a AP_L1_Control: remove keywords.txt 2019-02-17 00:29:38 -08:00
Michael du Breuil 536a894850 AP_L1_Control: Sanatize loiter radius to prevent bad input from
propegating
2018-12-18 10:11:22 +11:00
Andrew Tridgell 7c57fb0c31 AP_L1_Control: lower default L1 period 2018-08-17 20:42:27 +10:00
Randy Mackay 4f0b26bd48 AP_L1_Control: update_waypoint gets dist_min argument
L1_dist can become extremely short for slow moving vehicles leading to unnecessarily jerk turns after passing waypoints.  This reduces the minimum length along the track that the vehicle will point.
2018-04-05 12:14:59 +09:00
Andrew Tridgell 31092da426 AP_L1_Control: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Randy Mackay 002d3f08f6 AP_L1_Control: update_waypoint zeros xtrack i term on init 2017-11-01 16:46:40 +09:00
Tom Pittenger 39dc608bea AP_L1: update constraint Nu comment to match sourcecode
fixes https://github.com/ArduPilot/ardupilot/issues/7054
2017-10-09 17:01:37 -07:00
Lucas De Marchi 67e02e3c55 AP_L1_Control: add static create method 2017-09-26 03:01:21 +01:00
Michael du Breuil 2894b7cbea L1_Control: Ensure that LIM_BANK passes a sea level sanity check
This fixes #6637 where the LIM_BANK can be set such that the vehicle demands a radius at sea level that is much higher then the loiter radius was configured to be. This effectively feels like a fly away and is due to bad parameters usually. If this happens just fall back to the simple EAS2TAS scaling of the radius.
2017-07-30 12:42:21 -07:00
Dr.-Ing. Amilcar Do Carmo Lucas 5a9baaa8b3 AP_L1_Control: 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
Michael du Breuil 93a18e7dc8 L1: Add loiter radius scaling based upon bank limits at sea level 2017-04-06 08:26:04 +10:00
Peter Barker 755e76ced9 AP_L1_Control: 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
Grant Morphett b56799f444 AP_L1_Control: Adding support for rover's operating in reverse
Mostly invovles sorting out the reverse yaw when travelling backwards.
2016-07-17 08:15:33 +10:00
Tom Pittenger be752164f4 Revert "AP_L1_Control: coverity scan - variables not initialized in constructor"
This reverts commit d558f32142.
2016-07-11 21:59:12 -07:00
Tom Pittenger 5f16d873b8 AP_L1_Control: coverity scan - ignoring get_position() result
- if no GPS location is available, do not continue computing navigation values. Hold old nav/target bearings and allow GPS failsafe to switch modes
2016-07-05 13:32:34 -07:00
Tom Pittenger d558f32142 AP_L1_Control: coverity scan - variables not initialized in constructor 2016-07-05 13:28:52 -07:00
Lucas De Marchi 6f87195eb7 AP_L1_Control: remove tabs and trailing whitespaces 2016-05-10 11:41:26 -03:00
dgrat 6d3b491c02 AP_Math: Replace is_equal with a type safe template function
It makes sense to consider also other floating point types.
2016-05-10 11:41:26 -03:00
Randy Mackay a50f5bfaf8 AP_L1_Control: replace fabsf with labs
resolves a compiler warning
2016-04-23 23:06:25 -07:00
Randy Mackay b2153fb97f AP_L1_Control: remove unused _xtrackVelPos 2016-04-23 23:06:24 -07:00
Tom Pittenger 25c3367341 AP_L1 - add a stale flag
threading bug fix. When a mission wp updates, but the L1 controller had not yet, the data is stale. Example, On Plane when NAV_LAND starts for a moment your xtrack and bearing is most likely bear zero regardless if you have a big turn or not until 10 Hz later when the update() gets called and updates those values with correct values for the new waypoint.
2016-04-21 21:30:57 -07:00
Tom Pittenger 2ce964c8ac AP_L1_Controller: add accessor for xtrack_error_integrator 2016-04-21 21:30:54 -07:00
Andrew Tridgell eb89b5bbb6 AP_L1_Control: prevent possibly fly-away when passed waypoint in L1
if the top level controller doesn't consider a waypoint complete when
we are passed next_WP then it would keep flying away from the line
segment. This doesn't happen with the current master code, but we want
to ensure it is handled
2016-03-18 13:47:44 +11:00
Lucas De Marchi 7ad0036a11 AP_L1_Control: replace header guard with pragma once 2016-03-16 18:40:41 +11: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
Andrew Tridgell 640332113c AP_L1_Control: calculate dt for crosstracking 2016-01-19 11:05:56 +11:00
Don Gagne e891ae8a89 AP_L1_Control: fix invalid Range meta data 2015-12-27 16:10:44 +11: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
Lucas De Marchi 266bb3b759 AP_L1_Control: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:12 +11:00