mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 00:33:36 +08:00
ekf2 replay logic:
support recent change in ekf2 module which made it only publish the output when an ekf update was occuring. in case the ekf2 module does not update the replay module will be informed and will thus not wait for an update but continue preparing the next sample of sensor data
This commit is contained in:
@@ -436,6 +436,13 @@ void Ekf2Replay::logIfUpdated()
|
||||
// update attitude
|
||||
struct vehicle_attitude_s att = {};
|
||||
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &att);
|
||||
|
||||
// if the timestamp of the attitude is zero, then this means that the ekf did not
|
||||
// do an update so we can ignore this message and just continue
|
||||
if (att.timestamp == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&log_message.body.att.q_w, 0, sizeof(log_ATT_s));
|
||||
|
||||
log_message.type = LOG_ATT_MSG;
|
||||
@@ -695,8 +702,9 @@ void Ekf2Replay::task_main()
|
||||
|
||||
read_first_header = true;
|
||||
|
||||
if (header[0] != HEAD_BYTE1 || header[1] != HEAD_BYTE2) {
|
||||
PX4_WARN("bad log header\n");
|
||||
if ((header[0] != HEAD_BYTE1 || header[1] != HEAD_BYTE2)) {
|
||||
// we assume that the log file is finished here
|
||||
PX4_WARN("Done!");
|
||||
_task_should_exit = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user