Flight Log Analyzer Error in extracting GPS and Attitude Data

3 次查看(过去 30 天)
Hello, I am trying to import a ulog file from a PX4 SITL flight of a UAV performed in Qgrouncontrol. The ulog file works fine and the GPS data and everything else is available when I use the PX4 online flight reviewer (https://review.px4.io/plot_app?log=b0a85256-2690-49bb-8b93-a76311c32c86), however, when I try importing the downloaded ulog file (top right on page you can download it as well), the flight log analyzer app does not display any 2D map. It lists the flight modes and their timestamps, but when I hover over the map view, I get a "Error in extracting GPS and Attitude Data" message.
When importing the ulog from into the workspace using ulogreader there is a long list of topics, and the GPS position seems to be included, but when opening the signal browser after importing the ulog file into the flight log analyzer, many of the topics seem to not have been imported?
Importing the ulog file from the tutorial works, so I am assuming that there is something wrong with my ulog file format/the way the flight analyzer is trying to read the message fields, but I am unsure what exactly the problem is. If anyone has any ideas please let me know
This is the version of Matlab I am running:
MATLAB Version: 24.1.0.2603908 (R2024a) Update 3
Operating System: Microsoft Windows 11 Home Single Language Version 10.0 (Build 22631)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 24.1 (R2024a)
Simulink Version 24.1 (R2024a)
Mapping Toolbox Version 24.1 (R2024a)
Signal Processing Toolbox Version 24.1 (R2024a)
UAV Toolbox Version 24.1 (R2024a)

回答(1 个)

Venkatesh BalaSubburaman
Hi,
The reason you are not able to see the 2D map is due to the update in the variable names in the gps data. Variable names "lat", "lon" and "alt" has been replaced by "latitude_deg", "longitude_deg", and "altitude_msl_m"
You can try to update the signal mapping and load the updated flightlogsignalmapping object and ulog data through workspace.
>>u = ulogreader("b0a85256-2690-49bb-8b93-a76311c32c86.ulg");
>>fs = flightLogSignalMapping("ulog");
>>fs.mapSignal("GPS", @(data)getTime(getTable(data, "vehicle_gps_position")), ...
@(data)getRawGPSValue_update(getTable(data, "vehicle_gps_position")));
-----------------
function v = getRawGPSValue_update(gpsTable)
try
v = [double(gpsTable.latitude_deg), ... % lat
double(gpsTable.longitude_deg), ... % lon
double(gpsTable.altitude_msl_m)+300, ... % alt
double(gpsTable.vel_m_s), ... % ground speed
double(gpsTable.cog_rad), ... % course angle
double(gpsTable.satellites_used) % satellites visible
];
catch
%handle error
end
end
-------------
function tbl = getTable(data, name)
%getTable Extract table from data
try
indx = strcmp(data.AvailableTopics.TopicNames, name);
tbl = [];
if(any(indx))
temp = data.readTopicMsgs('TopicNames',name);
tbl=temp.TopicMessages{:};
end
catch
%handle error
end
end
-------------
function t = getTime(tbl)
try
t = tbl.timestamp;
t.Format = 's';
catch
%handle error
end
end
---------

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by