diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-19 13:57:07 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-20 09:14:13 +0200 |
commit | 7dbb6c4fa80039bd9c42a83161f18da9033ac40a (patch) | |
tree | 46c5c8263fe1462c8f6d30ca42b85230e0213896 /src/modules/commander/PreflightCheck.h | |
parent | 5c44146c1bf516424aecb187a9c73f5d1b7518d7 (diff) | |
download | px4-firmware-7dbb6c4fa80039bd9c42a83161f18da9033ac40a.tar.gz px4-firmware-7dbb6c4fa80039bd9c42a83161f18da9033ac40a.tar.bz2 px4-firmware-7dbb6c4fa80039bd9c42a83161f18da9033ac40a.zip |
Commander: Improved preflight check routines. Running checks on all connected sensors. Re-run checks once GCS is connected.
Diffstat (limited to 'src/modules/commander/PreflightCheck.h')
-rw-r--r-- | src/modules/commander/PreflightCheck.h | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/src/modules/commander/PreflightCheck.h b/src/modules/commander/PreflightCheck.h index e29357ec9..935f69969 100644 --- a/src/modules/commander/PreflightCheck.h +++ b/src/modules/commander/PreflightCheck.h @@ -43,21 +43,37 @@ namespace Commander { - /** - * @brief - * Runs a preflight check on all sensors to see if they are properly calibrated and healthy - * @param mavlink_fd - * Mavlink output file descriptor for feedback when a sensor fails - * @param checkMag - * true if the magneteometer should be checked - * @param checkAcc - * true if the accelerometers should be checked - * @param checkGyro - * true if the gyroscopes should be checked - * @param checkBaro - * true if the barometer should be checked - * @param checkRC - * true if the Remote Controller should be checked - **/ - bool preflightCheck(int mavlink_fd, bool checkMag, bool checkAcc, bool checkGyro, bool checkBaro, bool checkRC); +/** +* Runs a preflight check on all sensors to see if they are properly calibrated and healthy +* +* The function won't fail the test if optional sensors are not found, however, +* it will fail the test if optional sensors are found but not in working condition. +* +* @param mavlink_fd +* Mavlink output file descriptor for feedback when a sensor fails +* @param checkMag +* true if the magneteometer should be checked +* @param checkAcc +* true if the accelerometers should be checked +* @param checkGyro +* true if the gyroscopes should be checked +* @param checkBaro +* true if the barometer should be checked +* @param checkRC +* true if the Remote Controller should be checked +**/ +bool preflightCheck(int mavlink_fd, bool checkMag, bool checkAcc, bool checkGyro, bool checkBaro, bool checkRC); + +const unsigned max_mandatory_gyro_count = 1; +const unsigned max_optional_gyro_count = 3; + +const unsigned max_mandatory_accel_count = 1; +const unsigned max_optional_accel_count = 3; + +const unsigned max_mandatory_mag_count = 1; +const unsigned max_optional_mag_count = 3; + +const unsigned max_mandatory_baro_count = 1; +const unsigned max_optional_baro_count = 1; + } |