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

PGO: Rotation/translation swapped in relative pose noise #482

Closed
wants to merge 3 commits into from

Conversation

suddhu
Copy link
Contributor

@suddhu suddhu commented Mar 14, 2023

Motivation and Context

Rotation and translation noise are swapped in the PGO noise addition for pose_graph/dataset.py (Issue #481). The change merely fixes this to give a se(3) noise tangent vector [noise_translation, noise_rotation]

How Has This Been Tested

Minor bug fix, non-breaking change

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 14, 2023
@luisenp
Copy link
Contributor

luisenp commented Mar 14, 2023

Thanks for the fix. Can you also swap the values in the hydra config so that it matches what we actually ran? (this should also fix the broken unit tests).

@mhmukadam mhmukadam requested review from fantaosha and luisenp March 15, 2023 00:44
@mhmukadam mhmukadam added the bug Something isn't working label Mar 15, 2023
@mhmukadam mhmukadam self-requested a review March 15, 2023 00:45
@suddhu
Copy link
Contributor Author

suddhu commented Mar 15, 2023

Ah, I missed that - thanks for the pointer! Turns out they will still fail because the noise model for the pose graph has translation and rotation in the correct order.

Should we re-run the experiment with the correct ordering, and modify the expected_losses in test_pgo_benchmark.py?

@luisenp
Copy link
Contributor

luisenp commented Mar 15, 2023

Yes, in this case I think is safe to modify expected_losses then. Thanks!

Copy link
Contributor

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix! Feel free to merge once you push the update to expected losses and CI passes.

@luisenp
Copy link
Contributor

luisenp commented Mar 22, 2023

@suddhu Any plans on finalizing this PR soon? Thanks!

@suddhu
Copy link
Contributor Author

suddhu commented Mar 24, 2023

Yup - sorry for taking a bit! Running pytest -s tests/test_pgo_benchmark.py -s, the PGO final errors seem quite high in comparison with the previous unit test:

With the corrected rot/trans noise (latest commit on this branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.298862789376761, -0.30542158053746615, -0.27485602387525104, -0.300523110327785]]
pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.2988627893768147, -0.3054215805374096, -0.27485602387600594, -0.3005231103295129]]
pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.29886278947606854, -0.3054215806396245, -0.2748560240408431, -0.30052311060619713]]

Previous result (main branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.05253952558117652, -0.06922697773243278, -0.036454724771805606, -0.06110373107271005]]
.pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.05253952558136447, -0.06922697773270092, -0.03645472477181133, -0.06110373110087176]]
.pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.052539527012601166, -0.06922697775065781, -0.03645472565461781, -0.06110373151314644]]

Would that be expected, or anything I overlooked @fantaosha?

Copy link
Contributor

@fantaosha fantaosha left a comment

Choose a reason for hiding this comment

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

Looks like the noise ratios for rotation and translation are switched.

@fantaosha
Copy link
Contributor

Yup - sorry for taking a bit! Running pytest -s tests/test_pgo_benchmark.py -s, the PGO final errors seem quite high in comparison with the previous unit test:

With the corrected rot/trans noise (latest commit on this branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.298862789376761, -0.30542158053746615, -0.27485602387525104, -0.300523110327785]]
pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.2988627893768147, -0.3054215805374096, -0.27485602387600594, -0.3005231103295129]]
pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.29886278947606854, -0.3054215806396245, -0.2748560240408431, -0.30052311060619713]]

Previous result (main branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.05253952558117652, -0.06922697773243278, -0.036454724771805606, -0.06110373107271005]]
.pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.05253952558136447, -0.06922697773270092, -0.03645472477181133, -0.06110373110087176]]
.pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.052539527012601166, -0.06922697775065781, -0.03645472565461781, -0.06110373151314644]]

Would that be expected, or anything I overlooked @fantaosha?

See my last comments. Thanks!

@luisenp
Copy link
Contributor

luisenp commented Apr 4, 2023

@suddhu This is not directly related to this PR, but could you also add the change below in pose_graph_benchmark.py. We just found out than an earlier commit broke that example. Thanks!

image

@suddhu
Copy link
Contributor Author

suddhu commented Apr 10, 2023

Yup - sorry for taking a bit! Running pytest -s tests/test_pgo_benchmark.py -s, the PGO final errors seem quite high in comparison with the previous unit test:
With the corrected rot/trans noise (latest commit on this branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.298862789376761, -0.30542158053746615, -0.27485602387525104, -0.300523110327785]]
pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.2988627893768147, -0.3054215805374096, -0.27485602387600594, -0.3005231103295129]]
pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.29886278947606854, -0.3054215806396245, -0.2748560240408431, -0.30052311060619713]]

Previous result (main branch):

pgo_cpu_choleskydensesolver_64_256_16.mat
[[-0.05253952558117652, -0.06922697773243278, -0.036454724771805606, -0.06110373107271005]]
.pgo_cuda_lucudasparsesolver_64_256_16.mat
[[-0.05253952558136447, -0.06922697773270092, -0.03645472477181133, -0.06110373110087176]]
.pgo_cpu_cholmodsparsesolver_64_256_16.mat
[[-0.052539527012601166, -0.06922697775065781, -0.03645472565461781, -0.06110373151314644]]

Would that be expected, or anything I overlooked @fantaosha?

See my last comments. Thanks!

@fantaosha swapped the noise ratios and the rotation/translation in gt_relative_pose, optimization error is still high at [[-0.27113693051651366, -0.2863556061414448, -0.2404976921415048, -0.27444387002505344]].

When I swap the ordering of translation, rotation in the noise model to info = torch.tensor([1 / rotation_noise] * 3 + [1 / translation_noise] * 3, dtype=dtype).view(1, -1) the optimization does converge to [[-0.01911358713714046, -0.02313885434084465, 0.02663424963684986, 0.030410307200575255]]. But that doesn't seem consistent with the conventions, so there's probably something I'm missing!

@mhmukadam
Copy link
Contributor

Overridden by #560

@mhmukadam mhmukadam closed this Jun 27, 2023
@luisenp luisenp reopened this Jun 27, 2023
@luisenp luisenp closed this Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PGO dataset.py: Rotation/translation swapped in relative pose noise
5 participants