Commit Graph

202 Commits

Author SHA1 Message Date
Tom Pittenger 183369b92a Plane: take advantage of L1 stale flag and correctly inhibit flight stage if not lined up on approach 2016-04-21 21:30:58 -07:00
Tom Pittenger 6a83ad419a Plane: moved update_flight_stage() inside setup_glide_slope()
the glide_slope gets calculated every time there's a major event such as mission item change or wp_proportion change so its good to update the flight stage then too because.
also logging stage when stage changes, might as well get an extra data point in there when it's timely
2016-04-21 21:30:51 -07:00
Andrew Tridgell 2a1985d0f9 Plane: fixed loiter radius at end of mission 2016-04-21 22:29:29 +10:00
Tom Pittenger 6718241dad cleanup comments 2016-03-29 05:32:28 -07:00
Tom Pittenger f3638f421e Plane: fix short loiters exiting early 2016-03-10 15:42:18 +11:00
Tom Pittenger bf5005103c Plane: allow loiter waypoints to have a zero lat/lng or alt to mean use current 2016-03-02 08:49:11 -08:00
Tom Pittenger be3941efdf Plane: unify loiter mission items to require heading to next wp
- except loiter_unlimited because it never exits
2016-03-02 08:48:25 -08:00
Tom Pittenger 9e452838ab Plane: loiter missions to default to loiter_radius if mission says 0 or 1.
- except loiter_unlim which uses RTL_loiter, although I'm not sure why.
2016-02-29 10:12:20 -08:00
Tom Pittenger ed98617d42 Plane: utilize radius for loiter commands 2016-02-29 06:43:29 -08: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
Andrew Tridgell 8dba91658c ArduPlane: log a picture if AP_Camera::control() returns true 2016-01-29 10:01:51 +11:00
Andrew Tridgell d82c8dcd6d ArduPlane: update for changed AP_Camera API 2016-01-29 09:19:44 +11:00
Dario Lindo Andres 9bba55f937 ArduPlane: Added precise camera trigger logging
Added update_trigger and check_digital_pin functions
added camera trigger precise time mark
detect camera feedback pin status
added support for simple digital pin
included support for digital pin. Already included in
added support for TRIGGER MSG
2016-01-29 09:19:43 +11:00
Andrew Tridgell 23eef91c59 Plane: added parameter RTL_RADIUS
this allows the loiter radius for RTL to be controlled separately from
the radius for loiter (as requested by a user)
2016-01-19 15:04:30 +11:00
Andrew Tridgell 70018ee0cb Plane: fixed final descent for VTOL auto landing 2016-01-09 07:38:54 +11:00
Andrew Tridgell f068a8c913 Plane: added support for VTOL_TAKEOFF and VTOL_LAND commands 2016-01-09 07:38:53 +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
Luis Vale Gonçalves b7f3782e4e Plane: Text revisions
text revisions
2015-11-26 07:56:52 +11:00
Caio Marcelo de Oliveira Filho c8888329e1 Plane: use millis/micros/panic functions 2015-11-20 12:26:40 +09:00
lvale e18181e5c2 Plane: Uniformization of severities
Plane uniformization of severities
2015-11-09 09:38:25 +11:00
Tom Pittenger 178bbb080b Plane: improve crosstrack error while navigating to loiter point
There is no crosstrack concept in the loiter navigation so when going from waypoint to loiter you will not converge onto the line between those two points. This commit adds crosstracking by performing normal waypoint navigation until you get near it.
2015-11-09 08:25:26 +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 9affddcaa3 Plane: initial support for AP_Parachute library 2015-10-27 16:06:34 +11:00
Randy Mackay d54e28e129 Plane: send home position when home is set or get-home msg received 2015-10-03 12:56:27 +09:00
Andrew Tridgell d019f83bee Plane: allow for higher roll limits on takeoff
only restrict to LEVEL_ROLL_LIMIT below 5m. Above that start to allow
larger roll limits, reaching the full roll limit at 15m
2015-09-17 15:35:37 +10: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
squilter 7365701d13 Plane: Support do_digicam_x via command_long 2015-09-16 13:06:51 +09:00
Andrew Tridgell 0cc165308d Plane: use 4 degrees if zero takeoff pitch 2015-09-09 09:13:12 +10:00
Tom Pittenger d36ee786e4 Plane: init hold_course in do_takeoff 2015-09-09 09:04:24 +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 6e55b44b63 Plane: change NAV_CONTINUE_AND_CHANGE_ALT behavior
Use waypoint bearing if available, otherwise use gps projected ahead 1km else yaw
Perform update before making decision to finish cmd so it always executes
2015-09-08 17:05:54 +10:00
Randy Mackay 4bf36d787b Plane: use labs for int32 values 2015-08-28 13:14:50 +10:00
squilter 583c087eca Plane: update severities 2015-08-28 10:04:35 +10:00
Tom Pittenger fed50aa5c5 Plane: is_crashed flag gets reset too easily
This behavior is excessively paranoid about clearing the flag so now it's extra sticky. You can only clear the is_crashed flag when:
- changing modes
- starting to execute a takeoff wp (if mission/index gets reset while still in auto)
- while in takeoff and throttle is suppressed it's held false

behavior that was removed:
- clear flag when starting to execute any nav cmd (reached next wp)
- if while crashed, you "start flying again" (non-sticky)
2015-08-24 20:00:12 +10:00
Tom Pittenger 204ff7b158 Plane: move statics into new struct
removed default case statements
2015-08-23 10:34:18 +10:00
Tom Pittenger da8f4f9e95 Plane: reworked is_flying
add crash detection, allow disengage via param CRASH_DETECT
improved is_flying behavior
take off, landing and hard-landing improvements
add stillness check to is_flying and log it
minimum airspeed is determined ARSPD_FBW_MIN*0.75
2015-08-23 10:34:18 +10:00
Michael Day f20beecb0b Plane: Climb/descent "intent" param with CONTINUE_AND_CHANGE_ALT
Param 1 of CONTINUE_AND_CHANGE_ALT now denotes which direction the
user expects the plane to travel when changing altitude:

0 = no expectation, command completes when within 5 m of altitude.
1 = climb expected, command completes at or above altitude.
2 = descent expected, command completes at or below altitude.
2015-08-20 11:37:17 +10:00
Tom Pittenger 86e3116fb6 Plane: implement try send mission_item_reached
clean up unreachable code
2015-08-19 15:42:07 +10: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
Andrew Tridgell 1b13be4ad7 Plane: disable camera logging when camera support disabled 2015-07-30 12:17:48 +10:00
Przemek Lekston 6a62b11536 Plane: fix LOITER_TO_ALT to verify headings towards waypoints within the loiter radius.
Whenever next waypoint is within the loiter radius, maintaining loiter would prevent us from ever pointing toward the next waypoint. Hence for very close waypoints loiter_to_alt becomes verified by the altitude only.
2015-07-23 15:24:43 +10:00
Randy Mackay 76ccf4043e Plane: log ahrs home and ekf origin 2015-07-06 12:11:56 +09:00
Tom Pittenger f1ee129423 Plane: compiler warnings
- float to double in gcs_send_test (x2)
- float to bool
2015-07-06 09:30:19 +10:00
Peter Barker 3fce7eb21a Plane: use common mission logging code 2015-06-30 16:23:35 +10:00
Andrew Tridgell ae1f2e8bea Plane: fixed missing break statement 2015-06-20 12:35:07 +10:00
Andrew Tridgell 76c0293a85 Plane: added support for DO_AUTOTUNE_ENABLE 2015-06-15 09:20:55 +10:00
Andrew Tridgell d5c5400e76 Plane: added support for ALTITUDE_WAIT mission command 2015-06-15 09:20:55 +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 97687f04af Plane: enable messages for MAVLink gimbal support 2015-05-26 08:30:30 +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