show
Description
visualizes the polygons in coverage space ax
= show(space
)space
with numbering
corresponding to the order that the polygons were specified at the time of creation of
space
. You can also use the show
function for
showing coverage space polygons that were decomposed with the coverageDecomposition
function.
specifies additional options using one or more name-value arguments.ax
= show(space
,Name=Value
)
Examples
Plan Coverage Path Using Geodetic Coordinates
This example shows how to plan a coverage path that surveys the parking lots of the MathWorks Lakeside campus.
Get the geodetic coordinates for the MathWorks Lakeside campus. Then create the limits for our map.
mwLS = [42.3013 -71.375 0]; latlim = [mwLS(1)-0.003 mwLS(1)+0.003]; lonlim = [mwLS(2)-0.003 mwLS(2)+0.003];
Create a figure containing the map with the longitude and latitude limits.
fig = figure;
g = geoaxes(fig,Basemap="satellite");
geolimits(latlim,lonlim)
Get the outline of the first parking lot in longitude and latitude coordinates. Then create the polygon by concatenating them.
pl1lat = [42.3028 42.30325 42.3027 42.3017 42.3019]'; pl1lon = [-71.37527 -71.37442 -71.3736 -71.37378 -71.375234]'; pl1Poly = [pl1lat pl1lon];
Repeat the process for the second parking lot.
pl2lat = [42.30035 42.2999 42.2996 42.2999]'; pl2lon = [-71.3762 -71.3734 -71.37376 -71.37589]'; pl2poly = [pl2lat pl2lon];
Create the coverage space with both of those polygons, set the coverage space to use geodetic coordinates, and set the reference location to the MathWorks Lakeside campus location.
cs = uavCoverageSpace(Polygons={pl1Poly,pl2poly},UseLocalCoordinates=false,ReferenceLocation=mwLS);
Set the height at which to fly the UAV to 25 meters, and the sensor footprint width to 20 meters. Then show the coverage space on the map.
ReferenceHeight = 25; cs.UnitWidth = 20; show(cs,Parent=g);
Set the sweep angle for polygons 1 and 2 to 85
and 5
degrees, respectively, to have paths that are parallel to the roads in the parking lots. Then create the coverage planner for that coverage space with the exhaustive solver algorithm.
setCoveragePattern(cs,1,SweepAngle=85)
setCoveragePattern(cs,2,SweepAngle=5)
cp = uavCoveragePlanner(cs,Solver="Exhaustive");
Set the takeoff position to a location in the courtyard, then plan the coverage path.
takeoff = [42.30089 -71.3752, 0]; [wp,soln] = plan(cp,takeoff); hold on geoplot(wp(:,1),wp(:,2),LineWidth=1.5); geoplot(takeoff(1),takeoff(2),MarkerSize=25,Marker=".") legend("","","Path","Takeoff/Landing") hold off
Input Arguments
space
— Coverage space
uavCoverageSpace
object
Coverage space, specified as an uavCoverageSpace
object.
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: show(cs,FontSize=5)
Parent
— Parent axes for plotting
Axes
object (default) | GeographicAxes
object
Parent axes for plotting, specified as either an Axes
object or a
GeographicAxes
object.
If the value of the UseLocalCoordinates
property of space
is
true
, then the parent axes must be a Axes
object. If the value is false
, then the parent axes must be a
GeographicAxes
object.
FontSize
— Font size of polygon numbering
20
(default) | positive numeric scalar
Font size of polygon numbering, specified as a positive numeric scalar. Units are in points, where 1 point = 1/72 of an inch.
LineWidth
— Width of polygon outlines
2
(default) | positive numeric scalar
Width of polygon outlines, specified as a positive numeric scalar. Units are in points, where 1 point = 1/72 of an inch.
Output Arguments
ax
— Axes handle
Axes
object | GeographicAxes
object
Axes handle, returned as an Axes
object or a
GeographicAxes
object.
Version History
Introduced in R2023a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)