mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 16:43:33 +08:00
LL40LS: Implement driver-specific filtering based on the datasheet and experiments
This commit is contained in:
committed by
Paul Riseborough
parent
e1f2360560
commit
35bde5c9fc
@@ -941,7 +941,8 @@ void Ekf2::run()
|
||||
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
|
||||
if (range_finder.min_distance >= range_finder.current_distance ||
|
||||
range_finder.max_distance <= range_finder.current_distance) {
|
||||
range_finder.max_distance <= range_finder.current_distance ||
|
||||
range_finder.signal_strength == 0) {
|
||||
// use rng_gnd_clearance if on ground
|
||||
if (_ekf.get_in_air_status()) {
|
||||
range_finder_updated = false;
|
||||
@@ -951,7 +952,7 @@ void Ekf2::run()
|
||||
}
|
||||
}
|
||||
|
||||
_ekf.setRangeData(range_finder.timestamp, range_finder.current_distance);
|
||||
if (range_finder_updated) { _ekf.setRangeData(range_finder.timestamp, range_finder.current_distance); }
|
||||
|
||||
// Save sensor limits reported by the rangefinder
|
||||
_ekf.set_rangefinder_limits(range_finder.min_distance, range_finder.max_distance);
|
||||
|
||||
@@ -1173,6 +1173,7 @@ int Simulator::publish_distance_topic(mavlink_distance_sensor_t *dist_mavlink)
|
||||
dist.id = dist_mavlink->id;
|
||||
dist.orientation = dist_mavlink->orientation;
|
||||
dist.covariance = dist_mavlink->covariance / 100.0f;
|
||||
dist.signal_strength = -1;
|
||||
|
||||
int dist_multi;
|
||||
orb_publish_auto(ORB_ID(distance_sensor), &_dist_pub, &dist, &dist_multi, ORB_PRIO_HIGH);
|
||||
|
||||
Reference in New Issue
Block a user