Commit Graph

268 Commits

Author SHA1 Message Date
Iampete1 74e4466cb4 Plane: use dedicated quadplane function for stick mixing enable 2023-04-25 10:06:50 +10:00
Henry Wurzburg 1415418d6e Plane:Takeoff on rudder arm only after return to neutral 2023-04-25 09:28:45 +10:00
Mirko Denecke eb6c5aa7d3 ArduPlane: remove unused update_transition() definition 2023-04-25 09:10:11 +10:00
Andrew Tridgell 99f997161a Plane: holdoff auto takeoff till rudder neutral
when arming with rudder we need to hold off the takeoff until the user
has released the rudder stick or we can yaw badly during the takeoff
2023-02-09 07:02:32 +11:00
Andrew Tridgell 2989e2deba Plane: added support for NAV_PACKAGE_PLACE mission item
this works in conjunction with a lua script to allow for a wide
variety of package place options
2023-02-09 07:02:12 +11:00
Iampete1 bf9d49b72d Plane: Quadaplane: add param for min QRTL altitude when close to home 2023-01-25 19:34:53 +11:00
Iampete1 a99748a13d Plane: Quadaplane: use land_at_climb_rate_cm only when landing 2022-12-30 20:25:58 +09:00
Peter Hall 148c8d6eec Plane: Quadplane: tiltrotor: add Q_OPTION to keep motors tilted up when disarmed in FW modes 2022-11-29 10:51:23 +11:00
Peter Barker de4dda2d17 ArduPlane: change namespace of MultiCopter and FixedWing params
this stops the libraries knowing anything about AP_Vehicle
2022-11-09 19:04:37 +11:00
Andrew Tridgell 8a0708efe8 Plane: scale VTOL angle P gains with airspeed
During POSITION1 back-transiton we scale the MC angle P gains with
airspeed to reduce the chance of oscillations. At higher airspeeds the
fixed wing controller dominates so we should use the fixed wing angle
P gain.
2022-10-18 07:38:39 +11:00
Michael du Breuil f183b21fc5 Plane: Support vtol landing options on NAV_VTOL_LAND
This allows the same mission to contain both circular and straight
landing items, and doesn't require on the fly tweaking
2022-08-15 17:05:00 -07:00
Iampete1 ee778dbd3a Plane: Quadplane: add option_is_set helper for Q_OPTIONS 2022-08-09 13:21:00 +10:00
Iampete1 821053e580 Plane: Quadplane: allow servo auto trim for motors only tailsitter assist 2022-08-09 10:56:41 +10:00
Andrew Tridgell a1e7072cb1 Plane: cope with overshoot in POSITION1 VTOL land state
when we overshoot run a simple position controller that tries to point
the nose at the landing point and aims for the position2 speed
threshold
2022-08-02 07:49:34 +10:00
Iampete1 2b8958f931 Plane: Fence moved to vehicle 2022-07-27 19:04:56 +10:00
Iampete1 712611c50e Plane: Quadplane: add yaw command model 2022-07-13 18:26:36 +10:00
Andrew Tridgell ae6b877fd3 Plane: added Q_NAVALT_MIN
this is equivalent to copters WP_NAVALT_MIN parameter for takeoff. Not
implemented for land yet

this is useful for vehicles with significant GPS velocity noise on
takeoff, preventing dragging the landing gear
2022-06-03 18:19:53 +10:00
Andrew Tridgell 86c2404654 Plane: increased safety of guided -> auto quadplane takeoff
when we arm in guided mode then enter a special guided_wait_takeoff
state. We keep motors suppressed until one of the following happens

  1) disarm
  2) guided takeoff command
  3) change to AUTO with a takeoff waypoint as first nav waypoint
  4) change to another mode

while in this state we don't go to throttle unlimited, and will refuse
a change to AUTO mode if the first waypoint is not a takeoff. If we
try to switch to RTL then we will instead use QLAND

This state is needed to cope with the takeoff sequence used by QGC on
common controllers such as the MX16, which do this on a "takeoff"
swipe:

  - changes mode to GUIDED
  - arms
  - changes mode to AUTO
2022-05-18 06:43:16 +10:00
Henry Wurzburg 0d01ac389c Plane: add Q_OPTION for RTL always on RC failsafe for ship landing 2022-04-19 19:58:46 +10:00
Peter Barker fd4a00a654 ArduPlane: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over
time, there's no reason for the library headers to include AP_Logger.h
as the logger itself is access by singleton and the structures are in
LogStructure.h

This necessitated moving The PID_Info structure out of AP_Logger's
namespace.  This cleans up a pretty nasty bit - that structure is
definitely not simply used for logging, but also used to pass pid
information around to controllers!

There are a lot of patches in here because AP_Logger.h, acting as a
nexus, was providing transitive header file inclusion in many (some
unlikely!) places.
2022-04-08 19:18:38 +10:00
Andrew Tridgell cc6fc2b130 Plane: improvements to POSITION1 controller
this improves 4 things in the POSITION1 controller based on logs from
4.2.0beta2. The changes are designed to increase the tolerance to
an incorrect value for Q_TRANS_DECEL, reducing landing overshoot

1) we fix the initialisation of the acceleration. The
   init_xy_controller() function assumes zero accel, so we need to
   call set_accel_desired_xy_cmss() just after that init to get the
   correct accel. Thanks to Leonard for this fix

2) if we decel more than expected due to too low Q_TRANS_DECEL we
   need to reduce the target speed, rather than putting the nose down

3) lower the default Q_P_JERK_XY to a value more appropriate for most
   quadplanes (Leonard suggested a value of 2)

4) fixed the pitch envelope from Q_BACKTRANS_MS to start after the
   airbrake phase is complete
2022-03-18 13:36:16 +11:00
Andrew Tridgell 5e14b9efe6 Plane: use pos control for most of LAND_FINAL
this gives more accurate landing with some velocity drift
2022-03-10 07:34:20 +11:00
Andrew Tridgell cc9b9813cb Plane: review fixes
thanks Pete!
2022-03-10 07:34:20 +11:00
Andrew Tridgell f9ecf15973 Plane: setup target accel in POSITION1 state 2022-03-10 07:34:20 +11:00
Andrew Tridgell 3fe9a55269 Plane: added APIs for lua ship landing 2022-03-10 07:34:20 +11:00
Andrew Tridgell 6d63e1f7d3 Plane: added Q_LAND_ALTCHG parameter
this is the threshold height change over 4 seconds for a landing to be
detected. It can be raised if landing detection is very slow
2022-03-09 07:50:10 +11:00
Andrew Tridgell aab6c94936 Plane: don't weathervane in AIRBRAKE state
this prevents unwanted VTOL motor throttle while trying to slow
down. In this stage the slaving of yaw rate to fixed wing roll control
is sufficient
2022-02-16 07:43:01 +11:00
Gone4Dirt a79359dc67 Plane: use new weathervane library 2022-02-08 10:38:16 +11:00
Iampete1 3a5c7ea8fc Plane: quadplane: add transtion fail action param 2022-01-11 11:02:33 +11:00
Iampete1 abe9e4425b Plane: quadplane: remvoe unused loiter initial pitch varable 2021-12-31 08:46:31 +11:00
Hwurzburg 18e427d27d Plane: add Q_OPTION to force fw trans on fail instead of QLAND 2021-12-24 13:55:15 +11:00
Andrew Tridgell 77c43d9ba1 Plane: limiting POS1 landing target speed
prevent very high target speeds when the target velocity profile is
above the initial speed in POSITION1. Always allow up to 2*Q_WP_SPEED,
but don't go above the initial speed
2021-11-24 07:15:21 +11:00
Iampete1 9210488550 Plane: quadplane: limit pitch for all transitions into position control modes 2021-11-17 19:10:56 +11:00
Iampete1 af8688b300 Quadplane: add transiton class 2021-11-02 10:14:36 +11:00
Andrew Tridgell b74dca02ca Plane: avoid qpos approach when very close to destination
this prevents a fwd transition when doing something like LOITER_TIME
close to a VTOL_LAND wp. We use 1.5 times the stopping distance at
cruise airspeed for the threshold
2021-10-29 20:22:19 +11:00
Andrew Tridgell 19b5044223 Plane: fixed VTOL state error when using Q_ENABLE=2
this ensures the poscontrol state is reset if it has not been
initialised before a VTOL loiter operation

thanks to Pete Hall for finding this
2021-10-29 20:22:19 +11:00
Iampete1 73e9c9bb43 Plane: quadplane: forward throttle reutrn float 2021-10-20 18:29:58 +11:00
Peter Barker bcad5a7ba6 ArduPlane: handle renaming of AP_InertialNav_NavEKF to AP_InertialNav 2021-10-20 18:09:36 +11:00
Iampete1 30c9cccf78 Plane: Quadplane remove THR_MIN_PWM and THR_MAX_PWM 2021-10-11 22:19:17 -04:00
Iampete1 1148bb1234 Plane: Quadplane: add loiter to alt then QLAND mode 2021-09-28 09:31:13 +10:00
Andrew Tridgell fd5faa866f Plane: always log QPOS when changing control state 2021-09-27 21:21:53 +10:00
Peter Hall e83b598040 Plane: Quadplane: check attitude relax before running controllers, don't run controls if not going to output 2021-09-25 12:53:11 +10:00
Iampete1 cc89a8cc48 Plane: remove airmode Q_OPTION 2021-09-21 09:36:24 +10:00
Iampete1 c4a1ae42e5 Plane: Quadpalne: move tiltrotor functionality to own class 2021-09-17 08:24:17 +10:00
Peter Barker 3d34e061fe ArduPlane: add and use HAL_QUADPLANE_ENABLED 2021-09-14 11:23:18 +10:00
Iampete1 c73207b4b0 Plane: quadplane: remove init mode and control run methods 2021-09-08 18:06:58 +10:00
Iampete1 f1477a6c29 Plane: quadplane: add assisted flight only airmode 2021-09-01 08:33:24 +10:00
Hwurzburg 551d55a85c ArduPlane: add thr position trigger to ThrLandCtrl Q_OPTION 2021-08-25 12:32:59 +10:00
Iampete1 d372907a98 Plane: Quadplane: add Q_OPTION to only allow arming in Qmodes and auto. 2021-08-24 10:39:12 +10:00
Peter Hall 2527117cf9 Quadplane: combine assistance_needed and assistance_safe functions 2021-08-08 19:41:22 +10:00