mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 23:40:35 +08:00
lpe: check for distance sensor orientation
This commit is contained in:
committed by
ChristophTobler
parent
ee82e80517
commit
bfe28c1df3
@@ -235,17 +235,17 @@ void BlockLocalPositionEstimator::update()
|
||||
|
||||
if (s->get().timestamp == 0) { continue; }
|
||||
|
||||
if (s->get().type == \
|
||||
distance_sensor_s::MAV_DISTANCE_SENSOR_LASER &&
|
||||
if (s->get().type == distance_sensor_s::MAV_DISTANCE_SENSOR_LASER &&
|
||||
s->get().orientation == distance_sensor_s::ROTATION_DOWNWARD_FACING &&
|
||||
_sub_lidar == nullptr) {
|
||||
_sub_lidar = s;
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sLidar detected with ID %i", msg_label, i);
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Lidar detected with ID %i", msg_label, i);
|
||||
|
||||
} else if (s->get().type == \
|
||||
distance_sensor_s::MAV_DISTANCE_SENSOR_ULTRASOUND &&
|
||||
} else if (s->get().type == distance_sensor_s::MAV_DISTANCE_SENSOR_ULTRASOUND &&
|
||||
s->get().orientation == distance_sensor_s::ROTATION_DOWNWARD_FACING &&
|
||||
_sub_sonar == nullptr) {
|
||||
_sub_sonar = s;
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sSonar detected with ID %i", msg_label, i);
|
||||
mavlink_and_console_log_info(&mavlink_log_pub, "%sDownward-facing Sonar detected with ID %i", msg_label, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user