Simulation 3D Ultrasonic Array
Ultrasonic sensor model with tunable acoustic parameters in 3D simulation environment
Since R2023a
Libraries:
Automated Driving Toolbox /
Simulation 3D
Simulink 3D Animation /
Simulation 3D /
Sensors
Description
Note
Simulating models with the Simulation 3D Ultrasonic Array block requires Simulink® 3D Animation™.
The Simulation 3D Ultrasonic Array block generates detections from range measurements taken by an array of ultrasonic sensors with tunable acoustic parameters, mounted on an ego vehicle in a 3D simulation environment. This environment is rendered using the Unreal Engine® from Epic Games®. The block calculates range measurements based on the distance between the sensor and the closest point on the detected object. The block also provides parameters to control the waveform of the ultrasonic signal used by the sensor to calculate range measurements.
If you set Sample time to -1
, the block uses the
sample time specified in the Simulation 3D Scene Configuration block. To use
this sensor, you must include a Simulation 3D Scene Configuration block in your
model.
Tip
The Simulation 3D Scene Configuration block must execute before the Simulation 3D Ultrasonic Array block. That way, the Unreal Engine 3D visualization environment prepares the data before the Simulation 3D Ultrasonic Array block receives it. To check the block execution order, right-click the blocks and select Properties. On the General tab, confirm these Priority settings:
Simulation 3D Scene Configuration —
0
Simulation 3D Ultrasonic Array —
1
For more information about execution order, see How Unreal Engine Simulation for Automated Driving Works.
Ports
Output
Detections — Object detections
Simulink bus containing MATLAB® structure
Object detections, returned as a Simulink bus containing a MATLAB structure. For more details about buses, see Create Nonvirtual Buses (Simulink).
You can pass object detections from these sensors and other sensors to a tracker, such as a Multi-Object Tracker block, and generate tracks.
The structure must contain these fields.
Property | Description |
---|---|
Time | Measurement time |
Measurement | Distance measurement to the closest object |
MeasurementNoise | Measurement noise covariance matrix |
SensorIndex | Unique ID of the sensor |
ObjectClassID | Object classification |
ObjectAttributes | Additional information passed to tracker |
MeasurementParameters | Parameters used by initialization functions of nonlinear Kalman tracking filters |
This table describes the additional information in the
ObjectAttributes
property.
ObjectAttributes
Attribute | Definition |
---|---|
TargetIndex | Identifier of the actor, ActorID , that generated the
detection. For false alarms, this value is negative. |
PointOnTarget | Coordinate of the point on the detected object that the sensor used to compute the distance measurement. It is in the vehicle coordinate system. Use this for visualizing detections in the Bird's-Eye Scope app. |
For MeasurementParameters
, the measurements are relative to
the parent frame. The parent frame is the ego vehicle body.
MeasurementParameters
Parameter | Definition |
---|---|
Frame | Enumerated type indicating the frame used to report measurements. The
Frame is always set to 'spherical'
and the detections are reported in spherical coordinates for
Ultrasonic Detection Generator. |
OriginPosition | 3-D vector offset of the sensor origin from the parent frame origin. |
OriginVelocity | Velocity of the sensor coordinate system with respect to the parent frame. |
IsParentToChild | Logical scalar indicating if Orientation performs a
frame rotation from the parent coordinate frame to the child coordinate
frame. When IsParentToChild is false, then
Orientation performs a frame rotation from the child
coordinate frame to the parent coordinate frame. |
HasAzimuth | Indicates whether measurements contain azimuth components. |
HasRange | Indicates whether measurements contain range components. Always
true for Ultrasonic Detection
Generator. |
HasElevation | Indicates whether measurements contain elevation components. Always
false for Ultrasonic Detection
Generator. |
HasVelocity | Indicates whether measurements contain velocity or range rate
components. Always false for Ultrasonic Detection
Generator. |
FieldOfView | 2-D vector containing the azimuth and elevation field of view values of the sensor. |
Dependencies
To enable this output port, on the Parameters tab, check the Use bus output parameter.
Has object — Flag indicating whether any detectable object is present in the sensor field-of-view
true
| false
Flag indicating whether any detectable object is present in the sensor field-of-view, returned as a logical scalar. An object is considered detectable if its closest distance to the sensor is greater than the minimum detection-only range specified in the Detection ranges (m) parameter.
Dependencies
To enable this output port, on the Parameters tab, clear the Use bus output parameter.
Has range — Flag indicating whether range measurement is possible for any object present in the sensor field-of-view
true
| false
Flag indicating whether range measurement is possible for any object present in
the sensor field-of-view, returned as a logical scalar. For any object in the
field-of-view, range measurement is possible if its closest distance to the sensor is
greater than the minimum-distance range specified in the Detection Ranges (m)
parameter.
Dependencies
To enable this output port, on the Parameters tab, clear the Use bus output parameter.
Range — Distance measurement to the closest object
nonnegative scalar
Distance measurement to the closest object, returned as a nonnegative scalar.
Dependencies
To enable this output port, on the Parameters tab, clear the Use bus output parameter.
Translation — Sensor location
real-valued 1-by-3 vector
Sensor location along the X-axis, Y-axis, and Z-axis of the scene. The Translation values are in the world coordinates of the scene. In this coordinate system, the Z-axis points up from the ground. Units are in meters.
Dependencies
To enable this port, on the Ground Truth tab, select Output location (m) and orientation (rad).
Data Types: double
Rotation — Sensor orientation
real-valued 1-by-3 vector
Roll, pitch, and yaw sensor orientation about the X-axis, Y-axis, and Z-axis of the scene. The Rotation values are in the world coordinates of the scene. These values are positive in the clockwise direction when looking in the positive directions of these axes. Units are in radians.
Dependencies
To enable this port, on the Ground Truth tab, select Output location (m) and orientation (rad).
Data Types: double
Parameters
Mounting
Sensor identifier — Unique sensor identifier
1
(default) | positive integer
Specify the unique identifier of the sensor. In a multisensor system, the sensor identifier enables you to distinguish between sensors. When you add a new sensor block to your model, the Sensor identifier of that block is N + 1, where N is the highest Sensor identifier value among the existing sensor blocks in the model.
Example: 2
Parent name — Name of parent vehicle
Scene Origin
(default) | vehicle name
Name of the parent to which the sensor is mounted, specified as Scene
Origin
or as the name of a vehicle in your model. The vehicle names
that you can select correspond to the Name parameters of the
simulation 3D vehicle blocks in your model. If you select Scene
Origin
, the block places a sensor at the scene origin.
Example: SimulinkVehicle1
Mounting location — Sensor mounting location
Origin
(default) | Front bumper
| Rear bumper
| Right mirror
| Left mirror
| Rearview mirror
| Hood center
| Roof center
| ...
Sensor mounting location.
When Parent name is
Scene Origin
, the block mounts the sensor to the origin of the scene. You can set the Mounting location toOrigin
only. During simulation, the sensor remains stationary.When Parent name is the name of a vehicle, the block mounts the sensor to one of the predefined mounting locations described in the table. During simulation, the sensor travels with the vehicle.
Vehicle Mounting Location | Description | Orientation Relative to Vehicle Origin [Roll, Pitch, Yaw] (deg) |
---|---|---|
Origin | Forward-facing sensor mounted to the vehicle origin, which is on the ground and at the geometric center of the vehicle (see Coordinate Systems for Unreal Engine Simulation in Automated Driving Toolbox) | [0, 0, 0] |
| Forward-facing sensor mounted to the front bumper | [0, 0, 0] |
| Backward-facing sensor mounted to the rear bumper | [0, 0, 180] |
Right mirror | Downward-facing sensor mounted to the right side-view mirror | [0, –90, 0] |
Left mirror | Downward-facing sensor mounted to the left side-view mirror | [0, –90, 0] |
Rearview mirror | Forward-facing sensor mounted to the rearview mirror, inside the vehicle | [0, 0, 0] |
Hood center | Forward-facing sensor mounted to the center of the hood | [0, 0, 0] |
Roof center | Forward-facing sensor mounted to the center of the roof | [0, 0, 0] |
Roll, pitch, and yaw are clockwise-positive when looking in the positive direction of the X-axis, Y-axis, and Z-axis, respectively. When looking at a vehicle from above, the yaw angle (the orientation angle) is counterclockwise-positive because you are looking in the negative direction of the axis.
The X-Y-Z mounting location of the sensor relative to the vehicle depends on the vehicle type. To specify the vehicle type, use the Type parameter of the Simulation 3D Vehicle with Ground Following to which you mount the sensor. To obtain the X-Y-Z mounting locations for a vehicle type, see the reference page for that vehicle.
To determine the location of the sensor in world coordinates, open the sensor block. Then, on the Ground Truth tab, select the Output location (m) and orientation (rad) parameter and inspect the data from the Translation output port.
Specify offset — Specify offset from mounting location
off
(default) | on
Select this parameter to specify an offset from the mounting location by using the Relative translation [X, Y, Z] (m) and Relative rotation [Roll, Pitch, Yaw] (deg) parameters.
Relative translation [X, Y, Z] (m) — Translation offset relative to mounting location
[0, 0, 0]
(default) | real-valued 1-by-3 vector
Translation offset relative to the mounting location of the sensor, specified as a real-valued 1-by-3 vector of the form [X, Y, Z]. Units are in meters.
If you mount the sensor to a vehicle by setting Parent name to the name of that vehicle, then X, Y, and Z are in the vehicle coordinate system, where:
The X-axis points forward from the vehicle.
The Y-axis points to the left of the vehicle, as viewed when looking in the forward direction of the vehicle.
The Z-axis points up.
The origin is the mounting location specified in the Mounting location parameter. This origin is different from the vehicle origin, which is the geometric center of the vehicle.
If you mount the sensor to the scene origin by setting Parent name to Scene Origin
, then X, Y, and Z are in the world coordinates of the scene.
For more details about the vehicle and world coordinate systems, see Coordinate Systems for Unreal Engine Simulation in Automated Driving Toolbox.
Example: [0,0,0.01]
Dependencies
To enable this parameter, select Specify offset.
Relative rotation [Roll, Pitch, Yaw] (deg) — Rotational offset relative to mounting location
[0, 0, 0]
(default) | real-valued 1-by-3 vector
Rotational offset relative to the mounting location of the sensor, specified as a real-valued 1-by-3 vector of the form [Roll, Pitch, Yaw]. Roll, pitch, and yaw are the angles of rotation about the X-, Y-, and Z-axes, respectively. Units are in degrees.
If you mount the sensor to a vehicle by setting Parent name to the name of that vehicle, then X, Y, and Z are in the vehicle coordinate system, where:
The X-axis points forward from the vehicle.
The Y-axis points to the left of the vehicle, as viewed when looking in the forward direction of the vehicle.
The Z-axis points up.
Roll, pitch, and yaw are clockwise-positive when looking in the forward direction of the X-axis, Y-axis, and Z-axis, respectively. If you view a scene from a 2D top-down perspective, then the yaw angle (also called the orientation angle) is counterclockwise-positive because you are viewing the scene in the negative direction of the Z-axis.
The origin is the mounting location specified in the Mounting location parameter. This origin is different from the vehicle origin, which is the geometric center of the vehicle.
If you mount the sensor to the scene origin by setting Parent
name to Scene Origin
, then
X, Y, and Z are in
the world coordinates of the scene.
For more details about the vehicle and world coordinate systems, see Coordinate Systems for Unreal Engine Simulation in Automated Driving Toolbox.
Example: [0,0,10]
Dependencies
To enable this parameter, select Specify offset.
Sample time — Sample time
-1
(default) | positive scalar
Sample time of the block, in seconds, specified as a positive scalar. The 3D simulation environment frame rate is the inverse of the sample time.
If you set the sample time to -1
, the block inherits its sample time from
the Simulation 3D Scene Configuration block.
Sensor Parameters
Intrinsic parametersRelative mounting locations (m) — Relative mounting locations of individual sensors in the ultrasonic
array
[[0, -0.67, 0]; [0, -0.22, 0]; [0, 0.22, 0]; [0, 0.67,
0]]
(default) | real-valued N-by-3
array
Relative mounting locations of individual sensors in the ultrasonic array,
specified as a real-valued N-by-3
array.
N is the number of sensors in the ultrasonic array and the
locations are relative to the sensor mounting position specified by the
Mounting Location
parameter. Each row of the array must be a
1-by-3 vector of the form [X, Y,
Z]. Units are in meters.
Relative mounting rotations (deg) — Relative mounting rotations of individual sensors in the ultrasonic array
zeros(4,3)
(default) | real-valued N-by-3
array
Relative mounting rotations of individual sensors in the ultrasonic array,
specified as a real-valued N-by-3
array.
N is the number of sensors in the ultrasonic array and the
rotations are relative to the sensor mounting orientation specified by the
Mounting Location
parameter. Each row of the array must be a
1-by-3 vector of the form [roll, pitch,
yaw]. Units are in degrees.
Horizontal Field of view (deg) — Horizontal field of view of ultrasonic array
70
(default) | positive real scalar
Horizontal field of view of ultrasonic array, specified as a positive real scalar.
This field of view defines the total angular extent spanned by all sensors of the
ultrasonic array in the horizontal direction relative to their orientations. You must
specify the horizontal field of view horizontalFOV
in the range (0,
360]. Units are in degrees.
Vertical field of view (deg) — Vertical field of view of ultrasonic array
35
(default) | positive real scalar
Vertical field of view of ultrasonic array, specified as a positive real scalar. This field of view defines the total angular extent spanned by all sensors of the ultrasonic array in the vertical direction relative to their orientations. You must specify the vertical field of view in the range (0, 180]. Units are in degrees.
Detection ranges (m) — Detection range vector of ultrasonic array (m)
[0.03 0.15 5.5]
(default) | 1-by-3 nonnegative real-valued vector of form [minDetOnlyRange
minDistRange maxDistRange]
Detection range vector of the ultrasonic array, specified as a 1-by-3 nonnegative
real-valued vector of the form [minDetOnlyRange minDistRange
maxDistRange]
, where minDetOnlyRange < minDistRange <
maxDistRange
. Units are in meters. These values determine the detections
and distance values returned by the ultrasonic array.
When the detected object is at a distance between
minDistRange
andmaxDistRange
, the sensor returns a positive distance value.When the detected object is at a distance between
minDetOnlyRange
andminDistRange
, the sensor detects the object, but cannot determine the distance and returns a value of0
.When the object is at a distance below
minDetOnlyRange
or abovemaxDistRange
, the sensor returns an empty cell array.
Acoustic frequency (kHz) — Frequency of sound waves used by all sensor emitters in ultrasonic array
50
(default) | positive real scalar
Frequency of sound waves used by all sensor emitters in the ultrasonic array, specified as a positive real scalar. Units are in kHz.
Sampling frequency (kHz) — Sampling frequency of all sensor receivers in ultrasonic array
500
(default) | positive real scalar
Sampling frequency of all sensor receivers in the ultrasonic array, specified as a positive real scalar. To sample a signal of a given frequency, the sampling frequency of the receiver must be at least two times that frequency. Units are in kHz.
Pulse width (s) — Pulse width of ultrasonic waves used by all sensors in ultrasonic array
1e-6
(default) | positive real scalar
Pulse width of the ultrasonic waves used by all sensors in the ultrasonic array, specified as a positive real scalar.
Gain — Vector gain for sound signal used by sensors in ultrasonic array
[1, 0]
(default) | real-valued scalar | real-valued 1
-by-2
vector
Vector gain for the sound signal used by the sensors in ultrasonic array,
real-valued scalar or a 1
-by-2
vector of the
form [a, b]
. The blocks multiplies the scalar gain as a constant,
and the vector gain as a time signal of the form a + b*t
with the
ultrasonic signal.
Sound speed (m/s) — Speed of sound in environment
330
(default) | positive real scalar
Speed of sound in the environment, specified as a positive real scalar. Units are in m/s.
Use bus output — Select to output signals together as bus signal
on
(default) |
off
Select to output detections as a bus signal using the Detections port. Clear Use bus output to instead enable the Has object, Has range, and Range output ports.
Ground Truth
Output location (m) and orientation (rad) — Output location and orientation of sensor
off
(default) | on
Select this parameter to output the translation and rotation of the sensor at the Translation and Rotation ports, respectively.
Version History
Introduced in R2023aR2024a: Requires Simulink 3D Animation
Simulating models with the Simulation 3D Ultrasonic Array block requires Simulink 3D Animation.
R2024a: Ground truth parameter
On the Ground Truth tab, select Output location (m) and orientation (rad) to output the translation and rotation of the sensor at the Translation and Rotation ports, respectively.
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)