mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 16:21:36 +08:00
ekf2: Move range min/max checks to inside the ecl library
This commit is contained in:
committed by
Paul Riseborough
parent
da2fbf60b5
commit
4e3f7bdcc6
+1
-1
Submodule src/lib/ecl updated: 41953ab582...4d59c834eb
@@ -939,10 +939,9 @@ void Ekf2::run()
|
|||||||
distance_sensor_s range_finder;
|
distance_sensor_s range_finder;
|
||||||
|
|
||||||
if (orb_copy(ORB_ID(distance_sensor), _range_finder_subs[_range_finder_sub_index], &range_finder) == PX4_OK) {
|
if (orb_copy(ORB_ID(distance_sensor), _range_finder_subs[_range_finder_sub_index], &range_finder) == PX4_OK) {
|
||||||
// check if distance sensor is within working boundaries
|
// check distance sensor data quality
|
||||||
if (range_finder.min_distance >= range_finder.current_distance ||
|
// TODO - move this check inside the ecl library
|
||||||
range_finder.max_distance <= range_finder.current_distance ||
|
if (range_finder.signal_quality == 0) {
|
||||||
range_finder.signal_quality == 0) {
|
|
||||||
// use rng_gnd_clearance if on ground
|
// use rng_gnd_clearance if on ground
|
||||||
if (_ekf.get_in_air_status()) {
|
if (_ekf.get_in_air_status()) {
|
||||||
range_finder_updated = false;
|
range_finder_updated = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user