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 adjoint, hat and vee for SE3 #68

Merged
merged 10 commits into from
Feb 9, 2022
Merged

add adjoint, hat and vee for SE3 #68

merged 10 commits into from
Feb 9, 2022

Conversation

fantaosha
Copy link
Contributor

@fantaosha fantaosha commented Feb 1, 2022

Motivation and Context

How Has This Been Tested

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 Feb 1, 2022
@fantaosha fantaosha changed the title add SE3 class defintion add SE3 class definition Feb 1, 2022
@fantaosha fantaosha changed the title add SE3 class definition add adjoint, hat and vee for SE3 Feb 2, 2022
@mhmukadam mhmukadam added the enhancement New feature or request label Feb 2, 2022
return ret

def update_from_x_y_z_quaternion(self, x_y_z_quaternion: torch.Tensor):
if x_y_z_quaternion.ndim != 2 and x_y_z_quaternion.shape[1] != 7:
Copy link
Member

Choose a reason for hiding this comment

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

We want to handle the case where the batch dimension is not passed and therefore batch size is assumed to be 1 (possibly also check in other places if we account for this).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I will add this feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

TBH, I'm not sure if we support this in 2D functions. Should we open an issue to remember to check for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is SO2.update_from_angle but SE2 seems to have no similar functions.

Copy link
Member

Choose a reason for hiding this comment

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

TBH, I'm not sure if we support this in 2D functions. Should we open an issue to remember to check for this?

Okay with either of these but we should be consistent:
a. We clarify in docs that batch dimension is always present and users need to add a stub dim for a batch size of one.
b. We let users define things without batch and append the extra dim internally everywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, for some reason I was thinking of something else. In Lie group classes constructors we do automatically append batch dimensions if not present, and @fantaosha also added this here in line 35. I guess the question is if it makes sense to move the unsqueeze inside the updated_from_x_y_z_quaternion function, which I think it does.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good, option b then. Yes, we should move the unsqueeze. In general, every class and function should support automatic appending of batch dim then.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move the unsqueeze for adding a batch dimension (if needed) inside updated_from_x_y_z_quaternion before merging.

Copy link
Member

@mhmukadam mhmukadam Feb 18, 2022

Choose a reason for hiding this comment

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

@fantaosha @luisenp was this addressed before merging? If not, maybe add to an active PR.

theseus/geometry/se3.py Outdated Show resolved Hide resolved
theseus/geometry/se3.py Outdated Show resolved Hide resolved
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!

Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

LGTM!

theseus/geometry/se3.py Outdated Show resolved Hide resolved
return ret

def update_from_x_y_z_quaternion(self, x_y_z_quaternion: torch.Tensor):
if x_y_z_quaternion.ndim != 2 and x_y_z_quaternion.shape[1] != 7:
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH, I'm not sure if we support this in 2D functions. Should we open an issue to remember to check for this?

theseus/geometry/se3.py Outdated Show resolved Hide resolved
@fantaosha fantaosha deleted the taoshaf.add_se3 branch February 9, 2022 23:07
ddetone pushed a commit that referenced this pull request Mar 29, 2022
suddhu pushed a commit to suddhu/theseus that referenced this pull request Jan 21, 2023
* add SE3 defintions

* add initialization method

* modify test_so3.check_SO3_to_quaternion to handle cases near pi

* add SE3.hat and SE.vee

* add SE3.adjoint

* add SE3.adjoint, vee and hat

* backup before switching to taoshaf.add_SE3

* add support for single x_y_z_quaternion

* modify SO3

* Remove repeated if in SE3 construction
@ggttkl ggttkl mentioned this pull request Jan 25, 2024
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. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants