docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Laser configuration

    SensorSDK can emulate lidar lasers in the Unity editor. The lidar laser distribution and timing is defined through a laser configuration component.

    You can specify a laser configuration using one of the following components: Spherical Laser Config, Grid Laser Config or Frustum Laser Config. These are MonoBehaviours that you can attach to a GameObject and then bind to a lidar controller node in a system graph.

    You can also specify a laser configuration using a LaserConfigAsset or a JSON file.

    Parts of a laser configuration

    A laser configuration defines two parts: the laser distribution and the laser firing sequence.

    Laser distribution

    The laser distribution specifies the position and orientation of all lasers of the lidar sensor. It's defined parametrically for spherical, grid or frustum distributions, or using a list of positions and orientations for laser configuration assets.

    Firing sequence

    The firing sequence specifies when each laser will fire its light beam. All light beams are fired relative to a trigger time. The trigger time is defined by the lidar controller based on different information, including the sampling rate, the laser count, the rotation speed and the horizontal field of view.

    Laser configuration components

    Spherical Laser Config

    This laser configuration makes a spherical distribution of the lasers from a center point defined by the photosensor GameObject position. It also defines when the laser beams will be fired.

    This laser configuration is a component that you can attach on any GameObject. You must bind it to the lidar controller binding in the associated System Graph Component.

    Distribution

    Input Description
    Azimuth Start Angle from the sensor's forward vector (Z+) to position the first laser on the azimuth plane (XZ plane), in degrees.
    Azimuth Step Angle step from the start position to position the following lasers on the azimuth plane (XZ plane), in degrees.
    Azimuth Count Number of lasers to position on the azimuth plane (XZ plane).
    Elevation Start Angle from the sensor's forward vector (Z+) to position the first laser on the elevation plane (YZ plane), in degrees.
    Elevation Step Angle step from the start position to position the following lasers on the elevation plane (YZ plane), in degrees.
    Elevation Count Number of lasers to position on the elevation plane (YZ plane).
    Radius Distance from the center, in meters. The center position is defined by the photosensor GameObject having a sensing component attached to it.

    Firing sequence

    You can specify a constant time step between consecutive laser beams. You can either select a Custom time step, in seconds, or select the Maximum Possible time step to get a uniform firing sequence. The latter will compute the time step from the time between consecutive triggers divided by the laser count.

    Grid Laser Config

    This laser configuration makes a rectangular grid distribution perpendicular to the forward vector of the photosensor (Z+).

    This laser configuration is a component that you can attach on any GameObject. You must bind it to the lidar controller binding in the associated System Graph Component.

    Input Description
    X Start Position, in meters, of the first laser on the X axis, looking at Z+.
    X Step Distance, in meters, between lasers on the X axis, looking at Z+.
    X Count Number of lasers on the X axis, looking at Z+.
    Y Start Position, in meters, of the first laser on the Y axis, looking at Z+.
    Y Step Distance, in meters, between lasers on the Y axis, looking at Z+.
    Y Count Number of lasers on the Y axis, looking at Z+.
    Z Offset Distance, in meters, on the Z axis.

    Frustum Laser Config

    This laser configuration makes a frustum distribution of the laser from a center point defined by the photosensor GameObject position. The Time-of-Flight camera uses this configuration.

    This laser configuration is a component that you can attach on any GameObject. You must bind it to the lidar controller binding in the associated System Graph Component.

    Input Description
    Fov Axis Specifies whether Fov is the horizontal or vertical field of view.
    Fov Field of view, in degrees.
    Resolution X Number of laser beams (or pixels) horizontally.
    Resolution Y Number of laser beams (or pixels) vertically.

    SingleForwardLaserConfig

    This laser configuration makes a single laser beam pointing forward (Z+). It's the default laser configuration when no laser configuration is bound to a sensor, and it's only accessible through code.

    LaserConfigAsset

    This laser configuration lets you define the position, orientation, and firing sequence of all lasers.

    Input Description
    Azimuth Offsets Angle from the sensor's forward vector (Z+) on the azimuth plane (XZ plane), in degrees.
    Elevation Offsets Angle from the sensor's forward vector (Z+) on the elevation plane (YZ plane), in degrees.
    Firing Sequence Elapsed time since the controller triggered a firing sequence, in seconds.
    Important

    The lists of azimuth offsets, elevation offsets and firing sequence must have the same size.

    Specify the LaserConfigAsset using an asset

    To create a LaserConfigAsset:

    1. Right-click in the Project window.
    2. Select Create > SensorSDK > LaserConfigAsset and name the new asset.
    3. Fill in the three lists in the Inspector window.
    4. Bind the asset to your lidar controller.

    Specify the LaserConfigAsset using a JSON file

    Create a JSON file with the .laserconfig extension in the project Assets folder. It will be automatically imported and converted into a read-only LaserConfigAsset. You can then bind this asset to a lidar controller.

    Here is an example of a laser configuration JSON file:

    {
        "elevationOffsets": [
            46.1999,
            45.1197,
            44.3589,
            -45.1197,
            -46.1999
        ],
        "azimuthOffsets": [
            11.148,
            3.6772,
            -3.6392,
            -10.8077
         ],
        "firingSequence": [
            0,
            0.1,
            0.15,
            0.23
         ]
    }
    
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)