Open EeMeng94 opened 1 year ago
Looks like it could be a bug indeed! Would you be willing to have a look? I would start investigating here
Hi @JonasVautherin thanks for the reply. Unfortunately I am not able to commit to fixing it due to lack of time.
However it seems like it might have been an APM issue/feature. Based on the code used by QGroundControl, it seems like the 0th APM log entry is bogus. The 1st entry start from index of 1, and the final entry will be have an index of n (instead of n - 1). https://github.com/mavlink/qgroundcontrol/blob/master/src/AnalyzeView/LogDownloadController.cc#L160
Good to know! Thanks for reporting, and feel free to come back to it when you have time! If that's really an Ardupilot-specific well-known behavior, I think it may be easy to adapt the code for it, similar to e.g. here.
Haven't looked in details, but I could imagine something like this:
if (_parent->autopilot() == SystemImpl::Autopilot::ArduPilot) {
// Set the index shifted by 1, maybe?
} else {
// Set the index not shifted by 1
}
Oh my god, another off by one difference for ArduPilot? That's just crazy.
I have encountered some weird behaviour when using drone.log_files.get_entries() with the code below:
Executing the code yields the following result (truncated the middle part):
The entries seems to have been shifted, causing the 1st entry to be empty (log 0), subsequent entries's log id to be incremented by 1 and the final entry to be missing.
Viewing the pixhawk unit on QGroundControl shows that there are logs with id 0-138 (a total of 139 logs):