namespace RobotNet10.Shared.Geometry;
///
/// PoseWithCovariance message (geometry_msgs/PoseWithCovariance)
/// A Pose with associated covariance matrix
///
public struct PoseWithCovariance
{
///
/// Pose
///
public Pose Pose { get; set; }
///
/// Covariance matrix (row-major order)
/// The orientation parameters use a fixed-axis representation.
/// In order, the parameters are:
/// (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
///
public double[] Covariance { get; set; }
///
/// Size of covariance matrix (6x6 = 36 elements)
///
public const int CovarianceSize = 36;
///
/// Default constructor
///
public PoseWithCovariance()
{
Pose = new Pose();
Covariance = new double[CovarianceSize];
}
///
/// Constructor with parameters
///
public PoseWithCovariance(Pose pose, double[] covariance)
{
Pose = pose;
if (covariance == null || covariance.Length != CovarianceSize)
{
throw new ArgumentException($"Covariance array must have {CovarianceSize} elements", nameof(covariance));
}
Covariance = covariance;
}
}