docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Introduction to sensors

    Learn how Simulation Pro sensors capture simulation data and publish it as ROS messages.

    Simulation Pro provides a sensor framework for simulating robotics sensors in Unity. Sensors are MonoBehaviour components that produce ROS messages from simulation data.

    Sensor base class

    All sensors inherit from Sensor, which provides:

    • InitializeSensor(): called by Sensor.Start() to wire up processing nodes and publishers.
    • ShutdownSensor(): called by Sensor.OnDestroy() to release resources.
    • SetProperty(key, value): applies named string properties, for example properties set during URDF import.
    • InheritTopicNamespace: optionally inherits a topic namespace prefix from a parent InheritTopicNamespace component.

    Each sensor contains one or more nodes (data processing stages) connected by ports (SensorPort<T>). Data flows through the node graph when a sensor fires.

    Camera/ArticulationBody
            │
        [SensorNode]        ← reads from Unity physics / rendering
            │
        [ProcessingNode]    ← applies transforms, noise, coordinate conversions
            │
        [PublisherNode]     ← sends via IConnector
            │
      ROS Topic
    

    Scheduling

    The Scheduler class manages time-based firing of sensor nodes relative to Clock.Now. Each sensor node registers itself with the scheduler at InitializeSensor() and fires at the configured update rate.

    Noise

    Apply Gaussian noise to sensor readings with GaussianNoise. For example, configure IMU noise through ImuSensor.m_ImuNode.Noise:

    imuSensor.m_ImuNode.Noise.Mean   = 0.0;
    imuSensor.m_ImuNode.Noise.Stddev = 0.01;
    

    Image sensors support ImageGaussianNoise for per-pixel noise injection.

    Custom material properties

    Sensors that depend on depth rendering support custom shader material properties through MaterialPropertiesAsset and the ICustomMaterialProperties interface. Assign a SensorMaterial asset to control which materials in the scene are visible to a specific sensor.

    Save sensor output to disk

    Use the following utility classes to save sensor output to disk:

    Class Description
    ImageMessageSaver Saves sensor_msgs/Image messages to disk as image files.
    PointCloudMessageSaver Saves sensor_msgs/PointCloud2 messages to .pcd or .las files.
    PcdWriter Writes PCD-format point cloud files.
    LasWriter Writes LAS-format point cloud files.

    Additional resources

    • Sensor types reference
    • Add a sensor to a scene
    In This Article
    Back to top
    Copyright © 2026 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)