Make repr precision match constructor tolerance? #168
DanielFeshbach
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
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.
All reactions