ihmcrobotics / euclid

Vector math, geometry, reference frame, and shapes 2D & 3D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Give full precision for `NotARotationMatrixException` message

calvertdw opened this issue · comments

I rarely get the following exception and without the full precision, a unit test cannot be created.

Exception in thread "main" us.ihmc.euclid.exceptions.NotARotationMatrixException: Caught exception, this frame: LEFT_SHIN_LINKCoM, other frame: LEFT_THIGH_LINKCoM, exception:
The matrix is not a rotation matrix: 
/ 1.000,  0.000,  0.001 \
|-0.000,  1.000, -0.000 |
\-0.001,  0.000,  1.000 /
	at us.ihmc.euclid.referenceFrame.ReferenceFrame.getTransformToDesiredFrame(ReferenceFrame.java:936)

I think this code will do it:

public static String toStringFullPrecision(RigidBodyTransform rigidBodyTransform)
{
   return EuclidCoreIOTools.getRigidBodyTransformString(EuclidCoreIOTools.getStringFormat(18, 18), rigidBodyTransform);
}

I got 3 more NotARotationMatrixExceptions today. This feature would still be awesome.