Commit Graph

30 Commits

Author SHA1 Message Date
Andrew Tridgell 4da3236c07 Plane: separate out landing height adjustment from barometer changes
this stores a landing height adjustment for an aborted landing
without adjusting barometer readings, applying them only on landing
2016-07-20 22:04:21 -07:00
Tom Pittenger 601ab9dad0 Plane: remove GCS send_statustext spam
Plane: remove GCS send_statustext spam when recalculating glide slope
2016-07-18 18:56:59 -07:00
Tom Pittenger 6746b4227a Plane: handle large negative baro offsets (corner case) to self-trigger a land-abort go-around
new param: LAND_ABORT_DEG
@Description: This parameter is used when using a rangefinder during landing for altitude correction from baro drift (RNGFND_LANDING=1) and the altitude correction indicates your altitude is higher than the intended slope path. Steeper slopes can result in crashes so this allows the option to remember the baro offset and self-abort the landing and come around for a another landing with the correct baro offset applied for a perfect slope. An auto-abort go-around will only happen once, next attempt will not auto-abort again. This operation happens entirely automatically in AUTO mode. This value is the delta degrees threshold to trigger the go-around. Example: if set to 5 deg and the mission planned slope is 15 deg then if the new slope is 21 then it will go-around. Set to 0 to disable. Requires LAND_SLOPE_RCALC > 0.
2016-05-17 15:41:09 -07:00
Tom Pittenger a1c4103cef Plane: print to GCS the newly calculated glide slope angle 2016-05-17 15:39:05 -07:00
Tom Pittenger f048aafb76 Plane: store auto land slope
- also changed order of landing slope calc but is functionally the same
2016-05-17 15:39:05 -07:00
Tom Pittenger 034cd2413e Plane: re-calc landing glide slope to gracefully handle baro offset during long flights
New param: LAND_SLOPE_RCALC
@Description: This parameter is used when using a rangefinder during landing for altitude correction from baro drift (RNGFND_LANDING=1) and the altitude correction indicates your altitude is lower than the intended slope path. This value is the threshold of the correction to re-calculate the landing approach slope. Set to zero to keep the original slope all the way down and any detected baro drift will be corrected by pitching/throttling up to snap back to resume the original slope path. Otherwise, when a rangefinder altitude correction exceeds this threshold it will trigger a slope re-calculate to give a shallower slope. This also smoothes out the approach when flying over objects such as trees. Recommend a value of 2m.

default value is 2 (so, enabled by default)
2016-05-17 15:39:04 -07:00
Tom Pittenger 9aa25cb7a0 Plane: update flight stage on successful restart_landing_sequence() 2016-04-21 22:54:23 -07:00
Tom Pittenger f12658dd20 Plane: more comments on landing flare 2016-04-21 21:31:01 -07:00
Tom Pittenger fefcf39335 Plane: must be on land approach before flare alt/sec are used 2016-04-21 21:31:00 -07:00
Tom Pittenger 12663eaa48 Plane: simplify flare logic 2016-04-21 21:30:59 -07:00
Grant Morphett 2887e48178 Plane: Fixed bug with landing flare for high values of LAND_FLARE_SEC
I had an issue in SITL where my plane would round the last WP staring
its landing approach and immediately limit the roll to 5degress even
before the plane had finished turning the corner so it would go WAY
off course.  For a high value of LAND_FLARE_SEC (mine was 5) the math
works out the plane has landed if
    height <= sink_rate * land_flare_sec
During the banking of the last corner the plane started to decend and
quickly set itself up for a 6.1m/s sink rate which is normal.  It was
at 30 meters altitude.  As you can see at this point the math thinks
the plane has landed so limits the roll.  The solution was to ensure
the plane had covered at least 50% of the distance toward the final
waypoint before allowing a flare to happen.  Note that LAND_FLARE_SEC
above 2 is considered very high and this normally wouldn't occur.
2016-04-15 13:02:11 +10:00
Tom Pittenger 2e92089ce6 Plane: Reverse Thrust
Reverse thrust for controlled landings, even with much steeper approach slopes. This is achieved by allowing throttle demand to go negative to maintain a target airspeed. A Pre-Flare stage was added, triggered by an altitude, to allow for a slower airspeed just before land. That lower airspeed can be near stall.
new params LAND_PF_ALT, LAND_PF_SEC, LAND_PF_ARSPD, USE_REV_THRUST
2016-02-09 14:18:02 +11:00
Tom Pittenger b8d5369ebd Plane: add flight stage LAND_PREFLARE 2016-02-09 14:18:02 +11:00
Tom Pittenger 0bfe235d6b Plane: use abort landing logic with mavlink GO_AROUND cmd
- also enabled use of CMD_DO_GO_AROUND altitude param
2015-12-31 15:34:41 +11:00
Luis Vale Gonçalves b7f3782e4e Plane: Text revisions
text revisions
2015-11-26 07:56:52 +11:00
lvale e18181e5c2 Plane: Uniformization of severities
Plane uniformization of severities
2015-11-09 09:38:25 +11:00
Lucas De Marchi 84da1f5039 Rename gcs_send_text_P to gcs_send_text 2015-10-30 14:35:07 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Andrew Tridgell 86e8c7ed2f Plane: add some safety to detect bad lidar readings
we only accept a lidar if it changes by 5% of its full range, and we
reject a lidar again if the correction between barometric and lidar
range changes by more than 30m

This allows us to cope with faulty lidars which may give a constant
reading
2015-09-16 14:24:44 +10:00
Tom Pittenger fc2c94f78f Plane: utilize NAV_CONTINUE_AND_CHANGE_ALT for land abort
when aborting a landing via mode change, check if NAV_CONTINUE_AND_CHANGE_ALT is after LAND. If so, go ahead and execute it. Else, normal behavior or check do_land_start else decrement mission index
2015-09-09 09:32:31 +10:00
Tom Pittenger 25da4ec0ea Plane: added flight stage FLIGHT_LAND_ABORT and abort mechanism
- enabled via new param LAND_ABORT_THR default is 0 (disabled)
- Triggered via 95% throttle during landing, a landing abort will take place.
- This copies all takeoff params for right now, we can make this better later if needed
- added mission item command to NAV_LAND which is the abort takeoff altitude. If 0 then use last takeoff if available, else use 30m
- hold heading, just like takeoff, until altitude is reached
- pitch is constrained to takeoff pitch, or else 10deg if not available
- After abort altitude is reached, the normal landing restart happens (DO_LAND_START or decrement mission)
- restart landing by jumping to DO_LAND_START or decrement mission on mode change
2015-09-09 09:04:24 +10:00
Tom Pittenger 81f8358705 Plane: restart landing by jumping to DO_LAND_START or decrement mission
only takes effect on mode change
2015-08-29 21:17:35 +10:00
squilter 583c087eca Plane: update severities 2015-08-28 10:04:35 +10:00
Tom Pittenger ee9a66bd02 Plane: fix compiler warning re double promotion 2015-08-25 16:45:52 +09:00
Tom Pittenger f1eb2f88df Plane: post "Distance from LAND point" on every land
- waits until disarm after a land
2015-08-18 17:20:20 +10:00
Grant Morphett c87929e907 Plane: Fix landing to stop divide by zero if params are 0
If someone mistakenly puts all 0's in their LAND command then
total_distance will be calculated as 0 and cause a divide by 0 error
below thus crashing ArduPilot.  Lets avoid that.
2015-08-03 09:53:48 +10:00
Andrew Tridgell 358a13261c Plane: moved sink_rate calculation to update_alt()
this makes it available to non-landing code
2015-06-15 09:20:55 +10:00
Andrew Tridgell 554869033f Plane: disabled rangefinder on APM2
this saves 5k of flash space, enough for support to be kept for
another release
2015-05-21 07:48:53 +10:00
Andrew Tridgell b92c2409e4 Plane: added local millis() and micros() to reduce code size a bit 2015-05-21 07:48:53 +10:00
Andrew Tridgell 18c37935c9 Plane: convert from .pde to .cpp files 2015-05-21 07:48:52 +10:00