* 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>
this fixes a bug where TECS maintains its slow integrator while in a
VTOL hover mode in AUTO or GUIDED.
Among other things this affects PAYLOAD_PLACE and
DO_VTOL_TRANSITION. In those states the height can change while
hovering outside the control of TECS. When TECS regains control in a
fwd transition then can lead to a very large height loss or gain until
the TECS integrator can catch up
remove any discrepancy which has crept in over the last few seconds
this also ensures that relative_altitude is updated, and copes with
the EKF refusing the resetHeightDatum call
Brings us in-line with other classes in ArduPilot.
Removes ambiguity with AP_HAL::OpticalFlow which can cause compilation errors as we start to make code more portable across targets
So instead of updating plane.guided_WP_loc and then calling
set_guided_WP(void) to copy that state into plane.next_WP_loc we pass
the new location in the call to set_guided_WP(const Location &loc).
avoidance was the only place which was not entirely over-writing
plane.guided_WP_loc. However, plane.next_WP_loc was updated to be the
current location when we entered guided mode. If we update the
horizontal/vertical avoidance now it is relative to the current
location, not the guided wp location, which could be quite important.
Fix bug introduced in 3d34e061fe which causes flight_stage to be
FLIGHT_NORMAL instead of FLIGHT_TAKEOFF during takeoff stage causing
itself at least the use of THR_MAX and THR_SLEWRATE instead of
respectively TKOFF_THR_MAX and TKOFF_THR_SLEW and perhaps has other
consequences.
Could be really bad if TKOFF_THR_MAX needs to be much higher
than THR_MAX or if TKOFF_THR_SLEW needs to be much lower than
THR_SLEWRATE and cause a crash on takeoff due to low airspeed or torque
roll