-
Couldn't load subscription status.
- Fork 96
Make repr precision match constructor tolerance? #168
-
The repr for an SE3 matrix seems to internally call on the numpy array repr, which prints to a number of digits set in numpy's precision printoption, which defaults to 8. However, SE3's constructor checks the validity of the orientation using an expression which needs to be within 0 up to precision higher than 8 digits. As a result, I have encountered a few examples where using SE3's repr gives an output which, when evaluated to reconstruct it, results in a "bad argument to constructor" exception. Here is one such example:
SE3(array([[ 0.68199836, -0.7313537 , 0. , -1.11677745],
[ 0.7313537 , 0.68199836, 0. , 2.09607829],
[ 0. , 0. , 1. , 0. ],
[ 0. , 0. , 0. , 1. ]]))
In my application, I got around this problem by temporarily setting the numpy print precision to 16 within the repr of the class I'm encoding (a Kinematic Chain class, which stores a pose matrix for each joint - I'm writing a repr so we can save and load chains via text files). However, this was rather challenging to debug, so unless I'm missing a cleaner way I should have handled this, I think it would be convenient if the SE3 repr defaulted to setting its own precision to match that required by its constructor.
Thanks for making a great library!
Beta Was this translation helpful? Give feedback.