mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 18:06:39 +08:00
Commander: Do not switch land detection state when not armed
This is important to have the probation times set up correctly and to silence land detected messages for systems that are not actually flying and just on the bench.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2013-2017 PX4 Development Team. All rights reserved.
|
||||
* Copyright (c) 2013-2018 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -2170,6 +2169,8 @@ Commander::run()
|
||||
if (updated) {
|
||||
orb_copy(ORB_ID(vehicle_land_detected), land_detector_sub, &land_detector);
|
||||
|
||||
// Only take actions if armed
|
||||
if (armed.armed) {
|
||||
if (was_landed != land_detector.landed) {
|
||||
if (land_detector.landed) {
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "Landing detected");
|
||||
@@ -2192,7 +2193,7 @@ Commander::run()
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "Freefall detected");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
was_landed = land_detector.landed;
|
||||
was_falling = land_detector.freefall;
|
||||
|
||||
Reference in New Issue
Block a user