Registered Member
|
I'm currently reading in some configuration data consisting of a quaternion and a 3d translation vector and later randomizing the data. During that I triggered some assertions in my code where the Quaternion constructor taking an AngleAxis did not create a normalized quaternion ie. a valid rotation. When debugging I found that the quaternion configuration data had been a unit quaternion and thus the rotation axis was undefined, ie. a zero vector, which was fed into an AngleAxis and so on.
So my question would be if "garbage in - garbage out" is the intended behaviour or if there are (or should be) any stronger guarantees that a constructor only constructs (in this case) valid rotations? If you're concerned about performance (which I do not consider a problem with constructors) would it be a viable solution to at least assert in constructors, so in debug builds these problems are shown as soon as they a recognized and not at the time they break some (admittedly sloppy) user code? Or am I completely wrong about rotations and normalized quaternions? thanks, Norbert |
Moderator
|
We already had such a discussion, but no action has been taken yet. See: http://comments.gmane.org/gmane.comp.lib.eigen/3987
|
Moderator
|
See also this bug report: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=601
And feel free to give your inputs there. |
Registered Member
|
I'm sorry I missed the old discussions. I only checked the forum history. Thanks for the links Gael. It's good to see that Hauke made the same mistakes, so at least I feel a bit better now.
FWIW I'd really like to see at least your proposed patch applied in an upcoming version, cause that would have saved me some time I spent debugging. Since there already is this dummy_precision trait in Eigen already I've now placed my own assertions outside Eigen like this
I'm already lurking the mailinglist for some time now and if this discussion comes up there again I'll join in. Thanks for the answer and I'll try to be even more cautious now when feeding data into Eigen. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]