-
Notifications
You must be signed in to change notification settings - Fork 769
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
Rot3 determinant!=1 after recursive operation #372
Comments
Wow. That loses precision much faster than I expected. So, to be clear, if you replace
with
things still fail? Could you give that a try? |
@dellaert When I use the (*) operation, I got an exception. I installed gtsam through pip install. Is this normal?:
I tried and replace
With
The result is the same: |
Oh, yeah, * will (hopefully) only work in new pybind wrapper |
I think it's quite hard to avoid this without some clever floatpoint-fu. (or we can use the quaternion at Rot3, since quaternion is always normalized) |
Do you think using a normalized quaternion would make more sense? It would be slightly more expensive, but hopefully Eigen's magic would ameliorate some of the run time costs, while ensuring correctness. I wrote a test and made the changes on my local machine and it works great, error never goes greater than 1e-7. |
We have a separate compilation flag for quaternions. Sticking quaternions in the middle here is a solution, just not a very elegant one. |
BTW is the quaternion flag tested in CI? |
@dellaert Nope :) We should have one though. |
Just added the |
I found an elegant solution to this problem. |
Description
The determinant of a Rot3 variable no longer equals to 1 after 31 steps of recursive operations with Rot3.between() and Rot3.compose().
Steps to reproduce
Expected behavior
1 error = 1.4901161193847656e-08
2 error = 1.4901161193847656e-08
3 error = 1.4901161193847656e-08
4 error = 2.5809568279517847e-08
5 error = 4.2146848510894035e-08
6 error = 6.322027276634104e-08
7 error = 9.771344846937061e-08
8 error = 1.519626234052415e-07
9 error = 2.3513635751693695e-07
10 error = 3.656102462525754e-07
11 error = 5.682014216464048e-07
12 error = 8.830745452659758e-07
13 error = 1.37195922532322e-06
14 error = 2.1316995191139784e-06
15 error = 3.3122167562126646e-06
16 error = 5.1464477617739e-06
17 error = 7.99641350665854e-06
18 error = 1.2424628950122203e-05
19 error = 1.93050682493097e-05
20 error = 2.9995711773005583e-05
21 error = 4.6606554127121996e-05
22 error = 7.24160513973106e-05
23 error = 0.00011251817383636744
24 error = 0.00017482781131434593
25 error = 0.00027164290610608063
26 error = 0.0004220716887881555
27 error = 0.000655804046453184
28 error = 0.0010189714143876455
29 error = 0.0015832518450614864
30 error = 0.0024600176914758875
31 error = 0.0038223196428445
Environment
python3
gtsam 4.0.2
Additional information
The text was updated successfully, but these errors were encountered: