Commit Graph

612 Commits

Author SHA1 Message Date
George Zogopoulos 9a5f81aa95 Plane: Added check for takeoff level-off timeout
When an airspeed sensor is not used, during a takeoff, the pitch angle
is asymptotically driven to 0 as the takeoff altitude is approached.
Some airplanes will then stop climbing and fail to reach altitude.

To prevent an indefinite wait for the takeoff altitude to be reached, a
dedicated level-off timeout has been introduced.
2024-12-04 18:07:30 +11:00
Michelle Rossouw 43fdc9ce19 Plane: Added Quicktune
replaces QAUTOTUNE in default build
2024-11-27 14:07:38 +11:00
Iampete1 52efe952cd Plane: slew limit all throttles in one place 2024-11-19 11:04:37 +11:00
Peter Barker f01abb9d5d ArduPlane: remove stray log_init declaration
this method went away
2024-10-15 10:42:36 +11:00
George Zogopoulos 6ce6ef8fff Plane: Takeoff improvements
- TAKEOFF and AUTO flight modes now should have identical takeoff
- Prevent behaviour switching past climb altitude in TAKEOFF mode.
- Refactor set_pitch_min/max methods.
  Max was already there, now renamed.
  Min is newly introduced.
  behaviour.
- Remove enforcement of min takeoff throttle logic from servos.cpp.
  It is now handled only by takeoff.cpp.
- Take TKOFF_LVL_ALT into consideration in AUTO as well.
- Fixed pitch setpoint when TKOFF_ROTATE_SPD>0.
- Roll navigation in mode TAKEOFF during climb should now work again.
- Now the TAKEOFF loiter waypoint is set by the bearing of the
aircraft while on TKOFF_LVL_ALT, as in the last stable release, instead
of TKOFF_ALT.
- Using TRIM_THROTTLE in takeoffs, when TKOFF_THR_MIN==0
2024-10-02 17:09:07 +10:00
timtuxworth 1133f82799 ArduPlane: use Location::AltFrame for guided_state.target_alt_frame 2024-09-24 22:51:02 +10:00
Andrew Tridgell 83cac93e85 Plane: allow for any orientation of rangefinder for landing
this is principally for tailsitters where rangefinders would be
orientation with RNGFND1_ORIENT=12 (PITCH_180), but also allows for
custom orientations which will be useful if the rangefinder is tilted
forward
2024-09-14 08:39:51 +10:00
Andrew Tridgell 2f19dfef8a Plane: added glider pullup support 2024-09-10 10:15:34 +10:00
timtuxworth f63568b34b ArduPlane: Bindings for crosstrack in Lua 2024-08-20 09:10:42 +10:00
Peter Barker 2632e5b8a6 Plane: use enum class for VTOL approach stage
also namespace it with the state variable which uses this type
2024-08-07 17:52:25 +10:00
Peter Barker c2f5c48fe5 Plane: rename OFFBOARD_GUIDED to AP_PLANE_OFFBOARD_GUIDED_SLEW_ENABLED
and remove comparison vs ENABLED
2024-08-05 10:20:14 +10:00
Peter Barker da562369b5 Plane: remove replace PARACHUTE define with AP_PARACHUTE_ENABLED 2024-08-05 10:20:14 +10:00
Iampete1 55f51eabe8 Plane: move `have_autoenabled_fences` to be private in `ModeTakeoff` 2024-07-30 09:59:01 +10:00
George Zogopoulos 773c91cec1 ArduPlane: Added minimum throttle during TAKEOFF mode
This is a rework so that servos.cpp is responsible for setting the
throttle limits under more circumstances and always notifies TECS when
it does so.

Additionally, the TAKEOFF mode has been improved with a new parameters
TKOFF_MODE and TKOFF_THR_MIN that extend the throttle behaviour.
2024-07-29 15:50:32 +10:00
Henry Wurzburg a6300e35d0 Plane: prevent Mode Takeoff calling fence autoenable more than once 2024-07-24 08:24:06 +10:00
Andrew Tridgell d4f9843e55 Plane: support MAV_CMD_SET_HAGL
allow for external height above ground estimate
2024-07-17 08:03:18 +10:00
Peter Barker c14c2d67d4 ArduPlane: make AP_RANGEFINDER_ENABLED remove more code 2024-07-02 09:17:26 +10:00
Bob Long 5824a12b2e Plane: remove altitude_error_cm variable
This variable updated unpredictably, and it was easy to introduce bugs.
It was not used in many places and is clearer to calculate the error
directly when needed.
2024-05-07 10:52:43 +10:00
Tom Pittenger 1fe7f6b099 Plane: refactor NAV_ALTITUDE_WAIT to AutoMode:: to match nav_delay() 2024-05-02 10:16:00 -07:00
Iampete1 2ee5cdd792 Plane: Quadplane: move Q Assist check into new VTOL assist files. 2024-04-23 09:11:34 +10:00
Peter Barker c6d5bf5706 ArduPlane: fold startup_ground back into caller
remove stale comments around same.

rename method to avoid confusion
2024-04-17 22:18:22 +10:00
Peter Barker 42ce0867ae ArduPlane: move handling of DO_SET_HOME up to GCS_MAVLink base class 2024-04-09 09:35:16 +10:00
Andrew Tridgell a4109c6cf2 Plane: compile in AC_PrecLand for scripting 2024-03-06 09:39:51 +11:00
Peter Barker fcd7c5beb9 ArduPlane: move logger object up to AP_Vehicle 2024-02-13 10:54:29 +11:00
Peter Barker 0bc2c15485 Plane: move AP_Stats to AP_vehicle 2024-01-30 11:12:21 +11:00
Henry Wurzburg 3973c28f15 Plane:add TKOFF_TIMEOUT to MODE TAKEOFF 2024-01-30 11:02:53 +11:00
Andrew Tridgell 17d6192e22 ArduPlane: convert LIM_PITCH_MIN/MAX -> PTCH_LIM_MIN/MAX_DEG 2024-01-23 15:00:30 +11:00
Peter Barker 6ee5ab41fd ArduPlane: allow compilation with HAL_LOGGING_ENABLED false 2024-01-17 18:25:55 +11:00
Iampete1 01c8717308 Plane: ask flight mode if min/max throttle limits should be applied 2024-01-16 11:07:53 +11:00
Iampete1 ab0755d0d8 Plane: rework forward throttle votlage compensation into sub class and split min/max from throttle 2023-12-20 19:28:47 +11:00
Ryan Friedman 2e393bbbc6 ArduPlane: Make set position tgt depend on ext ctrl
* Set position target used to just be used in scripting, now it's used
  by DDS in external control

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-20 02:37:01 +00:00
Ryan Friedman 003c50a13c ArduPlane: add REP-147 Global Position Control
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-12-20 02:37:01 +00:00
Iampete1 21a9f8e3a2 Plane: move landing servo override out of throttle control function 2023-12-12 11:51:33 +11:00
Tom Pittenger b468af81ac Plane: wrap Watt Limiiter in #if AP_BATTERY_WATT_MAX_ENABLED 2023-11-26 11:57:14 +11:00
Iampete1 8061b1b4c2 Plane: move set_servos_idle functionality to ModeAuto 2023-10-31 14:06:22 +11:00
Iampete1 7e4b5b0c97 Plane: rework set_servos_controlled function 2023-10-31 11:18:19 +11:00
Andrew Tridgell c980e0488e Plane: fixed terrain RTL with rally points
this fixes a bug where if the terrain database cache does not have the
tile for the location of a rally point then RTL to the rally point
with TERRAIN_FOLLOW=1 will not track terrain

The underlying issue is that Location::loc.change_alt_frame() will
return false if the location is not in the terrain memory cache. We
can't just extrapolate as the rally point could be in a totally
different terrain area to the current location. So instead we set it
as terrain_following_pending and fix it as soon as the terrain cache
is filled.

fixes https://github.com/ArduPilot/ardupilot/issues/25157
2023-10-14 10:46:00 +11:00
Mykhailo Kuznietsov b7c040e8bc ArduPlane: Fix some typos
Fixed some typos found in the code.
2023-10-12 18:30:42 +11:00
Iampete1 e9fbf6db24 Plane: fix guided heading control anti windup 2023-10-03 11:28:18 +11:00
Peter Barker fc722b5efc AP_Tuning: add and use AP_TUNING_ENABLED 2023-09-21 07:07:58 +10:00
Peter Barker a1b021e833 Plane: move nav_delay state to be private in ModeAuto 2023-09-13 18:08:10 +10:00
Peter Barker 445f1fa272 Plane: handle DO_CHANGE_SPEED as COMMAND_INT 2023-09-12 09:22:36 +10:00
Andrew Tridgell 56dcad3cc2 Plane: dummy AP_ExternalControl implementation 2023-08-22 18:21:23 +10:00
Henry Wurzburg e9414d69ff ArduPlane: add failsafe protections to Mode Takeoff 2023-08-09 17:33:58 +10:00
Iampete1 045cde5fcf Plane: output rudder and steering directly removing steering_control struct 2023-08-05 08:41:05 +10:00
Andrew Tridgell 2e2c7b50ad Plane: cope with home altitude change while navigating
this fixes a bug where a change of home altitude would cause a sudden
height demand change. This copes with 3 situations:

 - flying with AMSL alt demand. Changing home altitude makes for no change
 - flying with AGL alt demand. Changing home altitude requires update of next_WP_loc
 - flying with home relative alt demand. Changing home altitude changes demand at end of current navigation leg
2023-08-05 08:31:02 +10:00
Tom Pittenger 606ef1b269 Plane: is_landing/is_taking_off not to req scripting 2023-07-03 22:44:00 -07:00
Iampete1 61682f6551 Plane: implement FLTMODE_GCSBLOCK bitmask 2023-06-28 12:56:25 +01:00
Henry Wurzburg 3f7f7cd3a1 Plane:remove duplication in setting servos in MANUAL 2023-06-27 11:04:53 +10:00
Tom Pittenger 4eeb1f18d3 Plane: fixup is_landing and is_taking_off members 2023-06-26 06:54:56 -07:00