mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-21 15:27:36 +08:00
update distance sensor separate from flow
This commit is contained in:
@@ -526,9 +526,13 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
orb_check(optical_flow_sub, &updated);
|
||||
orb_check(distance_sensor_sub, &updated2);
|
||||
|
||||
/* update lidar separately, needed by terrain estimator */
|
||||
if (updated2) {
|
||||
orb_copy(ORB_ID(distance_sensor), distance_sensor_sub, &lidar);
|
||||
}
|
||||
|
||||
if (updated && updated2) {
|
||||
orb_copy(ORB_ID(optical_flow), optical_flow_sub, &flow);
|
||||
orb_copy(ORB_ID(distance_sensor), distance_sensor_sub, &lidar);
|
||||
|
||||
/* calculate time from previous update */
|
||||
// float flow_dt = flow_prev > 0 ? (flow.flow_timestamp - flow_prev) * 1e-6f : 0.1f;
|
||||
|
||||
Reference in New Issue
Block a user