Main Content

updatePlot

Update UAV flight log plot functions

Since R2020b

Description

updatePlot(mapper,plotName,plotFunc,requiredSignals) adds or updates the plot with name plotName stored in mapper. Specify the plot function as a predefined plot name or function handle and the required signals for the plot. For a list of preconfigured signals and plots, see Predefined Signals and Predefined Plots.

Input Arguments

collapse all

Flight log signal mapping object, specified as a flightLogSignalMapping object.

Name of plot, specified as a string scalar or character vector. This name is either added or updated in the AvailablePlots property of mapper.

Example: "IMU"

Data Types: char | string

Function for generating plot, specified as a function handle. The function is of the form:

f = plotFunc(signal1, signal2, ...)
The function takes input signals as structures with two fields, "Names" and "Values", and generates a plot output as a figure handle using those signals.

Example: @(acc, gyro, mag)plotIMU(acc, gyro, mag)

Data Types: function_handle

List of required signal names, specified as a string array or cell array of character vectors.

Example: ["LocalNED.X" "LocalNED.Y" "LocalNED.Z"]

Data Types: char | string

More About

collapse all

Predefined Signals

A set of predefined signals and plots are configured in the flightLogSignalMapping object. Depending on your log file type, you can map specific signals to the provided signal names using mapSignal. You can also call info to view the table for your log type and see whether you have already mapped a signal to that plot type.

Specify the SignalName as the input to mapSignal. Signals with the format SignalName# support mapping multiple signals of the same type. Replace # with incremental integers for each signal name when calling mapSignal.

The predefined signals have specific names and required fields when mapping the signal.

Predefined Signals

Signal NameDescriptionFieldsUnits
Accel#Raw accelerometer reading from IMU sensor[ax ay az]m/s2
Airspeed#Airspeed reading of pressure differential, indicated air speed, and temperature[PressDiff, AirSpeed, Temp]Pa, m/s, ℃
AttitudeEulerAttitude of UAV in Euler (ZYX) form[Roll, Pitch, Yaw]radians
AttitudeRateAngular velocity along each body axis[xRotRate, yRotRate, zRotRate]rad/s
AttitudeTargetEulerTarget attitude of UAV in Euler (ZYX) form[TargetRoll, TargetPitch, TargetYaw]radians
Barometer#Barometer readings for absolute pressure, relative pressure, and temperature[PressAbs, PressAltitude, Temp]Pa, m, ℃
BatteryVoltage readings for battery and remaining battery capacity (%)[Volt1,Volt2, ... Volt16, RemainingCapacityV, %
GPS#GPS readings for latitude, longitude, altitude, ground speed, course angle, and number of satellites visible[lat, long, alt, groundspeed, courseAngle, satellites]degree, degree, m, m/s, degree, n/a
Gyro#Raw body angular velocity readings from IMU sensor[GyroX, GyroY, GyroZ]rad/s
LocalNEDLocal NED coordinates estimated by the UAV[xNED, yNED, zNED]meters
LocalNEDTargetTarget location in local NED coordinates[xTarget, yTarget, zTarget]meters
LocalNEDVelLocal NED velocity estimated by the UAV[vx vy vz]m/s
LocalNEDVelTargetTarget velocity in local NED coordinates[vxTarget, vyTarget, vzTarget]m/s
Mag#Raw magnetometer reading from IMU sensor[x y z]Gs

Predefined Plots

After mapping signals to the list of predefined signals using mapSignal, specific plots are made available when calling show. To view a list of available plots and their associated signals for your specific object, call info(mapper,"Plot"). If you want to define custom plots based on signals, use updatePlot.

Each predefined plot has a set of required signals that must be mapped.

Predefined Plots

PlotDescriptionSignals

Attitude

Attitude lot with roll, pitch, yaw, and body rotation rates versus time for a specific flight log

Stacked plot of roll, pitch, yaw angles and body rotation ratesAttitudeEuler, AttitudeRate, Gyro#

AttitudeControl

Roll, pitch, yaw, and corresponding target values versus time for a specific flight log

Estimated attitude of UAV and the attitude target set pointAttitudeEuler, AttitudeTargetEuler

Battery

Battery consumption plotBattery

Compass

Yaw, MagX, MagY, and MagZ plots versus time of a sample flight log plot

Estimated yaw and magnetometer readingsAttitudeEuler, Mag#, GPS#

GPS2D

Lat-long plot using a sample GPS trajectory as lines in a map

Raw Lat-Lon plot for GPS sensor readings.GPS#

Height

GPS and Barometer readings, and fused height plots versus time

Stacked plots of barometer reading, GPS altitude reading, and fused height estimateBarometer#, GPS#, LocalNED

Speed

Ground speed and air speed plots versus time

Stacked plot of ground velocity and air speedGPS#, Airspeed#

Trajectory

North East Up plot for a 3D trajectory in space

Trajectory in local coordinates versus target set pointsLocalNED, LocalNEDTarget

TrajectoryTracking

Difference between x, y, z versus time in a stacked plot

Error between desired and actual position in NED coordinatesLocalNED, LocalNEDTarget

TrajectoryVelTracking

Difference between vx, vy, vz versus time in a stacked plot

Error between desired and actual velocity in NED coordinatesLocalNEDVel, LocalNEDVelTarget

Version History

Introduced in R2020b