Skip to content
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

Fix/plane factor dwisth #680

Merged
merged 2 commits into from
Jan 21, 2021

Conversation

dwisth
Copy link
Contributor

@dwisth dwisth commented Jan 19, 2021

This adds another simplified unit test of related to PR #564 and Issue #561.

The unit test situation is very simple - there are two horizontal planes, p1 and p2, connected to a pose, x0. All the variables have priors on them.

image

In this toy example, all the factors are "perfect" (i.e. the optimal solution should have zero error), and the initial condition on the planes are "perfect" (the same as their optimal value). The only thing the optimizer needs to do is solve a pose offset - the initial condition is at (100,0,0) and the optimal solution is at (99,0,0).
image

The Gauss Newton optimizer throws an IndeterminantSystemError exception.

The Hessians associated to each variable are below. It seems that the plane variables are very poorly conditioned.

Hessian P1:
       401          0          0
         0 4.0004e+06     -40000
         0     -40000     400.04
Condition number:
4.99551e+07
Singular values:
4.0008e+06        401   0.080088
SVD U:
         0          1          0
   0.99995          0  0.0099985
-0.0099985          0    0.99995

Hessian P2:
       401          0          0
         0 4.0004e+06     -40000
         0     -40000     400.04
Condition number:
4.99551e+07
Singular values:
4.0008e+06        401   0.080088
SVD U:
         0          1          0
   0.99995          0  0.0099985
-0.0099985          0    0.99995

Hessian X0:
10800     0     0     0     0     0
    0 10800     0     0     0     0
    0     0 10000     0     0     0
    0     0     0 10000     0     0
    0     0     0     0 10000     0
    0     0     0     0     0 10800
Condition number:
1.08
Singular values:
10800 10800 10800 10000 10000 10000
SVD U:
1 0 0 0 0 0
0 1 0 0 0 0
0 0 0 0 0 1
0 0 0 1 0 0
0 0 0 0 1 0
0 0 1 0 0 0

I think there may be a problem with the second element in the OrientedPlane3Factor residual but I don't know enough about how gtsam works out the Hessian to be sure.

Any thoughts on the next step for debugging this?

@ProfFan ProfFan requested a review from dellaert January 20, 2021 00:44
@varunagrawal
Copy link
Collaborator

I believe the Hessian should be approximated as J.T @ J where J is the jacobian, though a deeper dive into the code would be needed to confirm this.

@mcamurri mcamurri mentioned this pull request Jan 20, 2021
Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just merging in my fix branch so I'll approve and merge.
I have an idea about at leasts something that might be wrong

@dellaert dellaert merged commit b9a8101 into borglab:fix/planeFactor Jan 21, 2021
@dwisth dwisth deleted the fix/planeFactor-dwisth branch January 21, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants