main content

analyze uav autopilot flight logs -凯发k8网页登录

analyze uav autopilot flight logs

since r2020b

description

the flight log analyzer app enables you to load and analyze uav autopilot flight log data, as well as create a customized series of plots.

to use the app:

click new session to create a new session.

you can open saved app sessions by clicking open session.

you can save your progress to a mat-file (.mat) by clicking save session.

to load a ulog file (.ulg) or mat-file containing a object, select import > from ulog.

to load a tlog file (.tlog) or mat-file containing a object, select import > from tlog.

select import > from workspace to load a object, object, or custom log data and a object from the workspace.

click add custom signal to add a custom signal for custom signal mapping.

click add figure to add a new figure for plotting.

you can add one or more predefined or custom plots to a figure from the plot gallery. to see all available plots in the plot gallery, click the down arrow on the right side of the gallery.

predefined plots

  • attitude — adds plots for roll, pitch, yaw angles, as well as body rotation rates

  • imu — adds plots for an accelerometer and gyroscope

  • trajectory — adds a 3-d plot for the uav trajectory and reference trajectory

  • velocity — adds plots for velocity in the x-, y-, and z-directions, as well as groundspeed and airspeed

  • compass — adds plots for a magnetometer, estimated yaw, and course angle

  • height — adds a plot for gps, a barometer, and estimated altitude

custom plots

  • timeseries — adds a blank plot for timeseries data

  • xy — adds a blank plot for 2-d data

  • xyz — adds a blank plot for 3-d data

you can delete the selected figure or plot by clicking delete.

click add function to add a new annotation function.

the added functions are listed in the gallery in the annotate section.

click manage function to edit the functions in the gallery using matlab® editor or delete the functions from the gallery.

click map view to view or hide the satellite image map with logged gps data.

note

the app requires internet access to retrieve satellite imagery.

click data cursor to enable data cursor.

select export > export figure to export the currently selected figure as a .fig file.

select export > export signal to export the signals as timetable to the matlab workspace or a mat-file (.mat).

select export > export to labeledsignalset to export the annotations and signals to the matlab workspace as a labeledsignalset object.

open the flight log analyzer app

  • matlab toolstrip: on the apps tab, under robotics and autonomous systems, click flight log analyzer.

  • matlab command prompt: enter flightloganalyzer.

examples

use the flight log analyzer app to load and analyze uav autopilot flight log data from a ulog file.

open flight log analyzer app

in the apps tab, under robotics and autonomous systems, click flight log analyzer.

alternatively, you can use the flightloganalyzer function from the matlab® command prompt.

import ulog file

select import > from ulog to load the uav flight log data from a ulog (flight.ulg) file.

by default, the app displays a satellite map with logged gps data and the flight modes as a table. the flight modes, along with their corresponding start and end times, are tabulated in the flight modes pane

add figures

  1. to create a new figure for plotting, click add figure. the app adds an empty figure to the plotting pane. you can continue adding additional figures using this process.

  2. the app adds a figure item corresponding to the new figure to the list in the figures pane. select the check box to the left of the listed figure item to show all plots in the figure. clear the check box to hide them.

  3. to rename a figure, select the associated figure item in the figures pane, click the figure name box in the details pane, and type a new name.

  4. to delete a figure, select the figure item in the figures pane and click delete on the app toolstrip. deleting a figure deletes all plots in the figure.

creating a figure enables the plot gallery. you can add one or more predefined plots or custom plots to a figure from the plot gallery.

add predefined plot

  1. to add a predefined plot to a figure, select one of the six predefined plots from the plot gallery.

  2. for example, click attitude to add plots for rotation angles and rotation rates to the figure. you can continue adding additional plots to a figure using this process.

  3. the app adds a plot item corresponding to the new plot under the associated figure item in the figures pane. select the check box to the left of the listed plot item to show the plot in the figure. clear the check box to hide the plot.

  4. to rename a plot, select the associated plot item in the figures pane, click the plot name box in the details pane, and type a new name.

  5. select the show legend check box in the details pane to show the legend on the plot. clear the check box to hide the legend.

  6. to rename the axis labels, double-click on the predefined labels and type a new name.

  7. to delete a plot, select the plot item in the figures pane and click delete on the app toolstrip.

edit plot signals

  1. the signals pane displays the signals in the selected plot as a table. the signal name column contains the names of the signals. the subsequent columns each contain the data associated with that signal for a specific axis.

  2. select the check box in front of a signal item to show that signal in the plot, and clear the check box to hide the signal. the color around the check box is the color of the signal in the plot.

  3. to add a new signal to the selected plot, click add signal.

  4. to rename the signal, double-click signal in the signal name column and type a new name.

  5. to add or update the signal data, double-click the y-axis column of the signal to open the signal browser window. choose from available signals.

  6. select one of the signals from the signal browser window and click update.

  7. to delete a signal, select a signal from the signals pane and click delete signal.

change plot focus using panner

  1. for timeseries plots, use the panner to focus on data segments in the x-axis range. the panner is a strip plot beneath the main plot. to focus on a section of the main plot, drag the red and blue handles to the start and end positions, respectively, of the desired data segment.

  2. you can also move the handles by typing new values in the from (sec) and to (sec) boxes, beneath the strip plot. to reset the handles to their default values, click reset limits.

  3. the color next to each flight mode in the flight modes pane represents that flight mode in the color bar under the strip plot in the panner pane.

add custom plot

  1. to add a custom plot to a figure, select one of the three custom plots from the plot gallery. you can add the new plot to the previously created figure or to a new figure.

  2. for example, click xyz to add a blank plot for 3-d data.

  3. to add a signal to the plot, click add signal in the signals pane.

  4. to rename the signal, double-click signal in the signal name column and type a new name.

  5. to add signal data to the x-axis, y-axis, and z-axis columns, double-click the data field columns of the signal to open the signal browser window. choose from the available signals.

for example, to create a trajectory plot in local east-north-up (enu) cartesian coordinates:

  1. double-click the x-axis data field for the desired signal and find the localenu signal group in the signal browser pane.

  2. expand the group and select the signal x.

  3. click update to update the signal with x-axis data.

  4. repeat these steps to update the y-axis and z-axis fields with y and z data, respectively, to create a 3-d trajectory plot.

export figure

select export > export figure to export the current figure to a .fig file.

  1. select one or more plots in the current figure to export, specify a file name for the .fig file, and click browse to the select the destination folder. click export to export the selected plots to the .fig file. the app opens a figure containing the selected plots in a new figure window.

  2. to export each plot as an individual figure, select export each plot as individual figure. specify the file name prefix for the .fig files, and click browse to the select the destination folder. click export to export the selected plots as individual .fig files. the app adds the plot names as the suffixes of the specified file name prefix for the exported .fig files. the app opens each exported plot in individual figure window.

export signal

select export > export signal to export the signals as a timetable to the matlab workspace or a mat file (.mat).

  1. select the signals to export. to export them to a mat file, select to mat-file and specify a file name for the mat file. to select a destination folder for the mat file, click browse and navigate to the folder to which you want to export.

  2. to export the signals to the matlab workspace, select to matlab workspace and specify a name for the output workspace variable.

save and open sessions

you can save the flight log analyzer app session by clicking save session. the app writes the current state of the app to a .mat file that you can load by clicking open session.

open flight log analyzer app

in the apps tab, under robotics and autonomous systems, click flight log analyzer.

alternatively, you can use the flightloganalyzer function from the matlab® command prompt.

import ulog file

load the ulog file.

ulg = ulogreader("flight.ulg")
ulg = 
  ulogreader with properties:
            filename: "flight.ulg"
           starttime: 00:00:00.176000
             endtime: 00:02:15.224000
     availabletopics: [51x5 table]
    dropoutintervals: [0x2 duration]

on the flight log analyzer app toolstrip, select import > from workspace. in the log data section of the import flight log signal mapping and log data from workspace dialog box, select the object ulg and click import.

add annotation function

to add a custom function to the flight log analyzer app:

  1. in the annotate section of the app toolstrip, click add function.

  2. in the dialog box, specify the function name as thresholdsignalvalue.

  3. select the label type as roi.

  4. click on ok.

the thresholdsignalvalue function is added to the gallery in the annotate section, since the function is already provided with this example and it is in matlab path.

if the function does not exist in the matlab path, the app suggests to create a new function and opens a function template in the matlab editor. if the function is at a different location, the location must be added to the matlab path.

the function can access the object, complete flight log data, selected signals, and additional optional arguments from the app.

run annotation function

run the thresholdsignalvalue annotation function to find the regions with signal value less than the threshold value.

  1. in the annotate gallery, click thresholdsignalvalue.

  2. in the dialog box, select the required signals from the signals panel.

  3. click the arrow next to attitudeeuler and select pitch.

  4. click add signals.

  5. the added signals are listed on the signal order preview panel.

  6. specify the threshold value and a string to denote signal value is less than threshold as -0.5,lt in varargin.

  7. click run.

run the thresholdsignalvalue annotation function again to find the regions with signal value greater than the threshold value.

  1. in the annotate gallery, click thresholdsignalvalue.

  2. in the dialog box, select the required signals from the signals panel.

  3. click the arrow next to accel and select accelx.

  4. click add signals.

  5. the added signals are listed on the signal order preview panel.

  6. specify the threshold value and a string to denote signal value is greater than threshold as 40,gt in varargin.

  7. click run.

create figures and plots

in the plot section of the app toolstrip, click add figure to add an empty figure to the plotting pane.

create predefined attitude plot.

  • in the plots section of the plot gallery, click attitude.

create custom timeseries plot.

  1. in the custom plots section of the plot gallery, click timeseries.

  2. in the details pane, rename the plot as accel x.

  3. in the signals pane, click add signal.

  4. double-click the y-axis column of the signal and, in the signal browser window, type accelx in the search box, and then click the arrow next to accel and select accelx. then, click update.

  5. rename the signal to accelx. to rename a signal, double-click its entry in the signal name column and type the new name.

annotate plots

  1. in the figures pane, select the plot on which you want to see the detected region of interest.

  2. in the annotation pane, select the check boxes to highlight the regions of interest on the plot.

  3. in the panner pane, drag the red and blue handles to the start time and end time, respectively, to focus on a region of interest. alternatively, you can type the start time and end time values in the from (sec) and to (sec) boxes, beneath the strip plot.

  4. to rename the default annotation label, right-click on the label and select rename label and type the new label name.

open flight log analyzer app

use the flightloganalyzer function to launch the app.

flightloganalyzer

alternatively, to launch the app from the apps tab in the matlab® toolstrip, under robotics and autonomous systems, click flight log analyzer.

import ulog file

select import > from ulog to load the uav flight log data from a ulog file, flight.ulg.

add custom signal

to add a custom signal for custom signal mapping:

  1. in the signal mapping section of the app toolstrip, click add custom signal to open the add custom signal window.

  2. click any signal in the available signals pane to expand the signal group.

  3. select signals from one signal group, and click add signal.

  4. the added signals are listed in the signal preview pane.

  5. specify a signal name in signal name.

  6. you can also specify the multiplier value and the units for the signals in the signal preview pane.

  7. to remove added signals, click the signals you want to remove in the signal preview pane and select remove signals.

  8. click ok.

create figures and plots

in the plot section of the app toolstrip, click add figure to add an empty figure to the plotting pane.

create a custom timeseries plot by following these steps.

  1. in the custom plots section of the plot gallery, click timeseries.

  2. in the details pane, rename the plot to air speed.

  3. in the signals pane, click add signal.

  4. double-click the y-axis column of the signal and, in the signal browser window, type airspeed in the search box, and then click the arrow next to airspeed2x and select indicated_airspeed_m_s. then, click update.

  5. rename the signal to airspeed2x. to rename a signal, double-click its entry in the signal name column and type the new name.

  6. add another signal from the signals pane, then click add signal.

  7. double-click the y-axis column of the signal and, in the signal browser window, type airspeed in the search box, and then click the arrow next to airspeed and select indicatedairspeed. then, click update.

  8. rename the signal to airspeed.

  9. select show legend in the details pane to show the legend on the plot.

enable data cursor

you can explore plot data interactively using the data cursor.

  1. in the cursors section of the app toolstrip, click data cursor to add a handle to the panner.

  2. you can drag the handle or the data tips to the plot. data tips are small text boxes that display information about individual data points.

you can use the data cursor with timeseries plots, and on map view.

related examples

    programmatic use

    flightloganalyzer opens the flight log analyzer app, which enables you to analyze uav autopilot flight logs.

    more about

    version history

    introduced in r2020b

    see also

    objects

    • | |
    网站地图