diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-11 16:03:27 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-11 16:03:27 +0200 |
commit | 11d9724563f005ed722d326e8bef125bfec29865 (patch) | |
tree | b2243f46dd8bb43f242912ab7ab152b7674c7a46 /src/modules/commander/state_machine_helper.cpp | |
parent | a118e8dbdd72e23a47841577dfcd7a45007eaedc (diff) | |
download | px4-firmware-11d9724563f005ed722d326e8bef125bfec29865.tar.gz px4-firmware-11d9724563f005ed722d326e8bef125bfec29865.tar.bz2 px4-firmware-11d9724563f005ed722d326e8bef125bfec29865.zip |
Stop warning users just because they shake a bit, be more strict to catch sensor failures or calibration errors in time
Diffstat (limited to 'src/modules/commander/state_machine_helper.cpp')
-rw-r--r-- | src/modules/commander/state_machine_helper.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index ce1bd9ada..363f5e8eb 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -644,14 +644,11 @@ int prearm_check(const struct vehicle_status_s *status, const int mavlink_fd) if (ret == sizeof(acc)) { /* evaluate values */ - float accel_scale = sqrtf(acc.x * acc.x + acc.y * acc.y + acc.z * acc.z); + float accel_magnitude = sqrtf(acc.x * acc.x + acc.y * acc.y + acc.z * acc.z); - if (accel_scale < 9.75f || accel_scale > 9.85f) { - mavlink_log_info(mavlink_fd, "#audio: Accel calib. recommended (%8.4f).", (double)accel_scale); - } - - if (accel_scale > 30.0f /* m/s^2 */) { + if (accel_magnitude < 4.0f || accel_magnitude > 15.0f /* m/s^2 */) { mavlink_log_critical(mavlink_fd, "#audio: FAIL: ACCEL RANGE"); + mavlink_log_info(mavlink_fd, "#audio: hold still while arming"); /* this is frickin' fatal */ failed = true; goto system_eval; |