docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PointCloud2Msg

    ROS sensor_msgs/PointCloud2 message.

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

    Constructors

    PointCloud2Msg()

    True if there are no invalid points

    Declaration
    public PointCloud2Msg()

    PointCloud2Msg(HeaderMsg, uint, uint, PointFieldMsg[], bool, uint, uint, byte[], bool)

    Initializes a new instance with default values.

    Declaration
    public PointCloud2Msg(HeaderMsg header, uint height, uint width, PointFieldMsg[] fields, bool is_bigendian, uint point_step, uint row_step, byte[] data, bool is_dense)
    Parameters
    Type Name Description
    HeaderMsg header

    ROS message header containing timestamp and coordinate frame identifier.

    uint height

    Image height in pixels.

    uint width

    Image width in pixels.

    PointFieldMsg[] fields

    Array of field descriptors for each data channel.

    bool is_bigendian

    Whether multi-byte values use big-endian byte order.

    uint point_step

    Length of a single point entry in bytes.

    uint row_step

    Length of a full row in bytes.

    byte[] data

    The payload data for this message.

    bool is_dense

    Whether the data array contains no invalid points.

    Fields

    data

    Length of a row in bytes

    Declaration
    public byte[] data
    Field Value
    Type Description
    byte[]

    fields

    Describes the channels and their layout in the binary data blob.

    Declaration
    public PointFieldMsg[] fields
    Field Value
    Type Description
    PointFieldMsg[]

    header

    This message holds a collection of N-dimensional points, which may contain additional information such as normals, intensity, etc. The point data is stored as a binary blob, its layout described by the contents of the "fields" array. The point cloud data may be organized 2d (image-like) or 1d (unordered). Point clouds organized as 2d images may be produced by camera depth sensors such as stereo or time-of-flight. Time of sensor data acquisition, and the coordinate frame ID (for 3d points).

    Declaration
    public HeaderMsg header
    Field Value
    Type Description
    HeaderMsg

    height

    2D structure of the point cloud. If the cloud is unordered, height is 1 and width is the length of the point cloud.

    Declaration
    public uint height
    Field Value
    Type Description
    uint

    is_bigendian

    Is bigendian field.

    Declaration
    public bool is_bigendian
    Field Value
    Type Description
    bool

    is_dense

    Actual point data, size is (row_step*height)

    Declaration
    public bool is_dense
    Field Value
    Type Description
    bool

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

    point_step

    Is this data bigendian?

    Declaration
    public uint point_step
    Field Value
    Type Description
    uint

    row_step

    Length of a point in bytes

    Declaration
    public uint row_step
    Field Value
    Type Description
    uint

    width

    Width field.

    Declaration
    public uint width
    Field Value
    Type Description
    uint

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

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

    The deserializer.

    Returns
    Type Description
    PointCloud2Msg

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