Clear Filters
Clear Filters

ulogreader no longer works with new PX4 logs

11 views (last 30 days)
Hi, I've been using ulogreader for a while to analyze flight logs from PX4-based flight controllers. However, it seems to have stopped working with the newest version of PX4. When trying to import any log from any version of PX4 v1.14, I get the following error printouts:
Error using uav.internal.ulogread.ulogparse/loadFile
Colon operands must be in the range of the data type.
Error in uav.internal.ulogread.ulogparse (line 411)
obj = loadFile(obj,logFile);
Error in ulogreader (line 183)
ulog = uav.internal.ulogread.ulogparse(obj.FileName);
I know the issue isn't with the log itself, since I can open the same log just fine using the online tool px4 flight review, which can be seen and downloaded at the below link. Any logs from v1.13 and earlier work fine.
Mainly wondering if there is a fix in the works for this, either in terms of a change I can make on my end to make it work or a fix included in more recent versions of MATLAB. I am currently running on R2022b.

Accepted Answer

Jinal
Jinal on 9 Oct 2023
Hello James,
As per my understanding, you are encountering an error while reading a ULOG file from a PX4 Autopilot using ‘ulogreader’ in MATLAB R2022b.
This is a known issue in MATLAB releases prior to MATLAB R2023b. There are two possible workarounds for resolving the issue:
1) Upgrade to MATLAB R2023b.
2) In the MATLAB command window, execute the following code:
matlabroot
% Use the path obtained as the output of above command to replace ‘matlabroot’ in the command given below.
cd matlabroot\toolbox\uav\uavmatlab\+uav\+internal\+ulogread
open ulogparse.m
On line 971: replace
keylen = data(1);
with
keylen = uint32(data(1));
then restart MATLAB.
I hope this resolves the issue you were facing.
  2 Comments
James Croughan
James Croughan on 9 Oct 2023
I did that second option and it fixed it. Thanks!
Christophe KInnard
Christophe KInnard on 19 Nov 2023
I have Matlab 2023b and I have the same problem. Went to check the script and it already has the line 'keylen = uint32(data(1));'... any suggestion for a fix?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!