docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Pose2DMsg

    ROS geometry_msgs/Pose2D message.

    Inheritance
    object
    Pose2DMsg
    Implements
    IMessage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.SimulationPro.Foundation.GeometryMessages
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    [Serializable]
    public class Pose2DMsg : IMessage

    Constructors

    Pose2DMsg()

    Initializes a new instance with default values.

    Declaration
    public Pose2DMsg()

    Pose2DMsg(double, double, double)

    Initializes a new instance with default values.

    Declaration
    public Pose2DMsg(double x, double y, double theta)
    Parameters
    Type Name Description
    double x

    X-axis component.

    double y

    Y-axis component.

    double theta

    Rotation angle in radians.

    Fields

    k_MessageTypeId

    Identifier for this message type.

    Declaration
    public static readonly MessageTypeId k_MessageTypeId
    Field Value
    Type Description
    MessageTypeId

    k_MessageTypeName

    The ROS message type name string used for serialization and topic matching.

    Declaration
    public const string k_MessageTypeName = "geometry_msgs/Pose2D"
    Field Value
    Type Description
    string

    theta

    Theta field.

    Declaration
    public double theta
    Field Value
    Type Description
    double

    x

    Deprecated as of Foxy and will potentially be removed in any following release. Please use the full 3D pose. In general our recommendation is to use a full 3D representation of everything and for 2D specific applications make the appropriate projections into the plane for their calculations but optimally will preserve the 3D information during processing. If we have parallel copies of 2D datatypes every UI and other pipeline will end up needing to have dual interfaces to plot everything. And you will end up with not being able to use 3D tools for 2D use cases even if they're completely valid, as you'd have to reimplement it with different inputs and outputs. It's not particularly hard to plot the 2D pose or compute the yaw error for the Pose message and there are already tools and libraries that can do this for you.# This expresses a position and orientation on a 2D manifold.

    Declaration
    public double x
    Field Value
    Type Description
    double

    y

    Y field.

    Declaration
    public double y
    Field Value
    Type Description
    double

    Properties

    MessageTypeId

    Gets the unique runtime identifier for this message type.

    Declaration
    public MessageTypeId MessageTypeId { get; }
    Property Value
    Type Description
    MessageTypeId

    MessageTypeName

    Gets the ROS message type name for this message.

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

    Methods

    Deserialize(IMessageDeserializer)

    Deserializes a Pose2DMsg from the given deserializer.

    Declaration
    public static Pose2DMsg Deserialize(IMessageDeserializer deserializer)
    Parameters
    Type Name Description
    IMessageDeserializer deserializer

    The deserializer.

    Returns
    Type Description
    Pose2DMsg

    A new Pose2DMsg instance.

    Register()

    Registers this message type with the MessageTypeRegistry.

    Declaration
    [InitializeOnLoadMethod]
    public static void Register()

    ToString()

    Returns a human-readable string representation of this message.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of this instance.

    Overrides
    object.ToString()

    WriteTo(IMessageSerializer)

    Serializes this message to the given serializer.

    Declaration
    public void WriteTo(IMessageSerializer serializer)
    Parameters
    Type Name Description
    IMessageSerializer serializer

    The serializer.

    Implements

    IMessage
    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)