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.
This commit is contained in:
Beat Küng 2020-01-21 15:39:18 +01:00 committed by Lorenz Meier
parent 30edcad752
commit 0542ac0e5f

View File

@ -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, &timestamps);
state = State::WaitingForActuatorControls;
}
}