Main Content

occlusion

Determine occlusion status by surfaces

Since R2022a

Description

[status,state] = occlusion(manager,p1,p2) determines if the line of sight between two points is occluded by the ground surfaces managed by the surface manager and returns the occlusion state.

example

Examples

collapse all

Create a tracking scenario.

scene = trackingScenario;

Create two ground surface terrains, each with a specified boundary.

terrain1 = magic(3)
terrain1 = 3×3

     8     1     6
     3     5     7
     4     9     2

terrain2 = magic(4)
terrain2 = 4×4

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

boundary1 = [0 100;
             0 100-eps];
boundary2 = [0 100;
             100 200];

Add the two ground surfaces to the tracking scenario.

groundSurface(scene,Terrain=terrain1,Boundary=boundary1);
groundSurface(scene,Terrain=terrain2,Boundary=boundary2);

Obtain the surface manager saved in the SurfaceManager property of the tracking scenario.

manager = scene.SurfaceManager
manager = 
  SurfaceManager with properties:

    UseOcclusion: 1
        Surfaces: [1x2 fusion.scenario.GroundSurface]

Obtain the occlusion status for the line-of-sight vector between point (0,0,10) and (100,200,5). The ground surfaces occlude the line-of-sight.

[status,State] = occlusion(manager,[0 0 10]',[100 200 5]')
status = logical
   1

State = 
  SurfaceOcclusionState enumeration

    TerrainOccluded

Raise the second point to 15 meters and the line of sight becomes unoccluded.

[status,State] = occlusion(manager,[0 0 10]',[100 200 15]')
status = logical
   0

State = 
  SurfaceOcclusionState enumeration

    Unoccluded

Input Arguments

collapse all

Surface manager, specified as a SurfaceManager object.

Position of the first point, specified as a three-element real-valued vector.

If the IsEarthCentered property of the trackingScenario object is specified as:

  • false — Specify the three elements, in meters, as the x-, y-, and z-coordinates of the position in the reference frame of the tracking scenario.

  • true — Specify the three elements as the latitude in degrees, longitude in degrees, and altitude in meters of the position, in the geodetic frame.

Data Types: single | double

Position of the second point, specified as a three-element real-valued vector.

If the IsEarthCentered property of the trackingScenario object is specified as:

  • false — Specify the three elements, in meters, as the x-, y-, and z-coordinates of the position in the reference frame of the tracking scenario.

  • true — Specify the three elements as the latitude in degrees, longitude in degrees, and altitude in meters of the position, in the geodetic frame.

Data Types: single | double

Output Arguments

collapse all

Occlusion status, returned as a logical 1 (true) or 0 (false). If true, the line-of-sight between the two positions is occluded by the surface. Otherwise, this argument returns false.

Occlusion state, returned as:

  • "Unoccluded" — The line of sight between the two points is not occluded.

  • "TerrainOcclude" — The line of sight between the two points is occluded by ground surfaces.

  • "HorizonOcclude" — The line of sight between the two points is occluded by the WGS84 Earth model. This option is only available when the IsEarthCentered property of the trackingScenario is specified as true.

Data Types: char | string

Version History

Introduced in R2022a