Commit Graph

336 Commits

Author SHA1 Message Date
Peter Barker df60565769 AP_Mission: 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
murata db7fe2ba4e AP_Mission: Change from division to multiplication 2022-03-16 18:41:52 +11:00
Peter Barker f51914ed25 AP_Mission: rename AP_AHRS::get_position to get_location 2022-01-25 10:47:22 +11:00
Randy Mackay c0855a0d1e AP_Mission: add ChangeDetector
Detects changes in the next few nav commands in the mission so SCurves and Splines can handle them elegantly
2022-01-10 08:19:16 +09:00
m c729fc7796 AP_Mission: Decode MAV_CMD_DO_PAUSE_CONTINUE commands 2021-11-25 08:18:27 +09:00
Tom Pittenger 684ad39a02 AP_Mission: PLANE to refuse NAV_SPLINE_WAYPOINT missions items 2021-11-23 11:23:02 +11:00
Peter Barker ff58afd4a2 AP_Mission: move from ENABLE_SCRIPTING to AP_SCRIPTING_ENABLED 2021-11-15 20:27:40 +11:00
Peter Barker 6fef352b8f AP_Mission: ensure ENABLE_SCRIPTING is always defined 2021-11-15 20:27:40 +11:00
Andrew Tridgell ca00eceb98 AP_Mission: support NAV_SCRIPT_TIME 2021-11-08 21:08:52 +11:00
Andrew Tridgell 24f40d9049 AP_Mission: allow for more jump commands on high memory boards
and allow override of maximum in custom hwdef.dat
2021-10-13 12:49:12 +11:00
Peter Barker f07d40a570 AP_Mission: fix infinite loop with nav commands that won't start
Discovered this when trying to run the standard CMAC mission on Sub
2021-09-21 13:42:01 +10:00
Iampete1 d9e30452ed AP_Mission: only continue after land if next waypoint is a takeoff 2021-09-14 08:24:02 +09:00
Iampete1 bc216b103c AP_Mission: remove support for MAV_CMD_DO_SET_MODE 2021-09-13 16:18:24 +10:00
Iampete1 01cbb897e3 AP_Mission: add missing strings 2021-09-13 16:18:24 +10:00
Peter Barker acc595ff57 AP_Mission: fix examples for AP_AHRS_DCM becoming backend 2021-08-31 14:28:53 +10:00
Iampete1 32b3c8ea08 AP_Mission: caculate distance to do_land_start with no location correctly 2021-07-27 09:00:11 +09:00
Michael du Breuil fa7a89ef83 AP_Mission: Cleanup the header to reduce flash cost
Removes unneeded set's of memory that is already zero'd. It also changes
_flags to be all bool to match the actual usage, and removes the width
specifiers from them. This increases the RAM cost of AP_Mission by 4
bytes, but saves on flash. The RAM cost was eliminated by rearranging
members.
2021-06-22 10:08:02 +10:00
Peter Barker fd4fb15e7d AP_Mission: add support for AP_Logger into AP_Periph 2021-06-08 09:57:55 +10:00
James O'Shannessy 1794eefd33 AP_Mission: Fixes crash in copter when uploading MAV_CMD_NAV_LAND with NaN as p4
Uploading a mission created in QGC with MAV_CMD_NAV_LAND (instead of return to launch) results in crash of copter because p4 is not set.
2021-06-02 17:04:38 +10:00
Peter Barker ba970f138d AP_Mission: log auxillary function invocations 2021-04-29 13:00:40 +10:00
Randy Mackay e24f23e076 AP_Mission: add restart_current_nav_cmd 2021-04-03 12:07:59 +09:00
Randy Mackay 2357568eb1 AP_Mission: Mission_Command struct gets comparison operators 2021-04-03 12:07:59 +09:00
Iampete1 849ad8c6de AP_Mission: support MAV_CMD_DO_SEND_SCRIPT_MESSAGE 2021-03-31 19:23:13 +11:00
Peter Barker d4a0222f76 AP_Mission: allow an auxillary function to be triggered as a DO command 2021-03-31 11:36:09 +11:00
Randy Mackay b8d4dbfbb3 AP_Mission: options parameter description per vehicle 2021-03-27 08:20:43 +09:00
murata 6c67e191d4 AP_Mission: Change the description(NFC) 2021-03-18 12:32:59 +11:00
Randy Mackay b873e7fcb0 AP_Mission: read_cmd_from_storage sets all bytes of cmd
This resolves a potential valgrind issue caused by some bytes of the cmd not being set
2021-03-16 10:23:40 +09:00
Randy Mackay fe382e4d10 AP_Mission: minor format fixes 2021-03-09 11:49:42 +11:00
Randy Mackay 3a66b2667b AP_Mission: correct spelling of interrupted 2021-03-09 11:49:42 +11:00
Peter Barker c3b005e1d9 AP_Mission: add mission command to turn sprayer on and off 2021-02-16 22:36:43 +11:00
murata de9382b0f4 AP_Mission: Reflecting the result of the process 2021-02-03 22:15:02 +11:00
Patrick José Pereira 266ed9541b AP_Mission: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-02-03 18:45:14 +11:00
Jaaaky 0e569e5566 AP_Mission: Fix comments for DO_CHANGE_SPEED 2020-12-08 11:54:25 +11:00
Tom Pittenger 043a3ba06e AP_Mission: add accessor for in_landing_flag() 2020-09-17 07:31:43 -07:00
Randy Mackay 1fbc7b99da AP_Mission: add CMD_DO_WINCH string
This is used to send a text message to the GCS as the command starts
2020-08-07 21:55:07 +09:00
auturgy 9aeb456a1d AP_Mission: NFC Correct some comments
Some of the code comments were clearly C&P errors.  This fixes that.  I haven't corrected typos etc, to preserve history.
2020-07-17 09:12:48 +09:00
Andrew Tridgell 7c49723f19 AP_Mission: added continue after land mission option
this allows for option to continue a mission after a landing is
complete. The default in copter was to continue, so adding this
option makes copter not continue by default. Plane already disarmed on
land complete.
2020-06-02 09:12:22 +09:00
Buzz 963b25059d AP_Scripting: allow to get/set/create arbitrary mission items
fetch item/s by their index, and review wp data, etc.  
AP_Mission: ran mission files through approved astyle  as they were non-compliant before this( astyle --options=Tools/CodeStyle/astylerc   )
2020-05-12 09:58:14 +10:00
murata cd981695a6 AP_Mission: Change the tab code to whitespace 2020-04-27 09:29:25 +09:00
Gone4Dirt d813ee27de AP_Mission: Added immediate trigger for DO_SET_CAM_TRIGG_DIST 2020-03-31 10:05:40 +11:00
Gone4Dirt 537a259ab6 AP_Mission: added to rewind mission on resume with MAV_CMD_DO_SET_RESUME_REPEAT_DIST 2020-03-11 09:48:40 +11:00
Peter Hall 46714d69a5 AP_Mission: add get id functions for scripting 2020-02-27 18:07:31 -07:00
Gone4Dirt d813a70c8d AP_Mission: Added force resume for when MIS_RESTART=1 2020-02-25 10:05:12 +11:00
Gone4Dirt 44718cd00f AP_Mission: Check if failsafes should interupt landing approach 2020-02-18 21:03:29 +11:00
Andrew Tridgell 5ae6ad2a59 AP_Mission: make all semaphores recursive
the cost is very similar and this prevents an easy coding error which
can occur on less used code paths
2020-01-19 20:19:30 +11:00
Andrew Tridgell 41353d9357 AP_Mission: fixed build when no AP_Parachute 2020-01-18 13:48:48 +11:00
Peter Barker 140df5b93b AP_Mission: add string for DO_MOUNT_CONTROL 2019-12-10 14:00:30 +11:00
Peter Barker b0ea662c9b AP_Mission: consider _INT frames equivalent to non _INT variants
AP_Mission: consider TERRAIN_ALT_INT equivalent to TERRAIN_ALT

AP_Mission: consider RELATIVE_ALT_INT equivalent to RELATIVE_ALT

AP_Mission: consider GLOBAL_INT equivalent to GLOBAL
2019-12-05 08:03:33 +08:00
Peter Barker aae524b9d5 AP_Mission: add sanity check that 16-bit commands aren't stored_in_location
This is a rather confusing problem when it happens during development,
so a sanity check is good.  What you see in dev is that your latitude
gets corrupted between when you store and retrieve it, with no warnings
that you're doing something wrong.
2019-10-18 15:16:21 +11:00
Peter Barker 405bf0ce7f AP_Mission: adjust for new vehicle base class 2019-10-08 11:26:04 +11:00
Andrew Tridgell dcd9003831 Revert "AP_Mission: Better AUTO watchdog restore"
This reverts commit d774bf3ea5.
2019-08-27 13:18:12 -06:00
Jaaaky d774bf3ea5 AP_Mission: Better AUTO watchdog restore
This allows to run any commands following the last nav_waypoint
that may be required or change flight behavior for following wps
2019-08-25 06:40:34 -06:00
Peter Barker 9cf9497552 AP_Mission: mark MIS_TOTAL as internal-use-only 2019-08-22 09:23:56 +10:00
Tom Pittenger e70ff1b30a AP_Mission: update NAV_DELAY comment that said wrong ID number 2019-08-14 10:45:29 -07:00
Peter Barker b860676f12 AP_Mission: examples: var_info is now in GCS_MAVLINK_Parameters 2019-08-14 18:25:43 +10:00
Michael du Breuil c19e4f2147 AP_Mission: Refactor read_cmd_from_storage for clarity 2019-07-31 09:13:43 +10:00
Andrew Tridgell 5ac2aad2f8 AP_Mission: fixed valgrind error on writing mission items 2019-06-24 18:19:14 +08:00
Peter Barker 1ff3cd442d AP_Mission: fix example by instantiating a GCS object 2019-06-20 13:40:28 +10:00
Peter Barker a7c5f5a6c8 AP_Mission: break out a convert_MISSION_ITEM_to_MISSION_ITEM_INT method
AP_Mission: remove unused mission_cmd_to_mavlink

AP_Mission: eliminate mavlink_to_mission_cmd (use mavlink_int_to_mission_cmd)
2019-05-22 08:53:45 +10:00
Andrew Tridgell 9173989e63 AP_Mission: save waypoint number for watchdog reset 2019-05-15 15:33:48 +10:00
Jaaaky dd4f7e53c3 AP_Mission: Send jump tracking info to GCS
Send jump wp index and jump count to GCS to allow user to track it.
Foramtted as other mission item messages
2019-04-25 16:35:21 +09:00
Peter Barker c6115f4ff3 AP_Mission: add string for spline waypoint 2019-04-16 21:41:58 +10:00
Pierre Kancir 92be1780ac AP_Mission: move get_bearing_cd to Location and rename to get_bearing_to 2019-04-06 09:10:28 +11:00
Michael du Breuil c996dabc12 AP_Mission: Include camera 2019-04-05 20:12:53 +11:00
Peter Barker 30d2a2a4fd AP_Mission: emit mission descriptions as they are run
Also add more mission-type-id to string mappings

Abort in SITL if no description for item
2019-04-02 11:07:58 +11:00
Pierre Kancir b58ded8e0c AP_Mission: use void casting to prevent GCC warning on memcopy 2019-03-26 10:43:23 +11:00
Peter Barker 9ab33fd3c4 AP_Mission: use enum class for AltFrame enumeration 2019-03-19 10:31:18 +11:00
Randy Mackay 1e1f14f6e9 AP_Mission: add text string for do-guided-limits 2019-03-15 14:51:35 +09:00
Randy Mackay f4416cd3f2 AP_Mission: nav-guided-enable command stores location
this allows sending the location to an offboard navigation system
also add text string for nav-guided-enable command
2019-03-15 14:51:35 +09:00
Dr.-Ing. Amilcar do Carmo Lucas fa9a460c30 AP_Mission: replace location_offset() and get_distance() function calls with Location object member function calls
This allows removing duplicated code
2019-02-28 11:44:09 +11:00
Peter Barker 25282c2989 AP_Mission: rearrange for early-exit if command not found for index 2019-02-21 08:31:12 +11:00
Peter Barker 3c3cda81e9 AP_Mission: remove redundant check
get_next_do_command does this check
2019-02-21 08:31:12 +11:00
Peter Barker f5d50935fd AP_Mission: scope variables more tightly 2019-02-21 08:31:12 +11:00
Peter Barker 7da35e9d08 AP_Mission: change while loop out for for loop 2019-02-21 08:31:12 +11:00
Peter Barker c594e51922 AP_Mission: limit memcpy to constant 12 bytes
... essentially to make static analyzers happy
2019-02-20 16:35:55 +11:00
Peter Barker 9cd881b56c AP_Mission: move responsibility for parachute deployment up 2019-02-13 09:25:27 +09:00
Peter Barker 402be4eaca AP_Mission: const writing of commands to storage 2019-01-30 19:20:27 +09:00
Peter Barker 2fa0b61f8b AP_Math: update example/test for Location_Class merge 2019-01-16 11:45:29 +11:00
Peter Barker b12dc3cde7 AP_Mission: adjust for Location_Class and Location unification 2019-01-16 11:45:29 +11:00
Peter Barker 1b2ac38691 AP_Mission: adjust for Location no longer being packed 2019-01-16 11:45:29 +11:00
Michael du Breuil fccf23dff2 AP_Mission: Add a helper to check if a mission contains an item 2019-01-08 10:39:50 +11:00
Peter Barker 59497c4635 AP_Mission: remove unused copy_alt variable 2019-01-03 10:21:31 +09:00
Michael du Breuil 670eaf8782 AP_Mission: Accept and store landing aborts in the mission 2018-12-15 09:03:25 +11:00
Peter Barker a9b94ae13d AP_Mission: use ahrs singleton 2018-11-08 10:01:16 +09:00
Peter Barker 1e39c17908 AP_Mission: return true if cmd-do was handled, false otherwise 2018-10-30 15:37:18 +11:00
Peter Barker b1b5a7868d AP_Mission: handle common camera commands 2018-10-30 15:37:18 +11:00
Peter Barker 51d4b2da34 AP_Mission: move servorelayevents handling into AP_Mission 2018-10-30 15:37:18 +11:00
Peter Barker 182d3634aa AP_Mission: handle gripper mission items 2018-10-30 15:37:18 +11:00
Peter Barker 8ebec6a237 AP_Mission: create start_command and verify_command wrappers 2018-10-30 15:37:18 +11:00
Michael du Breuil 7db5daadad AP_Mission: If a command fails to start immediately cycle to the next 2018-09-11 06:42:00 +10:00
Peter Barker 71bff63bff AP_Mission: remove erroneous comment about clear() 2018-09-04 10:32:26 +10:00
Peter Barker 16b49399db AP_Mission: add singleton 2018-09-04 10:32:26 +10:00
Michael du Breuil e878558d41 AP_Mission: Reduce the number of places _set_cmd is called from 2018-08-28 10:01:36 +10:00
Andrew Tridgell 0289ad03df AP_Mission: added semaphore for thread access 2018-08-25 15:44:36 +10:00
Peter Barker 32bc1860de AP_Mission: starts_with_takeoff_cmd skips past mav_cmd_nav_delay 2018-08-20 14:15:40 +09:00
Peter Barker 9af11d79d1 AP_Mission: remove pointless else clauses 2018-08-20 14:15:40 +09:00
Francisco Ferreira 930981914a
AP_Mission: fix small bug in d5a4c6b 2018-04-26 23:21:29 +01:00
Michael du Breuil d5a4c6b5bc AP_Mission: Sanity check for NaN's and infinities 2018-04-26 14:48:14 -07:00
Lucas De Marchi 25490b6151 AP_Mission: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker beb85e49fb AP_Mission: use baro singleton 2018-03-08 21:20:05 -08:00