|[eigen] Avoid SVD in rotation() for Isometry|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Avoid SVD in rotation() for Isometry
- From: Greg Coombe <greg.coombe@xxxxxxxxx>
- Date: Fri, 11 Jan 2019 09:41:56 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=CTf6xV4YXrkzJztdWazQSb1fsUqJDPD5D7erc7GBsJ4=; b=ZKzTs+Oe1sNhjjVR2Ls5BFRkAMtfIbReplXiRWbK7XAuw3rQ866g9F8x/xiY8y4dSs NNQmwBn7Rh1WaP/ytdIYdGKxbdxROhdCFaNHiguf1qgNgif5G9nOy/d85/4wPkzjSN4E YQnqqAl84uMy2bexv5GM/SHN1sO2jXfFyLLZlfFTfvR16pfghHHSYWfT/DUK0OJcesFf 4+qrj5A1XLwEB7R2WWg0WcxzF98AfLWdoiKXn1LkzC4invWrBn9oew8Cs23HzexP6J73 Gufc20/hTz+4o8HDHmnPCXseTpkqHvLiS2akPGnbUx9cV9LyNLjGLpydBjiGyk/MpiA5 IcRA==
We have been transitioning off our patchwork collection of custom transform libraries and onto Eigen for performance, code quality, etc. The part we're working on now is rigid-body transformations, and so we're using the isometric mode of Transform (no scaling).
So we've tried to be careful about replacing "rotation()" with "linear()", but it struck me that there is another approach: if we know that the Transform is an isometry, we can just return the linear part directly. I've attached a simple patch that does this. This patch would help us avoid the SVD gotcha, but it does add a little complexity.
Testing: I tried to adapt some of the tests in geo_transformations.cpp, but I didn't have a lot of luck. The main transformation() test function has a bunch of tests inside it, but they sort of mix-and-match scaling transformations with non-scaling transformations, so I couldn't just change the template parameter to Isometry with breaking apart a lot of the function. I'm happy to go down that route (it might slightly improve parallelism), but I didn't want to take that on as my first patch. So I just added some checks to make sure existing rotation() calls are not affected, but there is probably more that needs to be done.
Description: Binary data