mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 03:10:35 +08:00
ekf2: fix optical_flow_vel publication
We should otherwise call this publication before the aid_src publisher that sets the timestamp. Having it separate avoids this ordering constraint.
This commit is contained in:
@@ -2184,7 +2184,7 @@ void EKF2::PublishOpticalFlowVel(const hrt_abstime ×tamp)
|
||||
{
|
||||
const hrt_abstime timestamp_sample = _ekf.aid_src_optical_flow().timestamp_sample;
|
||||
|
||||
if ((timestamp_sample != 0) && (timestamp_sample > _status_optical_flow_pub_last)) {
|
||||
if ((timestamp_sample != 0) && (timestamp_sample > _optical_flow_vel_pub_last)) {
|
||||
|
||||
vehicle_optical_flow_vel_s flow_vel{};
|
||||
flow_vel.timestamp_sample = _ekf.aid_src_optical_flow().timestamp_sample;
|
||||
@@ -2205,6 +2205,8 @@ void EKF2::PublishOpticalFlowVel(const hrt_abstime ×tamp)
|
||||
flow_vel.timestamp = _replay_mode ? timestamp : hrt_absolute_time();
|
||||
|
||||
_estimator_optical_flow_vel_pub.publish(flow_vel);
|
||||
|
||||
_optical_flow_vel_pub_last = timestamp_sample;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_EKF2_OPTICAL_FLOW
|
||||
|
||||
Reference in New Issue
Block a user