From 0542ac0e5f6961b5d7a3d67ce82381f57e72e175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 21 Jan 2020 15:39:18 +0100 Subject: [PATCH] fix simulator_mavlink: orb_copy requires a valid data pointer orb_copy() just returns if data==nullptr. Fixes lockstep for ekf2. estimator_status.time_slip now stays constant after startup, even with high speedup factor and high system load. --- src/modules/simulator/simulator_mavlink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/simulator/simulator_mavlink.cpp b/src/modules/simulator/simulator_mavlink.cpp index 44ad3bc64e..103152434e 100644 --- a/src/modules/simulator/simulator_mavlink.cpp +++ b/src/modules/simulator/simulator_mavlink.cpp @@ -654,7 +654,8 @@ void Simulator::send() } if (fds_ekf2_timestamps[0].revents & POLLIN) { - orb_copy(ORB_ID(ekf2_timestamps), _ekf2_timestamps_sub, nullptr); + ekf2_timestamps_s timestamps; + orb_copy(ORB_ID(ekf2_timestamps), _ekf2_timestamps_sub, ×tamps); state = State::WaitingForActuatorControls; } }