Commit Graph

174 Commits

Author SHA1 Message Date
Peter Barker 4f249db8bc Plane: move responsibility for parachute deployment up 2019-02-13 09:25:27 +09:00
Peter Barker 30671a6743 Plane: move handling of command-int MAV_CMD_DO_SET_HOME up
Plane: eliminate set_home shim around AP_AHRS::set_home
2019-02-13 09:42:26 +11:00
Peter Barker 6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11:00
Peter Barker b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Peter Barker acafb0f3c1 Plane: adjust for location flags being moved out of union 2019-01-16 11:45:29 +11:00
Michael du Breuil 47dfafd670 Plane: Ensure that the plane is an appropriate distance out before starting the approach 2018-12-18 10:11:22 +11:00
Michael du Breuil 05484c3987 Plane: Support a different landing airspeed for fw quadplane landings 2018-12-18 10:11:22 +11:00
Michael du Breuil 1a45755ffd Plane: Support a different landing radius for quadplane fw approach 2018-12-18 10:11:22 +11:00
Michael du Breuil f1154a6e7c Plane: Pass the mission command around rather then fetching it 2018-12-18 10:11:22 +11:00
Michael du Breuil 8e906e0ba0 Plane: Add support for a loiter to alt approach to VTOL landing 2018-11-10 18:58:54 +11:00
Peter Barker 7890fbeaa1 Plane: let AP_Mission handle common camera commands 2018-10-30 15:37:18 +11:00
Peter Barker 1653b34b2b Plane: move servorelayevents mission handling into AP_Mission 2018-10-30 15:37:18 +11:00
Peter Barker dc6a03f5e0 Plane: mission library handles gripper 2018-10-30 15:37:18 +11:00
Michael du Breuil f9e56f9d12 Plane: Respect frame type on VTOL_TAKEOFF commands
allow missioncommands to fail to start
2018-09-11 06:42:00 +10:00
Peter Barker 22306c370b Plane: factor out a Plane::set_home 2018-05-29 14:38:45 +10:00
Peter Barker ad600fff68 Plane: split home-set and home-locked state 2018-05-29 14:38:45 +10:00
Peter Barker 1545b9b161 Plane: remove arguments to send_home and send_ekf_origin 2018-05-17 20:42:36 +10:00
Peter Barker 052b76d017 Plane: move Log_Write_Home_And_Origin into AP_AHRS 2018-05-17 10:13:42 +10:00
Przemek Lekston e5a9ac84e7 [Plane] Fix verify_loiter_heading acceptance criteria. 2018-03-20 10:25:35 -07:00
Peter Barker 7fd859da65 Plane: move home state into AP_AHRS 2018-03-19 10:32:37 +09:00
David Ingraham a6aeebad4b Plane: Add support for AP_Gripper 2018-03-01 14:14:43 +11:00
Peter Barker c5ae01fc6d Plane: use GPS singleton 2017-12-27 00:58:02 +00:00
Tom Pittenger 7271586a47 Plane: invert auto_state.no_crosstrack flag to be auto_state.crosstrack. Non-functional change 2017-11-23 09:25:18 -08:00
Andrew Tridgell af893ddde7 Plane: implement Q_OPTIONS
this allows for NAV_TAKEOFF to be treated as NAV_VTOL_TAKEOFF in
quadplanes, and for level flight to be maintained during quadplane
transitions
2017-10-30 16:30:10 +11:00
Tom Pittenger 8adacfeea3 Plane: always log MODE and include reason when logging is enabled 2017-10-25 21:18:29 +11:00
Randy Mackay 3d7b6ddc40 Plane: support SET_GPS_GLOBAL_ORIGIN message 2017-09-19 10:30:15 +09:00
Peter Barker 2fb46a67dd Plane: camera is responsible for taking distance-based-images and logging 2017-07-28 14:27:53 +01:00
Peter Barker 1be52495f1 Plane: eliminate global static GCS_MAVLINK::send_home_all 2017-07-11 23:48:39 +01:00
Peter Barker 250f315678 Plane: eliminate gcs_send_mission_item_reached wrapper 2017-07-11 23:45:16 +01:00
Peter Barker 3b0a7703c4 Plane: eliminate gcs_send_message wrapper 2017-07-11 23:45:16 +01:00
Peter Barker 5a8f01c19c Plane: use send_text method on the GCS singleton 2017-07-09 17:17:29 -04:00
Michael du Breuil 92cdb54176 Plane: Fix a fly away when aborting a landing
DO_LAND_START -> LAND waypoints in sequence would cause a perpetual abort state
due to the sticky nature of the abort states. If we restart a landing on
purpose while doing an abort, then we can move onto trying to land again.
2017-06-17 09:10:27 +10:00
Michael du Breuil 649ef0fc16 Plane: Only consider a takeoff as begun if the safety switch has been pressed 2017-03-23 16:55:47 -07:00
Michael du Breuil 9e893eacd1 Plane: Change some user facing statustexts 2017-03-08 00:59:56 -08:00
Tom Pittenger 4ccd59f394 Plane: allow exiting loiter_to_alt in cases where you get stuck
- check for scenarios where updrafts can keep you from loitering down indefinitely.
2017-02-23 05:15:49 -08:00
Michael du Breuil 29b16dbafd Plane: Refactor to request relative altitudes from AHRS
Removes the need for plane to do the math for finding the relative height.

Also caches the value at the same time we update current_loc, which is a
non behaviour change as that was the only time you could see a change in
the relative height propegate through the system anyways
2017-02-13 09:23:14 +11:00
Tom Pittenger 9abb0bba7f Plane: use abs() instead of labs() for int16 2017-01-30 10:43:54 -08:00
Michael du Breuil 2326eee9a0 Plane: Move loiter_radius to vehicle 2017-01-30 10:43:54 -08:00
Tom Pittenger 650e694eb1 Plane: move landing.reset to landing.do_land() 2017-01-26 13:11:44 -08:00
Michael du Breuil 3e66dd10d7 Plane: Move landing stages inside AP_Landing and refactor 2017-01-26 13:11:44 -08:00
Tom Pittenger b570c11e26 AP_Landing: allow separate handling for verify_land() vs verify_abort() 2017-01-26 13:11:43 -08:00
Tom Pittenger 9a250c3bf4 Plane: clarify some variable names and protect against divide-by-zero 2017-01-06 17:35:44 -08:00
Eugene Shamaev ac2880db7c Plane: waypoint logic change for overflow/underflow 2017-01-06 17:35:44 -08:00
Tom Pittenger 83f0a8114b Plane: use a common reset for uniform landing wipe 2016-12-14 04:32:30 -08:00
Tom Pittenger b299b9c0bb Plane: abstract out init_start_nav_cnd work to landing lib
This reverts commit 1380a35f70.
2016-12-06 03:45:14 -08:00
Andrew Tridgell 1380a35f70 Revert "Plane: abstract out init_start_nav_cnd work to landing lib"
This reverts commit e2288d5262.

doesn't build
2016-12-06 17:32:02 +11:00
Tom Pittenger e2288d5262 Plane: abstract out init_start_nav_cnd work to landing lib 2016-12-05 18:44:02 -08:00
Tom Pittenger 1b0a263761 Plane: remove landing.cpp entirely 2016-11-25 19:07:30 -08:00
Tom Pittenger 9a79b79f1e AP_Landing: port more from plane 2016-11-25 19:07:30 -08:00
Tom Pittenger f556f705e6 Plane: move various g params to aparms 2016-11-25 19:07:30 -08:00
Tom Pittenger 896b931a7c Plane: Move auto_state variables to AP_landing members 2016-11-25 19:07:30 -08:00
Tom Pittenger 0ffeed644c Plane: remove define RANGEFINDER_ENABLED - always enabled 2016-11-25 19:07:30 -08:00
Tom Pittenger d12a55f33c Plane: fixed spelling
fixed spellling in gcs msg
2016-11-11 01:17:59 -08:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Pierre Kancir 64a2fca812 Arduplane: simply invalid cmd msg 2016-09-27 07:45:48 -07:00
Pierre Kancir 04ee4141e0 ArduPlane: uniformize verify_command
Add all handle message,
Change MAV_CMD_NAV_ROI to MAV_CMD_DO_SET_ROI
Reformate comments,
2016-09-27 07:45:48 -07:00
Andrew Tridgell 33f17588b2 Plane: added auto fence enable on VTOL takeoff
fixes issue#724
2016-08-29 18:04:42 +10:00
Tom Pittenger b187e1f9a6 Plane: add reason to set_mode() 2016-08-17 22:38:54 -07:00
Andrew Tridgell 37f71bc6d6 AP_Mission: support DO_ENGINE_CONTROL 2016-07-25 10:06:03 +10:00
Andrew Tridgell 327a057ee0 Plane: added internal combustion engine support
this allows for automatic engine start and restart
2016-07-25 10:06:03 +10:00
Grant Morphett b8011fd46c Rover|Plane: Just fixing a spelling mistake. 2016-07-22 08:23:07 +10:00
Tom Pittenger 26efd90603 Plane: allow landing height adjustment on wp before land (aka approach wp) 2016-07-20 22:29:31 -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 7af888633d Plane: 3of3 add loiter_xtrack option flag for post-loiter navigation
0 to crosstrack from center of waypoint, 1 to crosstrack from tangent exit location
2016-05-16 11:50:54 -07:00
Ricardo de Almeida Gonzaga 1fad971851 ArduPlane: Fix typos 2016-05-13 19:20:07 -03:00
Andrew Tridgell 12e0012b16 Plane: allow for NAV_LOITER_UNLIM and NAV_LOITER_TIME in quadplane 2016-05-11 15:57:41 +10:00
Andrew Tridgell 691d4b6ca7 Plane: added local reached_loiter_target()
this distinguishes between VTOL and fixed wing loiter targets
2016-05-11 05:55:26 +10:00
Andrew Tridgell 4666b25258 Plane: initial implementation of QRTL for quadplane RTL 2016-04-30 14:34:47 +10:00
Michael du Breuil de1e299754 Plane: Remove support for CONDITION_CHANGE_ALT 2016-04-30 10:56:05 +09:00
Michael du Breuil 731c68f273 Plane: Change mode to RTL on end of mission rather then staying in auto
Deleted commands_process as it had 2 lines of useful code left, and was cleaner to move the remaining two lines into the caller case
2016-04-29 13:12:18 +10:00
Andrew Tridgell 76400a9959 Plane: support DO_VTOL_TRANSITION as a mission item 2016-04-23 21:03:46 +10:00
Tom Pittenger 2ba9a04bf5 Plane: smooth-out the end of takeoff pitch by reducing takeoff pitch min via TKOFF_PLIM_SEC
@Description: This parameter reduces the pitch minimum limit of an auto-takeoff just a few seconds before it reaches the target altitude. This reduces overshoot by allowing the flight controller to start leveling off a few seconds before reaching the target height. When set to zero, the mission pitch min is enforced all the way to and through the target altitude, otherwise the pitch min slowly reduces to zero in the final segment. This is the pitch_min, not the demand. The flight controller should still be commanding to gain altitude to finish the takeoff but with this param it is not forcing it higher than it wants to be. (+1 squashed commits)
2016-04-21 22:54:17 -07:00
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