docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SensorHelper

    Utility methods related to ISensor implementations.

    Inheritance
    object
    SensorHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MLAgents.Sensors
    Assembly: Unity.ML-Agents.dll
    Syntax
    public static class SensorHelper

    Methods

    CompareObservation(ISensor, float[,,], out string)

    Generates the observations for the provided sensor, and returns true if they equal the expected values. If they are unequal, errorMessage is also set. This should not generally be used in production code. It is only intended for simplifying unit tests.

    Declaration
    public static bool CompareObservation(ISensor sensor, float[,,] expected, out string errorMessage)
    Parameters
    Type Name Description
    ISensor sensor
    float[,,] expected
    string errorMessage
    Returns
    Type Description
    bool

    CompareObservation(ISensor, float[], out string)

    Generates the observations for the provided sensor, and returns true if they equal the expected values. If they are unequal, errorMessage is also set. This should not generally be used in production code. It is only intended for simplifying unit tests.

    Declaration
    public static bool CompareObservation(ISensor sensor, float[] expected, out string errorMessage)
    Parameters
    Type Name Description
    ISensor sensor
    float[] expected
    string errorMessage
    Returns
    Type Description
    bool
    In This Article
    Back to top
    Copyright © 2025 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)