lidarDetect
Report point cloud detections from all lidar sensor in
trackingScenario
Syntax
Description
reports point cloud detections from all pointCloulds = lidarDetect(scene)monostaticLidarSensor
objects mounted on every platform in the trackingScenario,
scene.
[
also returns the configurations of the sensors, pointClouds,configs] = lidarDetect(scene)configs, in the
tracking scenario.
[
also returns pointClouds,configs, clusters] = lidarDetect(___)clusters, the cluster labels for each point in the point
cloud detections.
Examples
Create a tracking scenario.
sc = trackingScenario;
rng(2020) % for repeatable resultsAdd two platforms to the tracking scenario.
plat1 = platform(sc); plat2 = platform(sc);
Add a target platform to the tracking scenario.
target = platform(sc);
Define a simple waypoint trajectory for the target.
traj = waypointTrajectory("Waypoints",[1 1 1; 2 2 2],"TimeOfArrival",[0,1]); target.Trajectory = traj;
Define a sphere mesh for the target.
target.Mesh = extendedObjectMesh("Sphere"); target.Dimensions = struct("Length",4,"Width",3,"Height",2,"OriginOffset",[0 0 0]);
Show the mesh of the target.
figure() show(target.Mesh); legend("Target Mesh") xlabel('x (m)'); ylabel('y (m)'); zlabel('z (m)');
![]()
Create two lidar sensors with different range accuracy. Mount them on the two platforms.
sensor1 = monostaticLidarSensor(1,"RangeAccuracy",0.01); sensor2 = monostaticLidarSensor(2,"RangeAccuracy",0.2); plat1.Sensors = {sensor1}; plat2.Sensors = {sensor2};
Generate detections from the two lidar sensor using lidarDetect.
[pointClouds,configs,clusters] = lidarDetect(sc);
Visualize the results.
cloud1 = pointClouds{1};
cloud2 = pointClouds{2};
figure()
plot3(cloud1(:,1),cloud1(:,2),cloud1(:,3),'bo')
hold on
plot3(cloud2(:,1),cloud2(:,2),cloud2(:,3),'go')
legend('Sensor1','Sensor2')
xlabel('x (m)'); ylabel('y (m)'); zlabel('z (m)')![]()
Input Arguments
Tracking scenario, specified as a trackingScenario object.
Output Arguments
Point cloud detections generated by the sensors, returned as a
K-element cell array. K is the number of monostaticLidarSensor
objects in the tracking scenario, scene. Each cell element is an
array representing the point cloud generated by the corresponding sensor. The dimension
of the array is determined by the HasOrganizedOutput property of
the sensor.
When this property is set as
true, the cell element is returned an N-by-M-by-3 array of scalars, where N is the number of elevation channels, and M is the number of azimuth channels.When this property is set as
false, the cell element is returned as an P-by-3 matrix of scalars, where P is the product of the numbers of elevation and azimuth channels.
The coordinate frame in which the point cloud locations are reported is determined
by the DetectionCoordinates property of the sensor.
Current sensor configurations, returned as a K-element array of
structures. K is the number of monostaticLidarSensor
objects in the tracking scenario, scene. Each structure has these
fields:
| Field | Description |
SensorIndex | Unique sensor index, returned as a positive integer. |
IsValidTime | Valid detection time, returned as |
IsScanDone |
|
FieldOfView | Field of view of the sensor, returned as a 2-by-2 matrix of positive real values. The first row elements are the lower and upper azimuth limits; the second row elements are the lower and upper elevation limits. |
MeasurementParameters | Sensor measurement parameters, returned as an array of structures containing the coordinate frame transforms needed to transform positions and velocities in the top-level frame to the current sensor frame. |
Data Types: struct
Cluster labels of points in the pointClouds output, returned as
a K-element cell array. K is the number of monostaticLidarSensor
in the tracking scenario, scene. Each cell element is an array
representing cluster labels of points in the point cloud generated by the corresponding
sensor. The dimension of the array is determined by the
HasOrganizedOutput of the sensor.
When this property is set as
true, the cell element is returned as an N-by-M-by-2 array of scalars, where N is the number of elevation channels, and M is the number of azimuth channels. On the third dimension, the first element represents thePlatformIDof the target generating the point, and the second element represents theClassIDof the target.When this property is set as
false, the cell element is returned as a P-by-2 matrix of scalars, where P is the product of the numbers of elevation and azimuth channels. For each column of the matrix, the first element represents thePlatformIDof the target generating the point whereas the second element represents theClassIDof the target.
Version History
Introduced in R2020b
See Also
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)