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

Add SO3 support #46

Merged
merged 5 commits into from
Feb 1, 2022
Merged

Add SO3 support #46

merged 5 commits into from
Feb 1, 2022

Conversation

luisenp
Copy link
Contributor

@luisenp luisenp commented Jan 25, 2022

Motivation and Context

Part of work for adding support for 3D geometry (SO3 and SE3).

How Has This Been Tested

This class is just a stub with no new functionality added, just outlining the core abstract method that need to be filled out.

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.

@luisenp luisenp self-assigned this Jan 25, 2022
@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 Jan 25, 2022
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.

LGTM

* add SO3.hat() and SO3.vee()

* add SO3 and unit quaternion check for liegroup.SO3

* add data initialization to SO3

* fix a bug

* add test_so3.py for so3.adjoint

* modify so3._SO3_matrix_check

* Add SO3.exp_map() and SO3.log_map() (#48)

* so3.exp_map seems to work

* so3._log_map_impl() are added but there are bugs to handle pi

* bug fixed for SO3._log_map_impl()

* SO3.log_map() works

* SO3.exp_map() and SO3.log_map() tested

* add extra tests for SO3.log_map()

* use atan2() in SO3.log_map() to improve numerical stability

* add check_SO3_log_map() to test_SO3.py to round 2*pi

* add additional tests for test_SO3.py

* add comments and simplify the code

* add additional tests for SO3.log_map()

* simplify the code for SO3.log_map() when theta is near pi

* Update tolerance to handle cases near pi

* replace self.data with self for simplification

* rewrite SO3.vee()

* Taoshaf.check se2 (#49)

* autograd works for SE2.log() using torch.where()

* replace cth and sth with cosine and sine in SE2

* update SE2.exp()

* simplify the code for SE2.exp() and SE2.log()

* Taoshaf.rewrite so3 exp and log (#50)

* update SO3.log

* update so3.exp
@luisenp luisenp changed the title Create a stub class for SO3 Add SO3 support Jan 28, 2022
Copy link
Member

@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.

Looks good! Nice work on your first set of PRs @fantaosha and coordinating with @luisenp.

@fantaosha
Copy link
Contributor

Please refer to #59 for SO3._hat_matrix_check()

@fantaosha
Copy link
Contributor

fantaosha commented Jan 31, 2022

I think it is important to add some tests for float32. For example, SO3.exp_map() and SO3.log_map() might have relatively poor performances around 0 and pi with float32 though passing all the tests with float64.

I'm not sure if this will be a major issue for GPU which mainly implements float32.

@fantaosha
Copy link
Contributor

Please refer to #60 for class quaternion and #61 for float32 or GPU tests.

@fantaosha fantaosha merged commit 6823f45 into main Feb 1, 2022
@fantaosha fantaosha deleted the lep.add_so3_class branch February 1, 2022 17:04
suddhu pushed a commit to suddhu/theseus that referenced this pull request Jan 21, 2023
* Create a stub class for SO3

* Added dof for SO3.

* add SO3.hat() and SO3.vee() (facebookresearch#47)

* add SO3.hat() and SO3.vee()

* add SO3 and unit quaternion check for liegroup.SO3

* add data initialization to SO3

* fix a bug

* add test_so3.py for so3.adjoint

* modify so3._SO3_matrix_check

* Add SO3.exp_map() and SO3.log_map() (facebookresearch#48)

* so3.exp_map seems to work

* so3._log_map_impl() are added but there are bugs to handle pi

* bug fixed for SO3._log_map_impl()

* SO3.log_map() works

* SO3.exp_map() and SO3.log_map() tested

* add extra tests for SO3.log_map()

* use atan2() in SO3.log_map() to improve numerical stability

* add check_SO3_log_map() to test_SO3.py to round 2*pi

* add additional tests for test_SO3.py

* add comments and simplify the code

* add additional tests for SO3.log_map()

* simplify the code for SO3.log_map() when theta is near pi

* Update tolerance to handle cases near pi

* replace self.data with self for simplification

* rewrite SO3.vee()

* Taoshaf.check se2 (facebookresearch#49)

* autograd works for SE2.log() using torch.where()

* replace cth and sth with cosine and sine in SE2

* update SE2.exp()

* simplify the code for SE2.exp() and SE2.log()

* Taoshaf.rewrite so3 exp and log (facebookresearch#50)

* update SO3.log

* update so3.exp

* fix the lint errors

Co-authored-by: Taosha Fan <6612911+fantaosha@users.noreply.github.com>
Co-authored-by: Taosha Fan <fantaosha@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

4 participants