Initial commit

This commit is contained in:
2026-07-03 16:31:37 +07:00
commit 899c7c637d
1939 changed files with 641750 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// BatteryState message (sensor_msgs/BatteryState)
/// Describes the state of a battery
/// </summary>
public struct BatteryState
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Voltage in Volts (Mandatory)
/// </summary>
public double Voltage { get; set; }
/// <summary>
/// Current in Amperes (If not available: NaN)
/// </summary>
public double Current { get; set; }
/// <summary>
/// Charge in Ah (If not available: NaN)
/// </summary>
public double Charge { get; set; }
/// <summary>
/// Capacity in Ah (last full capacity) (If not available: NaN)
/// </summary>
public double Capacity { get; set; }
/// <summary>
/// Design capacity in Ah (If not available: NaN)
/// </summary>
public double DesignCapacity { get; set; }
/// <summary>
/// Percentage (0-100) (If not available: NaN)
/// </summary>
public double Percentage { get; set; }
/// <summary>
/// Power supply status constants
/// </summary>
public const byte PowerSupplyStatusUnknown = 0;
public const byte PowerSupplyStatusCharging = 1;
public const byte PowerSupplyStatusDischarging = 2;
public const byte PowerSupplyStatusNotCharging = 3;
public const byte PowerSupplyStatusFull = 4;
/// <summary>
/// Power supply status (PowerSupplyStatus constants)
/// </summary>
public byte PowerSupplyStatus { get; set; }
/// <summary>
/// Power supply health constants
/// </summary>
public const byte PowerSupplyHealthUnknown = 0;
public const byte PowerSupplyHealthGood = 1;
public const byte PowerSupplyHealthOverheat = 2;
public const byte PowerSupplyHealthDead = 3;
public const byte PowerSupplyHealthOvervoltage = 4;
public const byte PowerSupplyHealthUnspecifiedFailure = 5;
public const byte PowerSupplyHealthCold = 6;
/// <summary>
/// Power supply health (PowerSupplyHealth constants)
/// </summary>
public byte PowerSupplyHealth { get; set; }
/// <summary>
/// Power supply technology (chemistry) constants
/// </summary>
public const byte PowerSupplyTechnologyUnknown = 0;
public const byte PowerSupplyTechnologyNiMh = 1;
public const byte PowerSupplyTechnologyLion = 2;
public const byte PowerSupplyTechnologyLipo = 3;
public const byte PowerSupplyTechnologyLife = 4;
public const byte PowerSupplyTechnologyNiCd = 5;
public const byte PowerSupplyTechnologyLiMn = 6;
/// <summary>
/// Power supply technology (PowerSupplyTechnology constants)
/// </summary>
public byte PowerSupplyTechnology { get; set; }
/// <summary>
/// True if the battery is present
/// </summary>
public bool Present { get; set; }
/// <summary>
/// An array of individual cell voltages. Each individual cell voltage should be > 0.0.
/// If not available: empty array
/// </summary>
public double[] CellVoltage { get; set; }
/// <summary>
/// An array of individual cell temperatures. Each individual cell temperature should be > 0.0.
/// If not available: empty array
/// </summary>
public double[] CellTemperature { get; set; }
/// <summary>
/// The location into which the battery is inserted. (slot number or plug)
/// </summary>
public string Location { get; set; }
/// <summary>
/// The serial number of the battery pack.
/// </summary>
public string SerialNumber { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public BatteryState()
{
Header = new Header();
Voltage = 0.0;
Current = double.NaN;
Charge = double.NaN;
Capacity = double.NaN;
DesignCapacity = double.NaN;
Percentage = double.NaN;
PowerSupplyStatus = PowerSupplyStatusUnknown;
PowerSupplyHealth = PowerSupplyHealthUnknown;
PowerSupplyTechnology = PowerSupplyTechnologyUnknown;
Present = false;
CellVoltage = [];
CellTemperature = [];
Location = string.Empty;
SerialNumber = string.Empty;
}
}

View File

@@ -0,0 +1,153 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// CameraInfo message (sensor_msgs/CameraInfo)
/// This message defines meta information for a camera
/// </summary>
public struct CameraInfo
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Image height (rows)
/// </summary>
public uint Height { get; set; }
/// <summary>
/// Image width (columns)
/// </summary>
public uint Width { get; set; }
/// <summary>
/// Distortion model constants
/// </summary>
public const string DistortionModelPlumbBob = "plumb_bob";
public const string DistortionModelRationalPolynomial = "rational_polynomial";
/// <summary>
/// The distortion model used
/// </summary>
public string DistortionModel { get; set; }
/// <summary>
/// Intrinsic camera matrix for the raw (distorted) images.
/// [fx 0 cx]
/// K = [ 0 fy cy]
/// [ 0 0 1]
/// Projects 3D points in the camera coordinate frame to 2D pixel
/// coordinates using the focal lengths (fx, fy) and principal point
/// (cx, cy).
/// </summary>
public double[] K { get; set; }
/// <summary>
/// Size of intrinsic camera matrix (3x3 = 9 elements)
/// </summary>
public const int KSize = 9;
/// <summary>
/// Rectification matrix (stereo cameras only)
/// A rotation matrix aligning the camera coordinate system to the ideal
/// stereo image plane so that epipolar lines in both stereo images are
/// parallel.
/// </summary>
public double[] R { get; set; }
/// <summary>
/// Size of rectification matrix (3x3 = 9 elements)
/// </summary>
public const int RSize = 9;
/// <summary>
/// Projection/camera matrix
/// [fx' 0 cx' Tx]
/// P = [ 0 fy' cy' Ty]
/// [ 0 0 1 0]
/// By convention, this matrix specifies the intrinsic (camera) matrix
/// of the processed (rectified) image. That is, the left 3x3 portion
/// is the normal camera intrinsic matrix for the rectified image.
/// </summary>
public double[] P { get; set; }
/// <summary>
/// Size of projection matrix (3x4 = 12 elements)
/// </summary>
public const int PSize = 12;
/// <summary>
/// The distortion parameters, size depending on the distortion model.
/// For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3).
/// </summary>
public double[] D { get; set; }
/// <summary>
/// Region of interest (subwindow of full camera resolution)
/// </summary>
public RegionOfInterest Roi { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public CameraInfo()
{
Header = new Header();
Height = 0;
Width = 0;
DistortionModel = DistortionModelPlumbBob;
K = new double[KSize];
R = new double[RSize];
P = new double[PSize];
D = [];
Roi = new RegionOfInterest();
}
}
/// <summary>
/// RegionOfInterest message (sensor_msgs/RegionOfInterest)
/// This message is used to specify a region of interest within an image
/// </summary>
public struct RegionOfInterest
{
/// <summary>
/// Leftmost pixel of the ROI
/// </summary>
public uint XOffset { get; set; }
/// <summary>
/// Topmost pixel of the ROI
/// </summary>
public uint YOffset { get; set; }
/// <summary>
/// Height of ROI
/// </summary>
public uint Height { get; set; }
/// <summary>
/// Width of ROI
/// </summary>
public uint Width { get; set; }
/// <summary>
/// True if a distinct rectified ROI should be calculated from the "raw"
/// ROI in this message. Typically this should be False on the "raw" image
/// and True on the "rectified" image.
/// </summary>
public bool DoRectify { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public RegionOfInterest()
{
XOffset = 0;
YOffset = 0;
Height = 0;
Width = 0;
DoRectify = false;
}
}

View File

@@ -0,0 +1,35 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// CompressedImage message (sensor_msgs/CompressedImage)
/// This message contains a compressed image
/// </summary>
public struct CompressedImage
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Specifies the format of the data
/// Acceptable values: jpeg, png, tiff
/// </summary>
public string Format { get; set; }
/// <summary>
/// Compressed image buffer
/// </summary>
public byte[] Data { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public CompressedImage()
{
Header = new Header();
Format = string.Empty;
Data = Array.Empty<byte>();
}
}

View File

@@ -0,0 +1,34 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// FluidPressure message (sensor_msgs/FluidPressure)
/// Single pressure reading
/// </summary>
public struct FluidPressure
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Absolute pressure reading in Pascals
/// </summary>
public double FluidPressureValue { get; set; }
/// <summary>
/// Variance of the pressure reading
/// </summary>
public double Variance { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public FluidPressure()
{
Header = new Header();
FluidPressureValue = 0.0;
Variance = 0.0;
}
}

View File

@@ -0,0 +1,34 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Illuminance message (sensor_msgs/Illuminance)
/// Single photometric illuminance measurement
/// </summary>
public struct Illuminance
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Illuminance reading in Lux
/// </summary>
public double IlluminanceValue { get; set; }
/// <summary>
/// Variance of the illuminance reading
/// </summary>
public double Variance { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Illuminance()
{
Header = new Header();
IlluminanceValue = 0.0;
Variance = 0.0;
}
}

View File

@@ -0,0 +1,58 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Image message (sensor_msgs/Image)
/// This message contains an uncompressed image
/// </summary>
public struct Image
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Image height (rows)
/// </summary>
public uint Height { get; set; }
/// <summary>
/// Image width (columns)
/// </summary>
public uint Width { get; set; }
/// <summary>
/// Encoding of pixels -- channel meaning, ordering, size
/// </summary>
public string Encoding { get; set; }
/// <summary>
/// Is this data bigendian?
/// </summary>
public byte IsBigendian { get; set; }
/// <summary>
/// Full row length in bytes
/// </summary>
public uint Step { get; set; }
/// <summary>
/// Actual matrix data, size is (step * rows)
/// </summary>
public byte[] Data { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Image()
{
Header = new Header();
Height = 0;
Width = 0;
Encoding = string.Empty;
IsBigendian = 0;
Step = 0;
Data = [];
}
}

View File

@@ -0,0 +1,128 @@
using RobotNet10.Shared.Geometry;
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Imu message (sensor_msgs/Imu)
/// Contains data from an IMU (Inertial Measurement Unit)
///
/// Accelerations should be in m/s^2 (not g's), and rotational velocity should be in rad/sec
///
/// If the covariance of the measurement is known, it should be filled in (if all you know is the
/// variance of each measurement, e.g. from the datasheet, just put those along the diagonal)
/// A covariance matrix of all zeros will be interpreted as "covariance unknown", and to use the
/// data a covariance will have to be assumed or gotten from some other source
///
/// If you have no estimate for one of the data elements (e.g. your IMU doesn't produce an orientation
/// estimate), please set element 0 of the associated covariance matrix to -1
/// If you are interpreting this message, please check for a value of -1 in the first element of each
/// covariance matrix, and ignore the associated estimate.
/// </summary>
public struct Imu
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Orientation quaternion (geometry_msgs/Quaternion)
/// </summary>
public Quaternion Orientation { get; set; }
/// <summary>
/// Orientation covariance matrix (row-major about x, y, z axes)
/// Size: 9 (3x3 matrix)
/// </summary>
public double[] OrientationCovariance { get; set; }
/// <summary>
/// Size of orientation covariance matrix (3x3 = 9 elements)
/// </summary>
public const int OrientationCovarianceSize = 9;
/// <summary>
/// Angular velocity (geometry_msgs/Vector3)
/// </summary>
public Vector3 AngularVelocity { get; set; }
/// <summary>
/// Angular velocity covariance matrix (row-major about x, y, z axes)
/// Size: 9 (3x3 matrix)
/// </summary>
public double[] AngularVelocityCovariance { get; set; }
/// <summary>
/// Size of angular velocity covariance matrix (3x3 = 9 elements)
/// </summary>
public const int AngularVelocityCovarianceSize = 9;
/// <summary>
/// Linear acceleration (geometry_msgs/Vector3)
/// </summary>
public Vector3 LinearAcceleration { get; set; }
/// <summary>
/// Linear acceleration covariance matrix (row-major about x, y, z axes)
/// Size: 9 (3x3 matrix)
/// </summary>
public double[] LinearAccelerationCovariance { get; set; }
/// <summary>
/// Size of linear acceleration covariance matrix (3x3 = 9 elements)
/// </summary>
public const int LinearAccelerationCovarianceSize = 9;
/// <summary>
/// Default constructor
/// </summary>
public Imu()
{
Header = new Header();
Orientation = new Quaternion();
OrientationCovariance = new double[OrientationCovarianceSize];
AngularVelocity = new Vector3();
AngularVelocityCovariance = new double[AngularVelocityCovarianceSize];
LinearAcceleration = new Vector3();
LinearAccelerationCovariance = new double[LinearAccelerationCovarianceSize];
}
/// <summary>
/// Constructor with parameters
/// </summary>
public Imu(
Header header,
Quaternion orientation,
double[] orientationCovariance,
Vector3 angularVelocity,
double[] angularVelocityCovariance,
Vector3 linearAcceleration,
double[] linearAccelerationCovariance)
{
Header = header;
Orientation = orientation;
if (orientationCovariance == null || orientationCovariance.Length != OrientationCovarianceSize)
{
throw new ArgumentException($"Orientation covariance array must have {OrientationCovarianceSize} elements", nameof(orientationCovariance));
}
OrientationCovariance = orientationCovariance;
AngularVelocity = angularVelocity;
if (angularVelocityCovariance == null || angularVelocityCovariance.Length != AngularVelocityCovarianceSize)
{
throw new ArgumentException($"Angular velocity covariance array must have {AngularVelocityCovarianceSize} elements", nameof(angularVelocityCovariance));
}
AngularVelocityCovariance = angularVelocityCovariance;
LinearAcceleration = linearAcceleration;
if (linearAccelerationCovariance == null || linearAccelerationCovariance.Length != LinearAccelerationCovarianceSize)
{
throw new ArgumentException($"Linear acceleration covariance array must have {LinearAccelerationCovarianceSize} elements", nameof(linearAccelerationCovariance));
}
LinearAccelerationCovariance = linearAccelerationCovariance;
}
}

View File

@@ -0,0 +1,46 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// JointState message (sensor_msgs/JointState)
/// This message holds data to describe the state of a set of torque controlled joints
/// </summary>
public struct JointState
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// The joint names
/// </summary>
public string[] Name { get; set; }
/// <summary>
/// The joint positions (rad)
/// </summary>
public double[] Position { get; set; }
/// <summary>
/// The joint velocities (rad/s)
/// </summary>
public double[] Velocity { get; set; }
/// <summary>
/// The joint efforts (Nm)
/// </summary>
public double[] Effort { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public JointState()
{
Header = new Header();
Name = Array.Empty<string>();
Position = Array.Empty<double>();
Velocity = Array.Empty<double>();
Effort = Array.Empty<double>();
}
}

View File

@@ -0,0 +1,95 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Joy message (sensor_msgs/Joy)
/// Reports the state of a joystick's axes and buttons
/// </summary>
public struct Joy
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// The axes measurements from a joystick
/// </summary>
public double[] Axes { get; set; }
/// <summary>
/// The buttons measurements from a joystick
/// </summary>
public int[] Buttons { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Joy()
{
Header = new Header();
Axes = [];
Buttons = [];
}
}
/// <summary>
/// JoyFeedback message (sensor_msgs/JoyFeedback)
/// Reports the state of a joystick's axes and buttons
/// </summary>
public struct JoyFeedback
{
/// <summary>
/// Type constants
/// </summary>
public const byte TypeLed = 0;
public const byte TypeRumble = 1;
public const byte TypeBuzzer = 2;
/// <summary>
/// Type of feedback (Type constants)
/// </summary>
public byte Type { get; set; }
/// <summary>
/// This will hold an id number for each type of each feedback.
/// Example, the first led would be id=0, the second would be id=1
/// </summary>
public byte Id { get; set; }
/// <summary>
/// Intensity of the feedback, from 0.0 to 1.0, inclusive. If device is
/// actually binary, driver should treat 0<=x<0.5 as off, 0.5<=x<=1.0 as on.
/// </summary>
public double Intensity { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public JoyFeedback()
{
Type = TypeLed;
Id = 0;
Intensity = 0.0;
}
}
/// <summary>
/// JoyFeedbackArray message (sensor_msgs/JoyFeedbackArray)
/// Array of JoyFeedback
/// </summary>
public struct JoyFeedbackArray
{
/// <summary>
/// Array of feedback
/// </summary>
public JoyFeedback[] Array { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public JoyFeedbackArray()
{
Array = System.Array.Empty<JoyFeedback>();
}
}

View File

@@ -0,0 +1,80 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// LaserScan message (sensor_msgs/LaserScan)
/// Single scan from a planar laser range-finder
/// </summary>
public struct LaserScan
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Start angle of the scan (rad)
/// </summary>
public double AngleMin { get; set; }
/// <summary>
/// End angle of the scan (rad)
/// </summary>
public double AngleMax { get; set; }
/// <summary>
/// Angular distance between measurements (rad)
/// </summary>
public double AngleIncrement { get; set; }
/// <summary>
/// Time between measurements (seconds) - if your scanner
/// is moving, this will be used in interpolating position
/// of 3d points
/// </summary>
public double TimeIncrement { get; set; }
/// <summary>
/// Time between scans (seconds)
/// </summary>
public double ScanTime { get; set; }
/// <summary>
/// Minimum range value (m)
/// </summary>
public double RangeMin { get; set; }
/// <summary>
/// Maximum range value (m)
/// </summary>
public double RangeMax { get; set; }
/// <summary>
/// Range data (m)
/// (Note: values < range_min or > range_max should be discarded)
/// </summary>
public double[] Ranges { get; set; }
/// <summary>
/// Intensity data (device-specific units)
/// If your device does not provide intensities, please leave the array empty
/// </summary>
public double[] Intensities { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public LaserScan()
{
Header = new Header();
AngleMin = 0.0;
AngleMax = 0.0;
AngleIncrement = 0.0;
TimeIncrement = 0.0;
ScanTime = 0.0;
RangeMin = 0.0;
RangeMax = 0.0;
Ranges = [];
Intensities = [];
}
}

View File

@@ -0,0 +1,58 @@
using RobotNet10.Shared.Geometry;
using RobotNet10.Shared.Numbers;
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// MagneticField message (sensor_msgs/MagneticField)
/// Measurement of the Magnetic Field vector at a specific location
/// </summary>
public struct MagneticField
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Magnetic field vector in Tesla
/// </summary>
public RobotNet10.Shared.Numbers.Vector3 MagneticFieldVector { get; set; }
/// <summary>
/// Covariance matrix (row-major about x, y, z axes)
/// Size: 9 (3x3 matrix)
/// </summary>
public double[] MagneticFieldCovariance { get; set; }
/// <summary>
/// Size of magnetic field covariance matrix (3x3 = 9 elements)
/// </summary>
public const int MagneticFieldCovarianceSize = 9;
/// <summary>
/// Default constructor
/// </summary>
public MagneticField()
{
Header = new Header();
MagneticFieldVector = new RobotNet10.Shared.Numbers.Vector3();
MagneticFieldCovariance = new double[MagneticFieldCovarianceSize];
}
/// <summary>
/// Constructor with parameters
/// </summary>
public MagneticField(Header header, RobotNet10.Shared.Numbers.Vector3 magneticFieldVector, double[] magneticFieldCovariance)
{
Header = header;
MagneticFieldVector = magneticFieldVector;
if (magneticFieldCovariance == null || magneticFieldCovariance.Length != MagneticFieldCovarianceSize)
{
throw new ArgumentException($"Magnetic field covariance array must have {MagneticFieldCovarianceSize} elements", nameof(magneticFieldCovariance));
}
MagneticFieldCovariance = magneticFieldCovariance;
}
}

View File

@@ -0,0 +1,136 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// NavSatFix message (sensor_msgs/NavSatFix)
/// Navigation Satellite fix for any Global Navigation Satellite System
/// </summary>
public struct NavSatFix
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Navigation Satellite fix status constants
/// </summary>
public const short StatusNoFix = -1;
public const short StatusFix = 0;
public const short StatusSbasFix = 1;
public const short StatusGbasFix = 2;
/// <summary>
/// Navigation Satellite fix status (Status constants)
/// </summary>
public short Status { get; set; }
/// <summary>
/// Service constants
/// </summary>
public const ushort ServiceGps = 1;
public const ushort ServiceGlonass = 2;
public const ushort ServiceCompass = 4;
public const ushort ServiceGalileo = 8;
/// <summary>
/// Service which is being used (Service constants)
/// </summary>
public ushort Service { get; set; }
/// <summary>
/// Latitude in degrees
/// </summary>
public double Latitude { get; set; }
/// <summary>
/// Longitude in degrees
/// </summary>
public double Longitude { get; set; }
/// <summary>
/// Altitude in meters
/// </summary>
public double Altitude { get; set; }
/// <summary>
/// Position covariance matrix (row-major about x, y, z axes)
/// Size: 9 (3x3 matrix)
/// </summary>
public double[] PositionCovariance { get; set; }
/// <summary>
/// Size of position covariance matrix (3x3 = 9 elements)
/// </summary>
public const int PositionCovarianceSize = 9;
/// <summary>
/// Position covariance type constants
/// </summary>
public const byte CovarianceTypeUnknown = 0;
public const byte CovarianceTypeApproximated = 1;
public const byte CovarianceTypeDiagonalKnown = 2;
public const byte CovarianceTypeKnown = 3;
/// <summary>
/// Position covariance type (CovarianceType constants)
/// </summary>
public byte PositionCovarianceType { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public NavSatFix()
{
Header = new Header();
Status = StatusNoFix;
Service = 0;
Latitude = 0.0;
Longitude = 0.0;
Altitude = 0.0;
PositionCovariance = new double[PositionCovarianceSize];
PositionCovarianceType = CovarianceTypeUnknown;
}
}
/// <summary>
/// NavSatStatus message (sensor_msgs/NavSatStatus)
/// Navigation Satellite fix status for any Global Navigation Satellite System
/// </summary>
public struct NavSatStatus
{
/// <summary>
/// Status constants
/// </summary>
public const sbyte StatusNoFix = -1;
public const sbyte StatusFix = 0;
public const sbyte StatusSbasFix = 1;
public const sbyte StatusGbasFix = 2;
/// <summary>
/// Status (Status constants)
/// </summary>
public sbyte Status { get; set; }
/// <summary>
/// Service constants
/// </summary>
public const ushort ServiceGps = 1;
public const ushort ServiceGlonass = 2;
public const ushort ServiceCompass = 4;
public const ushort ServiceGalileo = 8;
/// <summary>
/// Service which is being used (Service constants)
/// </summary>
public ushort Service { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public NavSatStatus()
{
Status = StatusNoFix;
Service = 0;
}
}

View File

@@ -0,0 +1,56 @@
using RobotNet10.Shared;
using RobotNet10.Shared.Geometry;
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Odometry message (nav_msgs/Odometry)
/// This represents an estimate of a position and velocity in free space.
/// The pose in this message should be specified in the coordinate frame given by header.frame_id.
/// The twist in this message should be specified in the coordinate frame given by the child_frame_id.
/// </summary>
public struct Odometry
{
/// <summary>
/// Header with timestamp and frame ID (parent frame, typically "odom")
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Child frame ID (typically "base_link" or "base_footprint")
/// </summary>
public string ChildFrameId { get; set; }
/// <summary>
/// Pose with covariance (PoseWithCovariance)
/// </summary>
public PoseWithCovariance Pose { get; set; }
/// <summary>
/// Twist with covariance (TwistWithCovariance)
/// </summary>
public TwistWithCovariance Twist { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Odometry()
{
Header = new Header();
ChildFrameId = string.Empty;
Pose = new PoseWithCovariance();
Twist = new TwistWithCovariance();
}
/// <summary>
/// Constructor with parameters
/// </summary>
public Odometry(Header header, string childFrameId, PoseWithCovariance pose, TwistWithCovariance twist)
{
Header = header;
ChildFrameId = childFrameId;
Pose = pose;
Twist = twist;
}
}

View File

@@ -0,0 +1,132 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// 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.
/// </summary>
public struct PointCloud2
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Height of the cloud
/// </summary>
public uint Height { get; set; }
/// <summary>
/// Width of the cloud
/// </summary>
public uint Width { get; set; }
/// <summary>
/// Describes the channels and their layout in the binary data blob
/// </summary>
public PointField[] Fields { get; set; }
/// <summary>
/// Is this data bigendian?
/// </summary>
public bool IsBigendian { get; set; }
/// <summary>
/// Length of a point in bytes
/// </summary>
public uint PointStep { get; set; }
/// <summary>
/// Length of a row in bytes
/// </summary>
public uint RowStep { get; set; }
/// <summary>
/// Actual point data, size is (row_step*height)
/// </summary>
public byte[] Data { get; set; }
/// <summary>
/// True if there are no invalid points
/// </summary>
public bool IsDense { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public PointCloud2()
{
Header = new Header();
Height = 0;
Width = 0;
Fields = Array.Empty<PointField>();
IsBigendian = false;
PointStep = 0;
RowStep = 0;
Data = Array.Empty<byte>();
IsDense = false;
}
}
/// <summary>
/// PointField message (sensor_msgs/PointField)
/// This message holds the description of one point entry in the PointCloud2 message format
/// </summary>
public struct PointField
{
/// <summary>
/// Point field name constants
/// </summary>
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";
/// <summary>
/// Name of field
/// </summary>
public string Name { get; set; }
/// <summary>
/// Offset from start of point struct
/// </summary>
public uint Offset { get; set; }
/// <summary>
/// Datatype enumeration constants
/// </summary>
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;
/// <summary>
/// Datatype enumeration (Datatype constants)
/// </summary>
public byte Datatype { get; set; }
/// <summary>
/// How many elements in field
/// </summary>
public uint Count { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public PointField()
{
Name = string.Empty;
Offset = 0;
Datatype = 0;
Count = 0;
}
}

View File

@@ -0,0 +1,60 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Range message (sensor_msgs/Range)
/// Single range reading from an active ranger that emits energy and reports
/// one range reading that is valid along an arc at the distance measured.
/// </summary>
public struct Range
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Radiation type constants
/// </summary>
public const byte RadiationTypeUltrasound = 0;
public const byte RadiationTypeInfrared = 1;
/// <summary>
/// The type of radiation used by the sensor (RadiationType constants)
/// </summary>
public byte RadiationType { get; set; }
/// <summary>
/// The size of the arc that the distance reading is valid for (rad)
/// </summary>
public double FieldOfView { get; set; }
/// <summary>
/// Minimum range value (m)
/// </summary>
public double MinRange { get; set; }
/// <summary>
/// Maximum range value (m)
/// </summary>
public double MaxRange { get; set; }
/// <summary>
/// Range data (m)
/// (Note: values < range_min or > range_max should be discarded)
/// </summary>
public double RangeValue { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Range()
{
Header = new Header();
RadiationType = RadiationTypeUltrasound;
FieldOfView = 0.0;
MinRange = 0.0;
MaxRange = 0.0;
RangeValue = 0.0;
}
}

View File

@@ -0,0 +1,34 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// RelativeHumidity message (sensor_msgs/RelativeHumidity)
/// Single reading from a relative humidity sensor
/// </summary>
public struct RelativeHumidity
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Relative humidity reading (0-1)
/// </summary>
public double RelativeHumidityValue { get; set; }
/// <summary>
/// Variance of the relative humidity reading
/// </summary>
public double Variance { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public RelativeHumidity()
{
Header = new Header();
RelativeHumidityValue = 0.0;
Variance = 0.0;
}
}

View File

@@ -0,0 +1,34 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// Temperature message (sensor_msgs/Temperature)
/// Single temperature reading
/// </summary>
public struct Temperature
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Temperature reading in Celsius
/// </summary>
public double TemperatureValue { get; set; }
/// <summary>
/// Variance of the temperature reading
/// </summary>
public double Variance { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public Temperature()
{
Header = new Header();
TemperatureValue = 0.0;
Variance = 0.0;
}
}

View File

@@ -0,0 +1,34 @@
namespace RobotNet10.Shared.Sensor;
/// <summary>
/// TimeReference message (sensor_msgs/TimeReference)
/// Measurement from an external time source not actively synchronized with the system clock
/// </summary>
public struct TimeReference
{
/// <summary>
/// Header with timestamp and frame ID
/// </summary>
public Header Header { get; set; }
/// <summary>
/// Measurement from an external time source not actively synchronized with the system clock
/// </summary>
public DateTime TimeRef { get; set; }
/// <summary>
/// The source of the time reference
/// </summary>
public string Source { get; set; }
/// <summary>
/// Default constructor
/// </summary>
public TimeReference()
{
Header = new Header();
TimeRef = DateTime.MinValue;
Source = string.Empty;
}
}