docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct MessageTypeId

    Identifies a ROS message type by name and an optional disambiguator.

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.SimulationPro.Foundation
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    public struct MessageTypeId
    Remarks

    Some ROS packages define message types with the same base name. The MessageDisambiguator distinguishes between them when registering publishers or subscribers.

    Constructors

    MessageTypeId(string, MessageDisambiguator)

    Initializes a new MessageTypeId with the specified type name and optional disambiguator.

    Declaration
    public MessageTypeId(string messageTypeName, MessageDisambiguator disambiguator = MessageDisambiguator.Default)
    Parameters
    Type Name Description
    string messageTypeName

    The fully-qualified ROS message type name.

    MessageDisambiguator disambiguator

    An optional disambiguator. Defaults to Default.

    Properties

    Disambiguator

    Gets the disambiguator that resolves naming collisions between message types.

    Declaration
    public readonly MessageDisambiguator Disambiguator { get; }
    Property Value
    Type Description
    MessageDisambiguator

    IsValid

    Gets a value indicating whether this instance holds a valid (non-empty) message type name.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    MessageTypeName

    Gets the fully-qualified ROS message type name (for example, geometry_msgs/Point).

    Declaration
    public readonly string MessageTypeName { get; }
    Property Value
    Type Description
    string

    Methods

    Equals(object)

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    object other
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns the message type name, appending the disambiguator in parentheses when it is not Default.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A human-readable string identifying this message type.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(MessageTypeId, MessageTypeId)

    Returns true if both instances have the same type name and disambiguator.

    Declaration
    public static bool operator ==(MessageTypeId a, MessageTypeId b)
    Parameters
    Type Name Description
    MessageTypeId a

    The left operand.

    MessageTypeId b

    The right operand.

    Returns
    Type Description
    bool

    true when equal; otherwise false.

    operator !=(MessageTypeId, MessageTypeId)

    Returns true if the instances differ in type name or disambiguator.

    Declaration
    public static bool operator !=(MessageTypeId a, MessageTypeId b)
    Parameters
    Type Name Description
    MessageTypeId a

    The left operand.

    MessageTypeId b

    The right operand.

    Returns
    Type Description
    bool

    true when not equal; otherwise false.

    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)