From ab50f4c4fa00f196b4b1875bd2c0ac73eea6bc85 Mon Sep 17 00:00:00 2001 From: ChristophTobler Date: Fri, 13 Oct 2017 08:52:57 +0200 Subject: [PATCH 1/4] use distance to ground if on ground an distance is out of range --- src/modules/ekf2/ekf2_main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 833b0a1fe925..765c55ba9349 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -578,7 +578,13 @@ void Ekf2::run() // check if distance sensor is within working boundaries if (range_finder.min_distance >= range_finder.current_distance || range_finder.max_distance <= range_finder.current_distance) { - range_finder_updated = false; + // use rng_gnd_clearance if on ground + if (_ekf.get_in_air_status()) { + range_finder_updated = false; + + } else { + range_finder.current_distance = _params->rng_gnd_clearance; + } } } From b0e1ea2c984a176ece04b5069fb359c8d61c80ca Mon Sep 17 00:00:00 2001 From: ChristophTobler Date: Fri, 13 Oct 2017 08:54:43 +0200 Subject: [PATCH 2/4] update ecl/ekf submodule --- src/lib/ecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecl b/src/lib/ecl index 160e4d69c1ba..a34bba87fcac 160000 --- a/src/lib/ecl +++ b/src/lib/ecl @@ -1 +1 @@ -Subproject commit 160e4d69c1bab6daebedbff2de3c4e08c438eefa +Subproject commit a34bba87fcac1fb02e04bf2202ebc310be808960 From 1eb9358d52b1812a80c9893ad3dd5b1ece54ddf8 Mon Sep 17 00:00:00 2001 From: ChristophTobler Date: Tue, 17 Oct 2017 17:52:01 +0200 Subject: [PATCH 3/4] use get() for BlockParam --- src/modules/ekf2/ekf2_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 765c55ba9349..985c175e8b4e 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -583,7 +583,7 @@ void Ekf2::run() range_finder_updated = false; } else { - range_finder.current_distance = _params->rng_gnd_clearance; + range_finder.current_distance = _rng_gnd_clearance.get(); } } } From dcd24b011482858e2200e7ce9b78ea4be4e7363c Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Wed, 18 Oct 2017 07:12:58 +1100 Subject: [PATCH 4/4] update ecl/ekf submodule --- src/lib/ecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecl b/src/lib/ecl index a34bba87fcac..61e0c0481130 160000 --- a/src/lib/ecl +++ b/src/lib/ecl @@ -1 +1 @@ -Subproject commit a34bba87fcac1fb02e04bf2202ebc310be808960 +Subproject commit 61e0c0481130ec6f07240298bc6a6aff5feb8418