updatePlot
Description
updatePlot(
adds or updates the plot with name mapper
,plotName
,plotFunc
,requiredSignals
)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
mapper
— Flight log signal mapping
flightLogSignalMapping
object
Flight log signal mapping object, specified as a flightLogSignalMapping
object.
plotName
— Name of plot
string scalar | character vector
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
plotFunc
— Function for generating plot
function handle
Function for generating plot, specified as a function handle. The function is of the form:
f = plotFunc(signal1, signal2, ...)
"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
requiredSignals
— List of required signal names
string array | cell array of character vectors
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
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 Name | Description | Fields | Units |
---|---|---|---|
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, ℃ |
AttitudeEuler | Attitude of UAV in Euler (ZYX) form | [Roll, Pitch, Yaw] | radians |
AttitudeRate | Angular velocity along each body axis | [xRotRate, yRotRate, zRotRate] | rad/s |
AttitudeTargetEuler | Target 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, ℃ |
Battery | Voltage readings for battery and remaining battery capacity (%) | [Volt1,Volt2, ... Volt16, RemainingCapacity | V, % |
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 |
LocalNED | Local NED coordinates estimated by the UAV | [xNED, yNED, zNED] | meters |
LocalNEDTarget | Target location in local NED coordinates | [xTarget, yTarget, zTarget] | meters |
LocalNEDVel | Local NED velocity estimated by the UAV | [vx vy vz] | m/s |
LocalNEDVelTarget | Target 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
Plot | Description | Signals |
---|---|---|
| Stacked plot of roll, pitch, yaw angles and body rotation rates | AttitudeEuler, AttitudeRate, Gyro# |
| Estimated attitude of UAV and the attitude target set point | AttitudeEuler, AttitudeTargetEuler |
| Battery consumption plot | Battery |
| Estimated yaw and magnetometer readings | AttitudeEuler, Mag#, GPS# |
| Raw Lat-Lon plot for GPS sensor readings. | GPS# |
| Stacked plots of barometer reading, GPS altitude reading, and fused height estimate | Barometer#, GPS#, LocalNED |
| Stacked plot of ground velocity and air speed | GPS#, Airspeed# |
| Trajectory in local coordinates versus target set points | LocalNED, LocalNEDTarget |
| Error between desired and actual position in NED coordinates | LocalNED, LocalNEDTarget |
| Error between desired and actual velocity in NED coordinates | LocalNEDVel, LocalNEDVelTarget |
Version History
Introduced in R2020b
See Also
flightLogSignalMapping
| mavlinktlog
| extract
| info
| mapSignal
| show
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)