-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blackbox device FILE for SITL build #10228
Conversation
#endif | ||
#if defined(SITL_BUILD) | ||
case BLACKBOX_DEVICE_FILE: | ||
fclose(blackboxFile.file_handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set file_handler to NULL after closing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks
Hmm still some problems with decoding the logfiles, please hold :) |
I'm not sure what's happening here. With 7.1.2, there seem to be +- 3 frames that fail to decode when using blackbox_decoder. It seems to be at the very beginning of the file because it also happens when I log for just one second. However when I run on master, everything fails to decode. I guess this is probably because the log messages have been updated and are not backwards compatible with the version of blackbox_decode? If that's the case, the problem is in the decoder and this pull request should be fine.
|
The current BBL decoder works fine with 8.0.0 logs. The problem is most likely caused by the PR. ... Checked: INAV 8.0.0 BBL generated by a FC are correctly read by either |
I suspect that the SITL loop timing completely screws the log timing and framing. This was my conclusion when I attempted the same thing earlier (and paused the attempt as I didn't have time to look further). |
But that problem is somewhere else in the SITL code then, right? And it only surfaces now because this is the only viable way to get blackbox logs out of SITL. I'm willing to go a little bit into that rabbit hole, but I could use some pointers on what has changed in SITL since 7.1.2. |
The problem is caused by the number of servo's being increased to 18 b6f2976 That is incompatible with max 16 servo's in the parser https://github.com/iNavFlight/blackbox-tools/blob/master/src/parser.h#L20 When I set it back to 16, the logfile produced by this pull request seems to be fine! |
Good catch. Keeping the tools up to date with the FC is a nightmare. |
|
How can we handle this better? |
Don't know. I'm pretty well attuned to changes in things like |
To make logging for software-in-the-loop (SITL) easier, I added
BLACKBOX_DEVICE_FILE
as output option for Blackbox. This creates a file YYYY_MM_DD_HHMMSS.TXT when the controller is armed.I tested this on 7.1.2, but on master I'm running into other issues which prevent me from arming the drone.