Main Content

targetMeshes

Target meshes as seen from platform

Since R2020b

Description

tgtMeshes = targetMeshes(plat) returns the relative pose and meshes of all other platforms seem from the ego platform, plat.

example

tgtMeshes = targetMeshes(plat,reportSelf) allows you to choose whether report mesh information about the ego platform, plat. Specify reportSelf as true or false.

tgtMeshes = targetMeshes(plat,reportSelf,format) allows you to specify the format of orientation as quaternion or rotation matrix in the tgtMeshes output.

Examples

collapse all

Create a tracking scenario. Create an ego platform and a target platform.

scenario = trackingScenario;

ego = platform(scenario,'Position',[1 1 1]);
target = platform(scenario,'Trajectory',kinematicTrajectory('Position',[10 -3 0],'Velocity',[5 0 0]));

Define the target's mesh and adjust its dimensions.

target.Mesh = extendedObjectMesh('sphere');
target.Dimensions.Length = 5; 
target.Dimensions.Width = 3;
target.Dimensions.Height = 2;

Get the mesh of the target viewed from the ego platform.

tgtmeshes = targetMeshes(ego);

Show the derived mesh of the target from the view of the ego platform.

show(tgtmeshes.Mesh);

Figure contains an axes object. The axes object contains an object of type patch.

Input Arguments

collapse all

Ego platform, specified as a Platform object.

Enable reporting ego platform's mesh information, specified as true or false.

Orientation output format, specified as 'quaternion or 'rotmat'. When specified as 'quaternion, the orientation is given by quaternion. When specified as 'rotmat', the orientation output is given by rotation matrix.

Output Arguments

collapse all

Pose and meshes of target platforms relative to the ego platform plat, returned as an array of structures. Each structure contains these fields:

Field NameDescription
PlatformIDUnique identifier of the target, specified as a nonnegative integer.
ClassIDUnique identifier of the class of the target, specified as a nonnegative integer.
PositionPosition of the target with respect to the sensor mounting platform's body frame, specified as a 3-element vector of scalars.
OrientationOrientation of the target with respect to the sensor mounting platform's body frame, specified as a quaternion object or a rotation matrix.
MeshGeometric mesh of the target, specified as an extendedObjectMesh object with respect to the target's body frame.

Version History

Introduced in R2020b