Main Content

sim3d.sensors.UltrasonicSensor

Implement ultrasonic sensor model

Since R2024b

    Description

    Use the sim3d.sensors.UltrasonicSensor object to implement an ultrasonic sensor in a 3D environment. After you create a sim3d.sensors.UltrasonicSensor object, you can modify aspects of the actor object by setting property values.

    Creation

    Description

    ultrasonicSensor = sim3d.sensors.UltrasonicSensor() creates a default sim3d.sensors.UltrasonicSensor object in the 3D environment.

    ultrasonicSensor = sim3d.sensors.UltrasonicSensor(Name=Value) specifies options using one or more optional name-value arguments. For example, to create a lidar sensor with a range of 4 meters, set Range to 4.

    Input Arguments

    expand all

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: ultrasonicSensor = sim3d.sensors.UltrasonicSensor(ActorName='UltrasonicSensor',Range=4)

    Name of actor, specified as a character array or string. If you do not specify an actor name, then the software assigns the actor an autogenerated name. Use this argument to set the name of the sim3d.sensors.UltrasonicSensor object.

    Note

    If you specify the same name as an actor that already exists, then the software appends actor name you specify with a unique identifier.

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real 1-by-3 vector, in m. Use Translation to change the position of the sim3d.sensors.UltrasonicSensor object in the 3D environment along the X, Y, and Z axes of the coordinate system. When you add an actor to the 3D environment, the default parent actor is the Scene Origin at (0,0,0).

    Example: Translation=[1 2 1]

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real 1-by-3 vector, in rad. Use Rotation to rotate the sim3d.sensors.UltrasonicSensor object in the 3D environment.

    Example: Rotation=[pi/4 pi/8 pi/2]

    Detection range of the ultrasonic sensor, specified as a scalar. Units are in meters. This value determines the detections and distance values returned by the ultrasonic sensor. When the detected object is at a distance within the Range, the sensor returns a positive distance value.

    Example: Range=8

    Field of view of ultrasonic sensor, specified as a positive real scalar of the form [horizontalFOV, verticalFOV], in the range (0,180). Units are in degrees. horizontalFOV and verticalFOV define the total angular extent spanned by the sensor in the horizontal direction and the vertical direction, respectively.

    Example: FieldOfView=[40 30]

    Properties

    expand all

    Parent of actor, specified as a handle to the parent actor object. After you add an actor to the sim3d.World object, the default parent actor is the Scene Origin at (0,0,0). Use Parent to set any actor in the 3D environment as the parent actor of a sim3d.sensors.UltrasonicSensor object.

    This property is read-only.

    Children of actor, specified as a structure. Each field of the structure contains a handle to the child of a sim3d.sensors.UltrasonicSensor object.

    Parent world, specified as a handle to the parent sim3d.World object. You can use this property only if the sim3d.sensors.UltrasonicSensor object is added to the parent sim3d.World object.

    This property is read-only.

    Unique ID of the sensor, specified as a real positive scalar.

    Data Types: uint32

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real 1-by-3 vector, in m. Use Translation to change the position of the sim3d.sensors.UltrasonicSensor object in the 3D environment along the X, Y, and Z axes of the coordinate system. When you add an actor to the 3D environment, the default parent actor is the Scene Origin at (0,0,0).

    Example: ultrasonicSensor.Translation = [1 2 1]

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real 1-by-3 vector, in rad. Use Rotation to rotate the sim3d.sensors.UltrasonicSensor object in the 3D environment.

    Example: ultrasonicSensor.Rotation = [pi/4 pi/8 pi/2]

    Type of actor mobility to respond to physics, move the actor during simulation, or both, specified as 'sim3d.utils.MobilityTypes.Movable' or 'sim3d.utils.MobilityTypes.Static'.

    Example: ultrasonicSensor.Mobility = sim3d.utils.MobilityTypes.Movable

    Data Types: sim3d.utils.MobilityTypes

    Detection range of the ultrasonic sensor, specified as a scalar. Units are in meters. This value determines the detections and distance values returned by the ultrasonic sensor. When the detected object is at a distance within the Range, the sensor returns a positive distance value.

    Example: ultrasonicSensor.Range = 4

    Field of view of ultrasonic sensor, specified as a positive real scalar of the form [horizontalFOV, verticalFOV], in the range (0,180). Units are in degrees. horizontalFOV and verticalFOV define the total angular extent spanned by the sensor in the horizontal direction and the vertical direction, respectively.

    Example: ultrasonicSensor.FieldOfView = [40 30]

    Object Functions

    readReturn target detections using ultrasonic sensor

    Version History

    Introduced in R2024b