Main Content

flightLogSignalMapping

Visualize UAV flight logs

Since R2020b

Description

The flightLogSignalMapping object maps flight log messages to signals that you can use to visualize the messages.

To inspect UAV logs, first load your log file using mavlinktlog, ardupilotreader or ulogreader. Use the preconfigured signal mapping, or map your own signal using mapSignal or mapulog. Then, use show to display the list of configured plots.

For ease of use, see the provided Predefined Signals and Predefined Plots. You can also view the details of the signals and plots of a flightLogSignalMapping object by using the info object function.

Creation

Description

mapper = flightLogSignalMapping creates a flight log signal mapping object with no preset signal mapping. Before you can visualize signals, map signals using mapSignal.

mapper = flightLogSignalMapping("tlog") creates a flight log signal mapping object for the imported MAVLink TLOG message tables.

mapper = flightLogSignalMapping("ulog") creates a flight log signal mapping object for imported PX4® ULOG files. By default, the object maps messages to the predefined signals using PX4 1.14 log. Use the mapulog function to map log messages from different PX4 versions.

example

mapper = flightLogSignalMapping("bin") creates a flight log signal mapping object for imported ArduPilot log BIN file.

Properties

expand all

Names of all mapped signals, specified as a string array.

Example: ["Accel" "Gyro" "Mag" "Barometer" "Gyro2"]

Data Types: string

Names of plots that are available based on the mapped signals, specified as a string array. To add plots to this list, either map signals for the Predefined Plots or call updatePlot.

Example: ["Accel" "Gyro" "Mag" "Barometer" "Gyro2"]

Data Types: string

Object Functions

checkSignalCheck mapped signal
copyCreate deep copy of flight log signal mapping object
extractExtract UAV flight log signals as timetables
infoSignal mapping and plot information for UAV log signal mapping
mapSignalMap UAV flight log signal
mapulogMap PX4 ULOG messages to signals
showDisplay plots for inspection of UAV logs
updatePlotUpdate UAV flight log plot functions

Examples

collapse all

Use the ulogreader object to read your PX4 log file.

data = ulogreader("yourLogFile.ulg")

Create a flight log signal mapping object.

mapper = flightLogSignalMapping('ulog')

Use the show function to generate a plot of the estimated yaw and magnetometer readings.

show(mapper,data,PlotsToShow="Compass")

This figure shows the Compass plot that is generated from a sample flight log with a duration of 800 seconds.

Plot of estimated yaw and magnetometer readings in X, Y, and Z axes from a sample log.

To verify if the extended Kalman filter (EKF) accurately estimates yaw during the flight, first extract the EKF heading innovations signal as a timetable.

HeadingInnovationsData = extract(mapper,data,"EstimatorInnovationHeading");

Then, extract the EKF magnetometer status signal as a timetable.

EstimatorStatusFlags = extract(mapper,data,"EstimatorStatusFlagMagnetometer");

Combine the EKF heading innovations and magnetometer status timetables.

combinedData = synchronize(magStatusFlags{1},HeadingInnovationsData{1},"union","nearest");

Create a stacked plot of the EKF heading innovation and the RejectYaw flag.

stackedplot(combinedData(:,["Heading","RejectYaw"]),DisplayLabels=["Heading Innovation","RejectYaw"])
grid on

This figure shows the stacked plot that is generated from the sample flight log. The low heading innovation and the absence of RejectYaw flag trigger indicate that the EKF accurately estimates yaw during the flight.

Plot of estimated heading innovation and RejectYaw flag from a sample flight log.

More About

expand all

Version History

Introduced in R2020b

expand all

See Also