Commit Graph

261 Commits

Author SHA1 Message Date
Peter Barker 12981b1f07 AP_Arming: correct use of failure messages as format strings
This is important as if the returned string happens to contain
substitutions (%s in particular), we can attempt to pull random data
off the stack and incorporate it in the string.

This sort of bug is rather famous for serious explots in sendmail.

This could be bad if your stack is relatively full and the memory after
it is inaccessible.
2019-03-07 14:44:26 +11:00
Randy Mackay 26fd334882 AP_Arming: provide better feedback on attitude check 2019-03-07 09:34:39 +09:00
Randy Mackay b805c40bf7 AP_Arming: add ahrs attitude check 2019-02-22 13:00:07 +09:00
Randy Mackay 72fabb5cd3 AP_Arming: always run compass calibration checks 2019-02-22 13:00:07 +09:00
Tom Pittenger 13f0ad8a1c AP_Arming: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Nigel Williams b2c5d7f04a AP_Arming: Make logging check consider "turned off" as valid
When ARMING_CHECKS has ARMING_CHECK_LOGGING, consider having no
logging backend to be valid.
2019-01-30 19:12:01 +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
Francisco Ferreira de1d02d697
AP_Arming: support KDECAN 2019-01-18 00:57:33 +00:00
Michael du Breuil c4ff1f4307 AP_Arming: Allow disarming to force the safety switch 2019-01-15 08:59:25 +11:00
Pierre Kancir 1bd9b61bf6 AP_Arming: const correctness 2019-01-11 08:38:53 +09:00
Pierre Kancir dd2798d099 AP_Arming: remove unused parameter and variable 2019-01-11 08:38:53 +09:00
Pierre Kancir 0800f72377 AP_Arming: untangle header inclusion 2019-01-11 08:38:53 +09:00
Michael du Breuil c3de3cc923 AP_Arming: Add checks that the mission contains expected items 2019-01-08 10:39:50 +11:00
Michael du Breuil ad01d345d1 AP_Arming: Fix badly formatter airspeed message 2018-12-18 10:11:22 +11:00
Randy Mackay e702ca7202 AP_Arming: resolve compiler warning 2018-11-14 20:40:46 +09:00
Michael du Breuil e56f12b68e AP_Arming: Add servo voltage check, paramertise the Vcc check 2018-11-12 23:29:04 +00:00
Andrew Tridgell 8d5b9521ad AP_Arming: added IOMCU health check 2018-11-07 07:35:45 +11:00
Peter Barker 21eacc5e31 AP_Arming: account for snprintf now null-terminating strings 2018-10-21 07:54:30 +11:00
Andrew Tridgell b1928d959b AP_Arming: fixed build warnings 2018-10-17 12:54:22 +11:00
Michael du Breuil a8741f62f9 AP_Arming: Use AP_BattMonitor's arming checks for the battery 2018-10-09 00:44:46 +01:00
Randy Mackay ba2b9f3d47 AP_Arming: add RUDDER parameter 2018-09-11 19:34:39 +10:00
Peter Barker f258a25138 AP_Arming: remove double PreArm: in battery prearm report
Also use check_failed throughout
2018-08-27 11:12:52 +09:00
Francisco Ferreira 62a4f08e12 AP_Arming: fix system check 2018-08-14 10:17:38 +10:00
Peter Barker eaefdcfac2 AP_Arming: remove min-max-configured pre-arm checks 2018-08-07 09:45:09 +10:00
Peter Barker 1eacd685e3 AP_Arming: use rc() method to get rc singleton 2018-08-01 12:11:30 +09:00
Andrew Tridgell 787493277e AP_Arming: only check trim on valid channel count 2018-07-24 19:44:03 +10:00
Andrew Tridgell 9ca2c11333 AP_Arming: use check_enabled() in storage check 2018-07-10 15:41:44 +10:00
Andrew Tridgell bf1bca6820 AP_Arming: added arming check for storage health 2018-07-10 15:41:44 +10:00
Peter Barker e400a0e351 AP_Arming: use ArmingMethod enumeration 2018-07-03 15:16:38 +10:00
Peter Barker 6979f0d3a0 AP_Arming: remove unused arming_method member 2018-07-03 15:16:38 +10:00
Peter Barker 598f82a2fe AP_Arming: use singletons in AP_Arming 2018-07-03 13:44:11 +10:00
Peter Barker 5d1d435451 AP_Arming: add type-correctness for is-armed check
Also, correct the constant we're testing against
2018-06-28 12:48:31 +10:00
Peter Barker 72d7181e0d AP_Arming: remove pointless initialisations
These are part of a static object
2018-06-28 12:48:31 +10:00
Peter Barker e3dc408295 AP_Arming: move copter-specific code into Copter subclass 2018-06-28 12:48:31 +10:00
Michael du Breuil d977ca091a AP_Arming: Correct an edge case that would not run compass checks 2018-06-26 09:26:29 +10:00
Peter Barker cba61598b1 AP_Arming: a check_failed function 2018-06-23 15:33:19 +10:00
Peter Barker 997a527c1b AP_Arming: cache results of get_gyro_count and get_accel_count 2018-06-21 16:25:29 +01:00
Peter Barker 4055256878 AP_Arming: cache AP_HAL_millis 2018-06-21 16:25:29 +01:00
Peter Barker 410e72f83c AP_Arming: break out a gyros-consistent method 2018-06-21 16:25:29 +01:00
Peter Barker d2b8ea4bb0 AP_Arming: break out an accels-consistent method 2018-06-21 16:25:29 +01:00
Peter Barker d8128ba69a AP_Arming: option to force arm, bypassing checks 2018-06-20 11:43:38 +10:00
Michael du Breuil 81e453dee3 AP_Arming: Restrict GPS/AHRS difference to a 2D solution 2018-05-12 09:11:05 +09:00
Michael du Breuil 7830dab0a8 AP_Arming: Add a servo check that (<= min trim max) for all channels 2018-04-24 01:16:26 +01:00
Michael du Breuil 1b18a78d1d AP_Arming: Add a RC check that (<= min trim max) for all channels 2018-04-24 01:16:26 +01:00
Jacob Walser 2212532028 AP_Arming: Clarify/bring commonality to RC Channels check description 2018-04-12 14:20:49 +09:00
Jacob Walser 409ff66231 AP_Arming: correct parameter description 2018-04-12 14:20:49 +09:00
Peter Barker cc5af90d1a AP_Arming: home state has moved to AP_AHRS 2018-03-19 10:32:37 +09:00
Peter Barker f0d06e7a9c AP_Arming: use ins singleton 2018-03-16 00:37:35 -07:00
Peter Barker 8d8f2208c0 AP_Arming: use baro singleton 2018-03-08 21:20:05 -08:00
Andrew Tridgell 8bb0ad7f3a AP_Arming: check all airspeed sensors are healthy 2018-01-16 07:14:20 +11:00
Peter Barker 738377c089 AP_Arming: remove airspeed arming check bits from non-plane vehicles 2017-12-16 11:08:35 +11:00
Peter Barker a8aa6a7822 AP_Arming: use gps singleton 2017-11-15 13:43:03 +00:00
Peter Barker 25a0e6378e AP_Arming: manual transmitter checks call rc calibration checks 2017-11-08 19:07:57 +09:00
Michael du Breuil ef0b52e017 AP_Arming: Run extra GPS checks when arming 2017-11-06 01:33:57 +00:00
John deVere 951c947bec AP_Arming: update param description for VOLT_MIN 2017-10-30 09:46:51 +09:00
Randy Mackay f029303d96 AP_Arming: check ahrs and gps differ by less than 10m 2017-09-19 10:30:15 +09:00
Michael du Breuil bde1b6e886 AP_Arming: Collapse GPS checks into the same branch 2017-09-13 13:36:40 +01:00
Michael du Breuil 3ab9b75df0 AP_Arming: Check GPS update rate as part of the GPS checks 2017-09-13 13:36:40 +01:00
Jacob Walser b8e7d23cc4 AP_Arming: Add bool check_min_max parameter for Copter/Sub RC checks 2017-08-16 11:37:46 -04:00
Peter Barker 7173025b43 AP_Arming: warn about uncalibrated throttle but do not fail check
We can tighten this check up later, and will allow us to use
this common function for Plane and Rover in the future
2017-08-14 15:32:25 +09:00
Peter Barker b2459c67d5 AP_Arming: move Copter RC checking code into library 2017-08-14 15:32:25 +09:00
Randy Mackay f5f6ec5238 AP_Arming: rename _MIN_VOLT to _VOLT_MIN
Also _MIN_VOLT2 to _VOLT2_MIN
2017-07-31 17:19:55 +09:00
Randy Mackay 2f3a57e0aa AP_Arming: minor variable type change
no functional change
2017-07-31 17:19:55 +09:00
Randy Mackay 330a6065ca AP_Arming: Copter gets MIN_VOLT parameters 2017-07-31 17:19:55 +09:00
Michael du Breuil 126296b61d AP_Arming: Compass calibration running is a pre arm failure, rather then an arming failure 2017-07-21 13:38:50 +09:00
Peter Barker 954eda990a AP_Arming: prepare log for arming and check it is ready
Also add comment that this should be the last check to be made
2017-07-19 16:37:28 +01:00
Peter Barker 999a5e6cda AP_Arming: correct bit used to indicate blended-gps-checking 2017-07-19 16:34:57 +01:00
Peter Barker b8ddf8a289 AP_Arming: use HAL_HAVE_BOARD_VOLTAGE rather than magic-0 2017-07-19 16:34:57 +01:00
Peter Barker 9e76223c34 AP_Arming: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas 9941e910ee AP_Arming: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
Dr.-Ing. Amilcar Do Carmo Lucas 95b09bc19e AP_Arming: fix a spell error in a parameter description
fix { indentation
2017-05-16 20:29:16 +09:00
Andrew Tridgell fafd940dd5 AP_Arming: use compass get_offsets_max() 2017-04-04 00:49:34 +01:00
Randy Mackay 69925d8b27 AP_Arming: shorten Accels failure message
This allow the message to fit on the MP HUD
2017-03-25 10:50:58 +09:00
Randy Mackay f340c118d4 AP_Arming: GPS blending health check renamed 2017-03-13 11:31:51 +11:00
Randy Mackay 4f0333892d AP_Arming: clarify GPS inconsistency message 2017-03-13 11:31:51 +11:00
Randy Mackay 9f21649dc0 AP_Arming: add gps consistency and blend health check 2017-03-13 11:31:51 +11:00
Michael du Breuil be1fd147fc Arming: Remove the SITL protection around GPS configuration, and rely upon the GPS library instead 2017-03-07 12:43:30 +11:00
Michael du Breuil 794f7a969e AP_Arming: Fix up ARMING_REQUIRE param documentation to try and be less confusing 2017-02-15 07:22:11 +11:00
Andrew Tridgell 4626b3a269 AP_Arming: mark ARMING_REQUIRE as plane and rover only 2017-02-14 19:50:01 +11:00
Randy Mackay d35a208dae AP_Arming: remove unused set_enabled_checks 2017-01-17 11:45:08 +09:00
Randy Mackay 593f035c53 AP_Arming: remove required, min-volt, min-volt2 params from Copter 2017-01-17 11:45:08 +09:00
Peter Barker 1f37366c5b AP_Arming: make expected magnetic field strength available to subclasses 2017-01-17 11:45:08 +09:00
Peter Barker 8159c4b747 AP_Arming: add comments on parameters only currently used by plane 2017-01-17 11:45:08 +09:00
Peter Barker 362c6e1b9e AP_Arming: use callback in place of variable reference for home state 2017-01-17 11:45:08 +09:00
murata 86e495f415 AP_Arming: Do not set check results each time. 2016-12-03 20:39:33 +00:00
Peter Barker fff2068a5a AP_Arming: add arming check for logging actually started 2016-11-29 15:14:09 -08:00
Peter Barker 5776b3fddb AP_Arming: check CardInserted in AP_Arming 2016-11-29 15:14:09 -08:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02: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
Matthew Brener 06388b0417 Global: Fix typos 2016-09-17 00:36:36 -03:00
Andrew Tridgell bb65f4df76 AP_Arming: use HAL defined compass offset max if available 2016-09-14 11:53:13 +10:00
Andrew Tridgell 9df58e1e0a AP_Arming: don't show the GPS arming error in SITL
it just makes users think something is wrong
2016-07-27 07:46:04 +10:00
Tom Pittenger 8939c5308f AP_Arming: check actual battery instances then max possible instances 2016-06-02 16:59:19 -07:00
Tom Pittenger ae91804aaa AP_Arming: updated comment for z-axis accel threshold 2016-05-17 16:31:42 -07:00
Tom Pittenger ebd993dabb AP_Arming: updated z-axis accel threshold comment 2016-05-16 13:46:17 -07:00
Jonathan Challinger 0281b948df AP_Arming: loosen accelerometer consistency check on Z axis
Original author @jschall via 88f5d9f858
2016-05-13 17:16:12 -07:00
Ricardo de Almeida Gonzaga f6ad89103c AP_Arming: Fix typos 2016-05-13 19:20:05 -03:00
Michael du Breuil bd6aa982e7 AP_Arming: Fetch GPS configuration failure reason 2016-04-13 11:24:01 -03:00
Andrew Tridgell 692e042eac AP_Arming: set AP_PARAM_NO_SHIFT 2016-03-18 12:33:45 +11:00
Tom Pittenger 5872512d85 AP_Arming: added more info to battery arming failure 2016-03-14 09:16:14 -07:00
Michael du Breuil 21bdf32d33 AP_Arming: Add minimum voltage to arm 2016-03-14 09:06:57 -07:00
Andrew Tridgell b76aff2dcb AP_Arming: allow unconfigured GPS in SITL arming checks
the SITL GPS does not implement the needed protocol negotiation
2016-02-15 07:49:19 +11:00
Michael du Breuil 18f55eccea AP_Arming: Add GPS configuration checks to arming 2016-02-12 00:37:04 -08:00
Andrew Tridgell bc5210d6f2 AP_Arming: don't reporting IMU inconsistencies if IMU not enabled 2016-01-19 18:05:08 +11:00
Tom Pittenger 841f34effa AP_Arming: add param for accel error threshold
This is the threshold error to determine inconsistent accelerometers.
2016-01-02 10:01:46 +11:00
Jonathan Challinger 1482614a7d AP_Arming: add accel cal requires reboot 2015-12-29 10:46:35 -08:00
Michael du Breuil 52666232ed AP_Arming: Allow arming without the hardware safety switch having been pressed
Added an enum to the check type that allows for arming without the hardware switch having been enabled
2015-12-21 17:48:29 +11:00
Luis Vale Gonçalves e9ba768bae AP_Arming: libraries_Text_revision
text revision of messages
2015-11-26 08:08:58 +11:00
Caio Marcelo de Oliveira Filho b8f0beab83 AP_Arming: use millis/micros/panic functions 2015-11-20 12:29:24 +09:00
lvale b601ef2f9e AP_Arming: status text severity to INFO 2015-11-10 13:11:36 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +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
Lucas De Marchi 3114a988f8 AP_Arming: remove check for max INS instances
For all supported boards the maximum number of instances is 3.
2015-10-21 10:05:17 +11:00
Randy Mackay 09aef3a3b8 AP_Arming: remove ahrs check from ins 2015-10-16 13:50:58 +09:00
Randy Mackay 304a23923a AP_Arming: add Bitmask parameter description
Also moved ARMING_CHECK to standard category
2015-10-16 13:50:56 +09:00
Randy Mackay 0cc4b6977e AP_Arming: add compass consistency check
Also moved the offsets and mag field limits into definitions at top of
.cpp file
2015-10-16 13:50:55 +09:00
Randy Mackay 342651cc9b AP_Arming: add board voltage checks 2015-10-16 13:50:54 +09:00
Randy Mackay f5f31e4b31 AP_Arming: move ahrs health check after Accel/Gyro checks
If the AHRS is unhealthy because of accel or gyro problems we want those underlying problem reported first
2015-10-16 13:50:53 +09:00
Randy Mackay 0a21fe65e9 AP_Arming: do not report prearm_failure_reason when ahrs unhealthy
The EKF's prearm failiure message is more related to the position estimate rather than the ahrs's health
2015-10-16 13:50:52 +09:00
Randy Mackay 78c6287f95 AP_Arming: check health of all barometers 2015-10-16 13:50:50 +09:00
Randy Mackay c716bfce88 AP_Arming: remove most exclamation marks 2015-10-16 13:50:49 +09:00
Randy Mackay 6b91beb3ff AP_Arming: formatting changes 2015-10-16 13:50:48 +09:00
Gustavo Jose de Sousa 9a2808a593 AP_Arming: use compass get_{field,offsets}() functions
Both functions are equivalent, so we're going to simply use
get_{field,offsets}() instead of get_{field,offsets}_milligauss().
2015-10-15 19:56:01 +09:00
Grant Morphett 4f01aaf5e3 AP_Arming: fixing up some ARMING_CHECK param doco 2015-10-13 19:53:55 +09:00
Randy Mackay 73e7e64bb8 AP_Arming: remove unused set_skip_gyro_cal 2015-09-21 17:06:29 +09:00
Staroselskii Georgii 375724b319 Arming: use milligauss as compass units 2015-09-09 10:38:16 +10:00
Andrew Tridgell 7e13edd4c7 AP_Arming: use prearm_failure_reason() 2015-09-08 16:07:33 +10:00
Andrew Tridgell b65739a8cc AP_Arming: added severities to send_statustext_all 2015-09-08 14:29:33 +10:00
Andrew Tridgell c48bef1552 AP_Arming: removed the need for the GCS print function 2015-09-08 13:54:25 +10:00
Grant Morphett 3b1844d5c9 AP_Arming: Moved the plane centric arming code into plane
Needed to move the plane centric arming code out of the AP_Arming
library and into the plane vehicle code.
2015-09-07 11:54:21 +10:00
Siddharth Bharat Purohit 6a603eb594 Compass_cal: implement the concept of auto and mandatory user reboot after cal 2015-09-03 16:59:13 +10:00
squilter ddda407ff3 AP_Arming: update severities 2015-08-28 10:04:35 +10:00
Gustavo Jose de Sousa 597562c69c AP_Arming: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:42 +10:00
Andrew Tridgell 54254c89d7 AP_Arming: control rudder arming with ARMING_RUDDER parameter
allow for 3 states:

 0: no rudder arming
 1: arm only
 2: arm and disarm
2015-07-23 21:48:50 +10:00
Andrew Tridgell 69cfe11455 AP_Arming: raise accel arming threshold to 0.75
arming issues due to accel inconsistency are too common
2015-07-17 09:50:19 +10:00
Randy Mackay e080b2acce AP_Arming: use accel_calibrated_ok_all 2015-05-12 16:32:22 +09:00
Andrew Tridgell 2552acbf12 AP_Arming: fixed accel cal test in arming
use a per-imu time of last cal pass, and triple accel threshold for
IMU3. Raise threshold to 0.5 for IMU1/IMU2
2015-05-08 21:01:52 +10:00
Tom Pittenger 8f11507594 Arming: fix compile warnings re float constants 2015-04-24 12:27:05 +09:00
Andrew Tridgell 5acc4c333b AP_Arming: accept accel/gyro if OK in last 10 seconds
this should prevent short periods of movement from triggering arming
status change alarms
2015-03-31 15:37:24 -07:00
Randy Mackay 0344ec5d89 Arming: remove GPS glitch checks 2015-03-13 16:40:43 +09:00
Andrew Tridgell e0a0c3afcf AP_Arming: default to arming required 2015-03-12 12:53:27 +11:00
Andrew Tridgell 4deb136bb0 AP_Arming: require 3D accel cal always 2015-03-12 12:50:28 +11:00
Andrew Tridgell 3a51bac0d0 AP_Arming: use new enum for home_is_set 2015-02-21 10:13:43 +11:00
Andrew Tridgell 4ecd99eb76 AP_Arming: added check for logging available
this is used for refusing to fly without microSD inserted
2015-02-06 19:05:02 +11:00
Andrew Tridgell cabf21194a AP_Arming: improved docs 2015-02-06 08:40:59 +11:00
Andrew Tridgell a2adb9b1b0 AP_Arming: check for AHRS health and calibration for arming 2015-02-01 14:13:57 +11:00
Andrew Tridgell a37f3680e4 AP_Arming: support skip_gyro_cal
also break up arming INS reports, to be clearer for users
2015-01-20 19:47:15 +11:00
Andrew Tridgell 765d833efa AP_Arming: check compass.use_for_yaw() 2015-01-20 11:33:39 +11:00
Andrew Tridgell 850b3b89ea AP_Arming: added INS checks and airspeed checks
this also displays all failing arming checks, not just the first
one. That is more useful for the user
2015-01-20 11:27:13 +11:00