Main Content

addGeoFence

Add geographical fencing to UAV platform

Since R2020b

Description

addGeoFence(platform,type,geometries,permission) adds a geofence specified in ENU coordinates to the scenario.

addGeoFence(___,Name,Value) specifies options using one or more name-value pair arguments in addition to the input arguments in the previous syntax. For example, 'UseLatLon',true uses latitude and longitude coordinates for the xy-coordinates of the geometries input.

Input Arguments

collapse all

UAV platform in a scenario, specified as a uavPlatform object.

Type of mesh, specified as "cylinder" or "polygon".

Data Types: char | string

Geometric parameters of the mesh, specified as a cell array with options that depend on the type input:

type InputGeometry ParametersDescription
"cylinder"{[x y height]}Three-element vector of the xy-position and height of the cylinder.
"polygon"{[endptsX endptsY] [zmin zmax]}End points of the polygon, specified in either clockwise or counterclockwise order. z-coordinates specify the minimum and maximum elevation of the polygon.

Geofence permission, specified as a 0 (false) or 1 (true), which indicates whether the UAV platform is permitted inside the geofence (true) or not permitted (false).

Data Types: logical

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'UseLatLon',true uses latitude and longitude coordinates for the xy-coordinates of the geometries input.

Use latitude-longitude coordinates for the geofence geometry, specified as the comma-separated pair consisting of 'UseLatLon' and a logical 0 (false) or 1(true).

Data Types: logical

Reference frame for computing UAV platform motion, specified as the comma-separated pair consisting of 'ReferenceFrame' and a string scalar, which matches any reference frame in the uavScenario.

Data Types: char | string

Version History

Introduced in R2020b