docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SolidPrimitiveMsg

    ROS shape_msgs/SolidPrimitive message.

    Inheritance
    object
    SolidPrimitiveMsg
    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.ShapeMessages
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    [Serializable]
    public class SolidPrimitiveMsg : IMessage

    Constructors

    SolidPrimitiveMsg()

    Initializes a new instance with default values.

    Declaration
    public SolidPrimitiveMsg()

    SolidPrimitiveMsg(byte, double[])

    Initializes a new instance with default values.

    Declaration
    public SolidPrimitiveMsg(byte type, double[] dimensions)
    Parameters
    Type Name Description
    byte type

    Integer type code specifying the variant or category.

    double[] dimensions

    Array of dimension values (radius, height, etc.) for the primitive.

    Fields

    BOX

    Defines box, sphere, cylinder, and cone. All shapes are defined to have their bounding boxes centered around 0,0,0.

    Declaration
    public const byte BOX = 1
    Field Value
    Type Description
    byte

    BOX_X

    At no point will dimensions have a length > 3. The meaning of the shape dimensions: each constant defines the index in the 'dimensions' array. For type BOX, the X, Y, and Z dimensions are the length of the corresponding sides of the box.

    Declaration
    public const byte BOX_X = 0
    Field Value
    Type Description
    byte

    BOX_Y

    Constant value for BOX_Y.

    Declaration
    public const byte BOX_Y = 1
    Field Value
    Type Description
    byte

    BOX_Z

    Constant value for BOX_Z.

    Declaration
    public const byte BOX_Z = 2
    Field Value
    Type Description
    byte

    CONE

    Constant value for CONE.

    Declaration
    public const byte CONE = 4
    Field Value
    Type Description
    byte

    CONE_HEIGHT

    Constant value for CONE_HEIGHT.

    Declaration
    public const byte CONE_HEIGHT = 0
    Field Value
    Type Description
    byte

    CONE_RADIUS

    Constant value for CONE_RADIUS.

    Declaration
    public const byte CONE_RADIUS = 1
    Field Value
    Type Description
    byte

    CYLINDER

    Constant value for CYLINDER.

    Declaration
    public const byte CYLINDER = 3
    Field Value
    Type Description
    byte

    CYLINDER_HEIGHT

    For the CYLINDER and CONE types, the center line is oriented along the Z axis. Therefore the CYLINDER_HEIGHT (CONE_HEIGHT) component of dimensions gives the height of the cylinder (cone). The CYLINDER_RADIUS (CONE_RADIUS) component of dimensions gives the radius of the base of the cylinder (cone). Cone and cylinder primitives are defined to be circular. The tip of the cone is pointing up, along +Z axis.

    Declaration
    public const byte CYLINDER_HEIGHT = 0
    Field Value
    Type Description
    byte

    CYLINDER_RADIUS

    Constant value for CYLINDER_RADIUS.

    Declaration
    public const byte CYLINDER_RADIUS = 1
    Field Value
    Type Description
    byte

    SPHERE

    Constant value for SPHERE.

    Declaration
    public const byte SPHERE = 2
    Field Value
    Type Description
    byte

    SPHERE_RADIUS

    For the SPHERE type, only one component is used, and it gives the radius of the sphere.

    Declaration
    public const byte SPHERE_RADIUS = 0
    Field Value
    Type Description
    byte

    dimensions

    The dimensions of the shape

    Declaration
    public double[] dimensions
    Field Value
    Type Description
    double[]

    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 = "shape_msgs/SolidPrimitive"
    Field Value
    Type Description
    string

    type

    The type of the shape

    Declaration
    public byte type
    Field Value
    Type Description
    byte

    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 SolidPrimitiveMsg from the given deserializer.

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

    The deserializer.

    Returns
    Type Description
    SolidPrimitiveMsg

    A new SolidPrimitiveMsg 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)