-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trinterp() returns invalid rotations in transform matrix #165
Comments
Co-authored-by: Mark Yeatman <[email protected]>
Guys, I think that allowing direct assignment to the The The given rotation matrices have 17 digits which is full float64 precision but I don't know how they were obtained or how skewed they are.
If I apply a more stringent test for orthogonality with the If I add a line
then the stringent There is a philosophical issue here. I actually think we should be more stringent in checking rotation matrices into an I've seen in older issues where people set the rotation matrix to 6-digit float values and wonder why things don't work. We should protect these people, which in turn is less effort for us longer term. Another design error is that the tolerance for the Suggested changes:
I'm happy to put these into a PR. PS. Remember also that
you could write
|
Hey Peter, just viewing your comment now, I definitely agree that performing normalization by default in all these cases would be a good improvement. I probably won't be able to put up a PR or review one until next week. |
the trinterp() method does not make sure quaternions are valid before converting them to transforms. It calls qslerp which can sometimes generate invalid quaternions.
Repro:
The interp() method returns an SE3 object that holds the SE3 transformation matrices created from the interpolation:
spatialmath-python/spatialmath/baseposematrix.py
Lines 449 to 455 in 4c68fa9
However, there is a validity check in the SE3 object that will turn any invalid transforms into identity matrices.
A possible solution is to modify the trinterp() method to turn all quaternions into unit quaternions before converting them into rotation matrices:
spatialmath-python/spatialmath/base/transforms3d.py
Lines 1697 to 1700 in 4c68fa9
I am not sure if this is the only location in the spatialmath codebase that would benefit from this change.
The text was updated successfully, but these errors were encountered: