docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MarkerMsg

    ROS visualization_msgs/Marker message.

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

    Constructors

    MarkerMsg()

    Initializes a new instance with default values.

    Declaration
    public MarkerMsg()

    MarkerMsg(HeaderMsg, string, int, int, int, PoseMsg, Vector3Msg, ColorRGBAMsg, DurationMsg, bool, PointMsg[], ColorRGBAMsg[], string, string, bool)

    Initializes a new instance with default values.

    Declaration
    public MarkerMsg(HeaderMsg header, string ns, int id, int type, int action, PoseMsg pose, Vector3Msg scale, ColorRGBAMsg color, DurationMsg lifetime, bool frame_locked, PointMsg[] points, ColorRGBAMsg[] colors, string text, string mesh_resource, bool mesh_use_embedded_materials)
    Parameters
    Type Name Description
    HeaderMsg header

    ROS message header containing timestamp and coordinate frame identifier.

    string ns

    ROS namespace for scoping this element.

    int id

    Unique integer identifier.

    int type

    Integer type code specifying the variant or category.

    int action

    The action message payload.

    PoseMsg pose

    Position and orientation in 3D space.

    Vector3Msg scale

    Scale factor along each axis.

    ColorRGBAMsg color

    RGBA color.

    DurationMsg lifetime

    Duration this marker remains visible; zero means permanent.

    bool frame_locked

    Whether the marker position updates with its TF frame.

    PointMsg[] points

    Array of 3D points.

    ColorRGBAMsg[] colors

    Array of per-vertex or per-point RGBA colors.

    string text

    Human-readable text content.

    string mesh_resource

    URI of the mesh resource to display (package:// or file://).

    bool mesh_use_embedded_materials

    Whether to use materials embedded in the mesh resource.

    Fields

    ADD

    Constant value for ADD.

    Declaration
    public const int ADD = 0
    Field Value
    Type Description
    int

    ARROW

    See:

    • http://www.ros.org/wiki/rviz/DisplayTypes/Marker
    • http://www.ros.org/wiki/rviz/Tutorials/Markers%3A%20Basic%20Shapes for more information on using this message with rviz.
    Declaration
    public const int ARROW = 0
    Field Value
    Type Description
    int

    CUBE

    Constant value for CUBE.

    Declaration
    public const int CUBE = 1
    Field Value
    Type Description
    int

    CUBE_LIST

    Constant value for CUBE_LIST.

    Declaration
    public const int CUBE_LIST = 6
    Field Value
    Type Description
    int

    CYLINDER

    Constant value for CYLINDER.

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

    DELETE

    Constant value for DELETE.

    Declaration
    public const int DELETE = 2
    Field Value
    Type Description
    int

    DELETEALL

    Constant value for DELETEALL.

    Declaration
    public const int DELETEALL = 3
    Field Value
    Type Description
    int

    LINE_LIST

    Constant value for LINE_LIST.

    Declaration
    public const int LINE_LIST = 5
    Field Value
    Type Description
    int

    LINE_STRIP

    Constant value for LINE_STRIP.

    Declaration
    public const int LINE_STRIP = 4
    Field Value
    Type Description
    int

    MESH_RESOURCE

    Constant value for MESH_RESOURCE.

    Declaration
    public const int MESH_RESOURCE = 10
    Field Value
    Type Description
    int

    MODIFY

    Constant value for MODIFY.

    Declaration
    public const int MODIFY = 0
    Field Value
    Type Description
    int

    POINTS

    Constant value for POINTS.

    Declaration
    public const int POINTS = 8
    Field Value
    Type Description
    int

    SPHERE

    Constant value for SPHERE.

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

    SPHERE_LIST

    Constant value for SPHERE_LIST.

    Declaration
    public const int SPHERE_LIST = 7
    Field Value
    Type Description
    int

    TEXT_VIEW_FACING

    Constant value for TEXT_VIEW_FACING.

    Declaration
    public const int TEXT_VIEW_FACING = 9
    Field Value
    Type Description
    int

    TRIANGLE_LIST

    Constant value for TRIANGLE_LIST.

    Declaration
    public const int TRIANGLE_LIST = 11
    Field Value
    Type Description
    int

    action

    Action to take; one of:

    • 0 add/modify an object
    • 1 (deprecated)
    • 2 deletes an object
    • 3 deletes all objects
    Declaration
    public int action
    Field Value
    Type Description
    int

    color

    Color of the object; in the range: [0.0-1.0]

    Declaration
    public ColorRGBAMsg color
    Field Value
    Type Description
    ColorRGBAMsg

    colors

    Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, etc.) The number of colors provided must either be 0 or equal to the number of points provided. NOTE: alpha is not yet used

    Declaration
    public ColorRGBAMsg[] colors
    Field Value
    Type Description
    ColorRGBAMsg[]

    frame_locked

    If this marker should be frame-locked, i.e. retransformed into its frame every timestep.

    Declaration
    public bool frame_locked
    Field Value
    Type Description
    bool

    header

    Header for timestamp and frame id.

    Declaration
    public HeaderMsg header
    Field Value
    Type Description
    HeaderMsg

    id

    Object ID used in conjunction with the namespace for manipulating and deleting the object later.

    Declaration
    public int id
    Field Value
    Type Description
    int

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

    lifetime

    How long the object should last before being automatically deleted. 0 indicates forever.

    Declaration
    public DurationMsg lifetime
    Field Value
    Type Description
    DurationMsg

    mesh_resource

    Only used for MESH_RESOURCE markers.

    Declaration
    public string mesh_resource
    Field Value
    Type Description
    string

    mesh_use_embedded_materials

    Mesh use embedded materials field.

    Declaration
    public bool mesh_use_embedded_materials
    Field Value
    Type Description
    bool

    ns

    Namespace in which to place the object. Used in conjunction with id to create a unique name for the object.

    Declaration
    public string ns
    Field Value
    Type Description
    string

    points

    Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, etc.)

    Declaration
    public PointMsg[] points
    Field Value
    Type Description
    PointMsg[]

    pose

    Pose of the object with respect the frame_id specified in the header.

    Declaration
    public PoseMsg pose
    Field Value
    Type Description
    PoseMsg

    scale

    Scale of the object; 1,1,1 means default (usually 1 meter square).

    Declaration
    public Vector3Msg scale
    Field Value
    Type Description
    Vector3Msg

    text

    Only used for text markers

    Declaration
    public string text
    Field Value
    Type Description
    string

    type

    Type of object.

    Declaration
    public int type
    Field Value
    Type Description
    int

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

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

    The deserializer.

    Returns
    Type Description
    MarkerMsg

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