diff --git a/Tools/check_code_style_all.sh b/Tools/check_code_style_all.sh index eb0c2b7529..a526a0b011 100755 --- a/Tools/check_code_style_all.sh +++ b/Tools/check_code_style_all.sh @@ -16,7 +16,6 @@ find src/ \ -path src/lib/matrix -prune -o \ -path src/modules/attitude_estimator_ekf -prune -o \ -path src/modules/commander -prune -o \ - -path src/modules/ekf2 -prune -o \ -path src/modules/ekf_att_pos_estimator -prune -o \ -path src/modules/mavlink -prune -o \ -path src/modules/mc_att_control -prune -o \ diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index 67d12ef0a6..9c037c3ae1 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -486,7 +486,9 @@ void Ekf2::task_main() if (range_finder_updated) { orb_copy(ORB_ID(distance_sensor), _range_finder_sub, &range_finder); - if (range_finder.min_distance >= range_finder.current_distance || range_finder.max_distance <= range_finder.current_distance) { + + if (range_finder.min_distance >= range_finder.current_distance + || range_finder.max_distance <= range_finder.current_distance) { range_finder_updated = false; } } @@ -522,6 +524,7 @@ void Ekf2::task_main() // read mag data if (sensors.magnetometer_timestamp_relative == sensor_combined_s::RELATIVE_TIMESTAMP_INVALID) { _ekf.setMagData(0, sensors.magnetometer_ga); + } else { _ekf.setMagData(sensors.timestamp + sensors.magnetometer_timestamp_relative, sensors.magnetometer_ga); } @@ -529,6 +532,7 @@ void Ekf2::task_main() // read baro data if (sensors.baro_timestamp_relative == sensor_combined_s::RELATIVE_TIMESTAMP_INVALID) { _ekf.setBaroData(0, &sensors.baro_alt_meter); + } else { _ekf.setBaroData(sensors.timestamp + sensors.baro_timestamp_relative, &sensors.baro_alt_meter); } @@ -822,7 +826,8 @@ void Ekf2::task_main() if (lpos.dist_bottom_valid) { global_pos.terrain_alt = lpos.ref_alt - terrain_vpos; // Terrain altitude in m, WGS84 global_pos.terrain_alt_valid = true; // Terrain altitude estimate is valid - } else { + + } else { global_pos.terrain_alt = 0.0f; // Terrain altitude in m, WGS84 global_pos.terrain_alt_valid = false; // Terrain altitude estimate is valid }