# Lidar Point Cloud Generator

Generate lidar point cloud data for driving scenario

• Library:
• Automated Driving Toolbox / Driving Scenario and Sensor Modeling

## Description

The Lidar Point Cloud Generator block generates a point cloud from lidar measurements taken by a lidar sensor mounted on an ego vehicle.

The block derives the point cloud from simulated roads and actor poses in a driving scenario and generates the point cloud at intervals equal to the sensor update interval. By default, detections are referenced to the coordinate system of the ego vehicle. The block can simulate added noise at a specified range accuracy by using a statistical model. The block also provides parameters to exclude the ego vehicle and roads from the generated point cloud.

The lidar generates point cloud data based on the mesh representations of the roads and actors in the scenario. A mesh is a 3-D geometry of an object that is composed of faces and vertices.

When building scenarios and sensor models using the Driving Scenario Designer app, the lidar sensors exported to Simulink® are output as Lidar Point Cloud Generator blocks.

## Limitations

• C/C++ code generation is not supported.

• For Each subsystems are not supported.

• Rapid acceleration mode is not supported.

• Use of the Detection Concatenation block with this block is not supported. You cannot concatenate point cloud data with detections from other sensors.

• If a model does not contain a Scenario Reader block, then this block does not include roads in the generated point cloud.

• Point cloud data is not generated for lane markings.

## Ports

### Input

expand all

Scenario actor poses in ego vehicle coordinates, specified as a Simulink bus containing a MATLAB structure.

The structure must contain these fields.

FieldDescriptionType
`NumActors`Number of actorsNonnegative integer
`Time`Current simulation timeReal-valued scalar
`Actors`Actor poses`NumActors`-length array of actor pose structures

Each actor pose structure in `Actors` must have these fields.

FieldDescription
`ActorID`

Scenario-defined actor identifier, specified as a positive integer.

`Position`

Position of actor, specified as a real-valued vector of the form [x y z]. Units are in meters.

`Velocity`

Velocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second.

`Roll`

Roll angle of actor, specified as a real-valued scalar. Units are in degrees.

`Pitch`

Pitch angle of actor, specified as a real-valued scalar. Units are in degrees.

`Yaw`

Yaw angle of actor, specified as a real-valued scalar. Units are in degrees.

`AngularVelocity`

Angular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second.

Ego vehicle pose, specified as a Simulink bus containing a MATLAB structure.

The structure must have these fields.

FieldDescription
`ActorID`

Scenario-defined actor identifier, specified as a positive integer.

`Position`

Position of actor, specified as a real-valued vector of the form [x y z]. Units are in meters.

`Velocity`

Velocity (v) of actor in the x- y-, and z-directions, specified as a real-valued vector of the form [vx vy vz]. Units are in meters per second.

`Roll`

Roll angle of actor, specified as a real-valued scalar. Units are in degrees.

`Pitch`

Pitch angle of actor, specified as a real-valued scalar. Units are in degrees.

`Yaw`

Yaw angle of actor, specified as a real-valued scalar. Units are in degrees.

`AngularVelocity`

Angular velocity (ω) of actor in the x-, y-, and z-directions, specified as a real-valued vector of the form [ωx ωy ωz]. Units are in degrees per second.

You can output the ego vehicle pose from a Scenario Reader block. In the Scenario Reader block used in your model, select the Output ego vehicle pose parameter.

### Output

expand all

Point cloud data, returned as an m-by-n-by 3 array of positive real-valued [x, y, z] points. m is the number of elevation (vertical) channels in the point cloud. n is the number of azimuthal (horizontal) channels in the point cloud. m and n define the number of points in the point cloud, as shown in this equation:

`$m×n=\frac{{V}_{FOV}}{{V}_{RES}}×\frac{{H}_{FOV}}{{H}_{RES}}$`
• VFOV is the vertical field of view of the lidar, in degrees, as specified by the Elevation limits of lidar (deg) parameter.

• VRES is the vertical angular resolution of the lidar, in degrees, as specified by the Elevation resolution of lidar (deg) parameter.

• HFOV is the horizontal field of view of the lidar, in degrees, as specified by the Azimuthal limits of lidar (deg) parameter.

• HRES is the horizontal angular resolution of the lidar, in degrees, as specified by the Azimuthal resolution of lidar (deg) parameter.

Each m-by-n entry in the array specifies the x-, y-, and z-coordinates of a detected point in the ego vehicle coordinate system. If the lidar does not detect a point at a given coordinate, then x, y, and z are returned as `NaN`.

By default, the Lidar Point Cloud Generator block includes road data in the generated point cloud. The block obtains the road data in world coordinates from a Scenario Reader block that is in the same model as the Lidar Point Cloud Generator block. The Lidar Point Cloud Generator block computes the road mesh in ego vehicle coordinates based on the road data and the ego vehicle pose at the Ego Vehicle input port. The Maximum detection range (m) parameter of the Lidar Point Cloud Generator block determines the extent of the road mesh. To exclude road data from the point cloud, clear the Include roads in generated point cloud parameter.

## Parameters

expand all

### Parameters

Sensor Identification

Unique sensor identifier, specified as a positive integer. The sensor identifier distinguishes detections that come from different sensors in a multisensor system. If a model contains multiple sensor blocks that have the same sensor identifier, the Bird's-Eye Scope displays an error.

Required time interval between sensor updates, specified as a positive scalar. The value of this parameter must be an integer multiple of the Actors input port data interval. Updates requested from the sensor between update intervals contain no detections. Units are in seconds.

Sensor Extrinsics

Location of the center of the lidar sensor, specified as a real-valued 1-by-2 vector. The Sensor's (x,y) position (m) and Sensor's height (m) parameters define the coordinates of the lidar sensor with respect to the ego vehicle coordinate system. The default value corresponds to a lidar sensor mounted on a sedan, at the center of the roof's front edge. Units are in meters.

Height of the lidar sensor above the ground plane, specified as a positive scalar. The Sensor's (x,y) position (m) and Sensor's height (m) parameters define the coordinates of the lidar sensor with respect to the ego vehicle coordinate system. The default value corresponds to a lidar sensor mounted on a sedan, at the center of the roof front edge. Units are in meters.

Yaw angle of the lidar sensor, specified as a real-valued scalar. The yaw angle is the angle between the center line of the ego vehicle and the downrange axis of the lidar sensor. A positive yaw angle corresponds to a clockwise rotation when you look in the positive direction of the z-axis of the ego vehicle coordinate system. Units are in degrees.

Pitch angle of the lidar sensor, specified as a real-valued scalar. The pitch angle is the angle between the downrange axis of the lidar sensor and the xy-plane of the ego vehicle coordinate system. A positive pitch angle corresponds to a clockwise rotation when you look in the positive direction of the y-axis of the ego vehicle coordinate system. Units are in degrees.

Roll angle of the lidar sensor, specified as a real-valued scalar. The roll angle is the angle of rotation of the downrange axis of the lidar sensor around the x-axis of the ego vehicle coordinate system. A positive roll angle corresponds to a clockwise rotation when you look in the positive direction of the x-axis of the ego vehicle coordinate system. Units are in degrees.

Point Cloud Reporting

Coordinate system of reported detections, specified as one of these values:

• `Ego Cartesian` — Detections are reported in the ego vehicle Cartesian coordinate system.

• `Sensor Cartesian` — Detections are reported in the sensor Cartesian coordinate system.

Select this parameter to include the ego vehicle in the generated point cloud.

`ActorID` value of the ego vehicle, specified as a positive integer. `ActorID` is the unique identifier for an actor. This parameter must be a valid `ActorID` from the input Actor bus.

#### Dependencies

To enable this parameter, select the Include ego vehicle in generated point cloud parameter.

Select this parameter to include the roads in the generated point cloud.

Source of actor profiles, which are the physical and radar characteristics of all actors in the driving scenario, specified as one of these options:

• `From Scenario Reader block` — The block obtains the actor profiles from the scenario specified by the Scenario Reader block.

• `From workspace` — The block obtains the actor profiles from the MATLAB or model workspace variable specified by the MATLAB or model workspace variable name parameter.

Variable name of actor profiles, specified as the name of a MATLAB or model workspace variable containing actor profiles.

Actor profiles are the physical and radar characteristics of all actors in a driving scenario and are specified as a structure or structure array.

• If the actor profiles variable contains a single structure, then all actors specified in the input Actors bus use this profile.

• If the actor profiles variable is a structure array, then each actor specified in the input Actors bus must have a unique actor profile.

To generate an array of structures for your driving scenario, use the `actorProfiles` function. The table shows the valid structure fields. If you do not specify a field, the fields are set to their default values.

FieldDescription
`ActorID`Scenario-defined actor identifier, specified as a positive integer.
`ClassID`Classification identifier, specified as a nonnegative integer. `0` represents an object of an unknown or unassigned class.
`Length`Length of actor, specified as a positive real-valued scalar. Units are in meters.
`Width`Width of actor, specified as a positive real-valued scalar. Units are in meters.
`Height`Height of actor, specified as a positive real-valued scalar. Units are in meters.
`OriginOffset`Offset of actor's rotational center from its geometric center, specified as a real-valued vector of the form [x, y, z]. The rotational center, or origin, is located at the bottom center of the actor. For vehicles, the rotational center is the point on the ground beneath the center of the rear axle. Units are in meters.
`MeshVertices`Mesh vertices of actor, specified as an n-by-3 real-valued matrix of vertices. Each row in the matrix defines a point in 3-D space.
`MeshFaces`Mesh faces of actor, specified as an m-by-3 matrix of integers. Each row of `MeshFaces` represents a triangle defined by the vertex IDs, which are the row numbers of vertices.
`RCSPattern`Radar cross-section (RCS) pattern of actor, specified as a `numel(RCSElevationAngles)`-by-`numel(RCSAzimuthAngles)` real-valued matrix. Units are in decibels per square meter.
`RCSAzimuthAngles`Azimuth angles corresponding to rows of `RCSPattern`, specified as a vector of values in the range [–180, 180]. Units are in degrees.
`RCSElevationAngles`Elevation angles corresponding to rows of `RCSPattern`, specified as a vector of values in the range [–90, 90]. Units are in degrees.

For complete definitions of the structure fields, see the `actor` and `vehicle` functions.

#### Dependencies

To enable this parameter, set the Source of actor profiles parameter to `From workspace`.

### Measurements

Settings

Maximum detection range of the lidar sensor, specified as a positive scalar. The sensor cannot detect actors beyond this range. This parameter also determines the extent of the road mesh. Units are in meters.

Accuracy of range measurements, specified as a positive scalar. Units are in meters.

Azimuthal resolution of the lidar sensor, specified as a positive scalar. The azimuthal resolution defines the minimum separation in azimuth angle at which the lidar can distinguish between two targets. Units are in degrees.

Elevation resolution of the lidar sensor, specified as a positive scalar. The elevation resolution defines the minimum separation in elevation angle at which the lidar can distinguish between two targets. Units are in degrees.

Azimuthal limits of the lidar sensor, specified as a 1-by-2 real-valued vector of the form [min, max]. Units are in degrees.

Elevation limits of the lidar sensor, specified as a 1-by-2 real-valued vector of the form [min, max]. Units are in degrees.

Select this parameter to add noise to lidar sensor measurements. When you clear this parameter, the measurements have no noise.

## Version History

Introduced in R2020b