namespace RobotNet10.Shared.Geometry;
///
/// TwistWithCovariance message (geometry_msgs/TwistWithCovariance)
/// A Twist with associated covariance matrix
///
public struct TwistWithCovariance
{
///
/// Twist
///
public Twist Twist { get; set; }
///
/// Covariance matrix (row-major order)
/// The orientation parameters use a fixed-axis representation.
/// In order, the parameters are:
/// (vx, vy, vz, wx, wy, wz)
///
public double[] Covariance { get; set; }
///
/// Size of covariance matrix (6x6 = 36 elements)
///
public const int CovarianceSize = 36;
///
/// Default constructor
///
public TwistWithCovariance()
{
Twist = new Twist();
Covariance = new double[CovarianceSize];
}
///
/// Constructor with parameters
///
public TwistWithCovariance(Twist twist, double[] covariance)
{
Twist = twist;
if (covariance == null || covariance.Length != CovarianceSize)
{
throw new ArgumentException($"Covariance array must have {CovarianceSize} elements", nameof(covariance));
}
Covariance = covariance;
}
}