plotDetection
Description
plotDetection(
plots detections on the tracking globe viewer.viewer
,detections
)
plotDetection(___,
specifies
the reference frame used to interpret the coordinates of the detections.frame
)
plotDetection(___,
specifies options using one or more name-value arguments. For example,
Name=Value
)plotDetection(viewer,detect,Color=[1 0 0])
specifies the color of the
plotted detections as the RGB triplet [1 0 0]
.
Examples
Create a tracking globe viewer and specify its reference location. Specify the camera position and orientation.
refloc = [42.366978 -71.022362 50]; viewer = trackingGlobeViewer(ReferenceLocation=refloc); campos(viewer,42.3374,-71.0605,872.7615); camorient(viewer,[39 0 -2.7]);
Plot a Cartesian measurement of [0 100 –300] expressed in the sensor frame, which is an NED frame whose origin position is [1000 0 0] with respect to the local NED frame of the viewer. The origin of this local NED frame is the same as the reference location of the viewer.
det1 = objectDetection(0,[0 100 -300],MeasurementParameters=struct("Frame","rectangular",... "OriginPosition",[1000 0 0])); plotDetection(viewer,det1,"NED");
Plot a Cartesian measurement of [0 100 350] expressed in the sensor frame, which a ENU frame whose origin position is [1000 0 0] with respect to the local ENU frame of the viewer. The origin of this local ENU frame is the same as the reference location of the viewer.
det2 = objectDetection(0,[0 100 350],MeasurementParameters= ... struct("Frame","rectangular", ... "OriginPosition",[1000 0 0], ... "Orientation",eye(3)), ... SensorIndex=2); plotDetection(viewer,det2,"ENU",Color=[0.5 0.5 0]);
Plot a Cartesian measurement expressed in the sensor frame, which overlaps the ECEF frame.
det3 = objectDetection(0,[1.5349; -4.4634; 4.2761]*1e6,MeasurementParameters= ... struct("Frame","rectangular", ... "OriginPosition",[0 0 0], ... "Orientation",eye(3)), ... SensorIndex=3); plotDetection(viewer,det3,"ECEF",Color=[0 0.5 0]);
Take a snapshot and show the results.
drawnow snapshot(viewer)
Create a tracking globe viewer and specify its reference location and coordinate frame. Specify the camera position and orientation.
frame = "ENU";
refloc = [42.366978 -71.022362 50];
viewer = trackingGlobeViewer(ReferenceLocation=refloc);
campos(viewer,42.3374,-71.0605,872.7615);
camorient(viewer,[39 0 -2.7]);
Create an angle-only detection with an azimuth of 0 degrees.
MP1 = struct(Frame="Spherical",HasAzimuth=true, ... HasElevation=false,HasRange=false,HasVelocity=false); det1 = objectDetection(0,0,SensorIndex=1,MeasurementParameters=MP1);
Create an angle-only detection with an azimuth of 90 degrees and an elevation of 50 degrees.
MP2 = struct(Frame="Spherical",HasAzimuth=true, ... HasElevation=true,HasRange=false,HasVelocity=false); det2 = objectDetection(0,[90; 50],SensorIndex=2,MeasurementParameters=MP2);
Create a range-only detection with a range of 1500 meters.
MP3 = struct(Frame="Spherical",HasAzimuth=false, ... HasElevation=false,HasRange=true,HasVelocity=false); det3 = objectDetection(0,1500,SensorIndex=3,MeasurementParameters=MP3);
Plot the detections using the plotDetection
object function. Specify the color for the detections from each sensor.
plotDetection(viewer,{det1,det2,det3},"ENU",Color=[1 0 0; 0 1 0; 0 0 1]);
Take a snapshot and show the results.
drawnow snapshot(viewer)
Input Arguments
Tracking globe viewer, specified as a trackingGlobeViewer
object.1
Object detections, specified as an objectDetection
object, an array of objectDetection
objects, or a cell array of objectDetection
objects. Alternately, you
can specify detections
as a structure, an array of structures, or a
cell array of structures. The fields of each structure should be equivalent to the
properties of the objectDetection
object. Each structure must
at least have the Measurement
, MeasurementNoise
,
and SensorIndex
fields.
Reference frame, specified as "NED"
for north-east down,
"ENU"
for east-north-up, or "ECEF"
for
Earth-centered-Earth-fixed. When specified as "NED"
or
"ENU"
, the origin of the reference frame is at the location
specified by the ReferenceLocation
property of the
viewer
object.
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: plotDetection(viewer,detect,Color=[1 0 0])
Color of detections, specified as:
"Auto"
— Automatically select the color from a limited set of colors based on theSensorIndex
property or field of each detection.A 1-by-3 RGB triplet — Plot all the detections with the same color.
An N-by-3 matrix of RGB triplets — Plot detections from each sensor with a different color. N is the number of unique
SensorIndex
in thedetections
input. In this way, you can specify different colors for detections generated from different sensors.
Transparency of the sphere for range-only detection plotting, specified as a scalar in the range [0, 1]. A value of 1 is fully opaque and 0 is completely transparent. Values between 0 and 1 are semitransparent.
Define a range-only detection using the objectDetection
object by specifying its
MeasurementParameters
property as a structure with these
fields. Set the:
Frame
field to"Spherical"
.HasRange
field totrue
.HasAzimuth
field tofalse
.HasElevation
field tofalse
.
See Plot Range-Only and Angle-Only Detections in trackingGlobeViewer for an example.
Length of ray for angle-only detection plotting, specified as a positive scalar in meters.
Define an angle-only detection using the objectDetection
object by specifying its
MeasurementParameters
property as a structure with these
fields. Set the:
Frame
field as"Spherical"
.HasRange
field asfalse
.HasAzimuth
field astrue
.HasElevation
field astrue
orfalse
. When you specify this field asfalse
, the function assumes the elevation angle is 0.
See Plot Range-Only and Angle-Only Detections in trackingGlobeViewer for an example.
Version History
Introduced in R2021bYou can now plot range-only and angle-only detections by using the plotDetection
function of the trackingGlobeViewer
object. Additionally, you can use the two new properties,
SphereAlpha
and RayLength
, to specify the
transparency of the sphere for range-only detections and the ray length for angle-only
detections, respectively.
You can now specify the detections
input using structures.
When plotting detections using the plotDetection
function, you can now specify the Color
name-value argument as
"Auto"
, which automatically plots detections using colors based on the
sensor IDs of the detections.
See Also
trackingGlobeViewer
| plotScenario
| plotPlatform
| plotTrajectory
| plotCoverage
| plotTrack
| clear
| snapshot
| campos
| camorient
1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)