namespace RobotNet10.Shared.Sensor;
///
/// PointCloud2 message (sensor_msgs/PointCloud2)
/// 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.
///
public struct PointCloud2
{
///
/// Header with timestamp and frame ID
///
public Header Header { get; set; }
///
/// Height of the cloud
///
public uint Height { get; set; }
///
/// Width of the cloud
///
public uint Width { get; set; }
///
/// Describes the channels and their layout in the binary data blob
///
public PointField[] Fields { get; set; }
///
/// Is this data bigendian?
///
public bool IsBigendian { get; set; }
///
/// Length of a point in bytes
///
public uint PointStep { get; set; }
///
/// Length of a row in bytes
///
public uint RowStep { get; set; }
///
/// Actual point data, size is (row_step*height)
///
public byte[] Data { get; set; }
///
/// True if there are no invalid points
///
public bool IsDense { get; set; }
///
/// Default constructor
///
public PointCloud2()
{
Header = new Header();
Height = 0;
Width = 0;
Fields = Array.Empty();
IsBigendian = false;
PointStep = 0;
RowStep = 0;
Data = Array.Empty();
IsDense = false;
}
}
///
/// PointField message (sensor_msgs/PointField)
/// This message holds the description of one point entry in the PointCloud2 message format
///
public struct PointField
{
///
/// Point field name constants
///
public const string NameX = "x";
public const string NameY = "y";
public const string NameZ = "z";
public const string NameRgb = "rgb";
public const string NameIntensity = "intensity";
///
/// Name of field
///
public string Name { get; set; }
///
/// Offset from start of point struct
///
public uint Offset { get; set; }
///
/// Datatype enumeration constants
///
public const byte Int8 = 1;
public const byte Uint8 = 2;
public const byte Int16 = 3;
public const byte Uint16 = 4;
public const byte Int32 = 5;
public const byte Uint32 = 6;
public const byte Float32 = 7;
public const byte Float64 = 8;
///
/// Datatype enumeration (Datatype constants)
///
public byte Datatype { get; set; }
///
/// How many elements in field
///
public uint Count { get; set; }
///
/// Default constructor
///
public PointField()
{
Name = string.Empty;
Offset = 0;
Datatype = 0;
Count = 0;
}
}