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 SE3.transform_from and SE3.transform_to #80

Merged
merged 23 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7fa60c5
add SE3 defintions
fantaosha Feb 1, 2022
67e77b4
add initialization method
fantaosha Feb 1, 2022
e72ab40
modify test_so3.check_SO3_to_quaternion to handle cases near pi
fantaosha Feb 2, 2022
fe05db4
add SE3.hat and SE.vee
fantaosha Feb 2, 2022
1ae2dea
add SE3.adjoint
fantaosha Feb 2, 2022
f8cf872
add SE3.adjoint, vee and hat
fantaosha Feb 2, 2022
e5de005
backup before switching to taoshaf.add_SE3
fantaosha Feb 2, 2022
23292d4
add support for single x_y_z_quaternion
fantaosha Feb 2, 2022
b4c1738
modify SO3
fantaosha Feb 2, 2022
ae9e845
Remove repeated if in SE3 construction
fantaosha Feb 2, 2022
19d787d
SE3.exp added but not tested
fantaosha Feb 2, 2022
8a6f88e
add SE3.log_map()
fantaosha Feb 2, 2022
87c5f82
SE3.exp_map() and SE3.log_map() are tested
fantaosha Feb 2, 2022
2c1b729
add SE3.compose()
fantaosha Feb 2, 2022
107c55e
simplify test_se3.py
fantaosha Feb 2, 2022
2486e54
Merge branch 'taoshaf.add_se3.exp_and_log' into taoshaf.add_se3_compose
fantaosha Feb 2, 2022
3a65b2e
modify test_se3.py
fantaosha Feb 3, 2022
0548508
add SE3.transform_from and SE3.transform_to
fantaosha Feb 3, 2022
19419f8
add SE3.transform_from and SE3.transform_to
fantaosha Feb 3, 2022
e4abe1b
change err_msgs for SO3._rotate_shape_check and SE3._rotate_shape_check
fantaosha Feb 10, 2022
6c71afc
change error message for SO3._rotate_shape_check and SE3._transform_s…
fantaosha Feb 10, 2022
01db55e
update err_msg for shape_check
fantaosha Feb 10, 2022
95c9b41
Merge branch 'main' into taoshaf.add_SE3.transfrom
fantaosha Feb 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into taoshaf.add_SE3.transfrom
  • Loading branch information
fantaosha committed Feb 10, 2022
commit 95c9b4117415147a20769f5472fda2bf1cd99a27
4 changes: 3 additions & 1 deletion theseus/geometry/se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,12 @@ def _log_map_impl(self) -> torch.Tensor:
(sine_theta + two_cosine_minus_two) / (theta2_nz * two_cosine_minus_two_nz),
)

translation = self[:, :, 3].view(-1, 3, 1)
tangent_vector_ang = ret[:, 3:].view(-1, 3, 1)
ret[:, :3] = a.view(-1, 1) * self[:, :, 3]
ret[:, :3] -= 0.5 * torch.cross(ret[:, 3:], self[:, :, 3])
ret[:, :3] += b.view(-1, 1) * (
ret[:, 3:].view(-1, 3, 1) @ (ret[:, 3:].view(-1, 1, 3) @ self[:, :, 3:])
tangent_vector_ang @ (tangent_vector_ang.transpose(1, 2) @ translation)
).view(-1, 3)

return ret
Expand Down
4 changes: 4 additions & 0 deletions theseus/geometry/tests/test_se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_exp_map():

check_exp_map(tangent_vector, th.SE3)

# SE3.exp_map uses approximations for small theta
for batch_size in [1, 20, 100]:
tangent_vector_ang = torch.rand(batch_size, 3).double() - 0.5
tangent_vector_ang /= tangent_vector_ang.norm(dim=1, keepdim=True)
Expand All @@ -47,6 +48,7 @@ def test_exp_map():

check_exp_map(tangent_vector, th.SE3)

# SE3.exp_map uses the exact exponential map for small theta
for batch_size in [1, 20, 100]:
tangent_vector_ang = torch.rand(batch_size, 3).double() - 0.5
tangent_vector_ang /= tangent_vector_ang.norm(dim=1, keepdim=True)
Expand Down Expand Up @@ -85,6 +87,7 @@ def test_log_map():

check_SE3_log_map(tangent_vector)

# SE3.log_map uses approximations for small theta
for batch_size in [1, 20, 100]:
tangent_vector_ang = torch.rand(batch_size, 3).double() - 0.5
tangent_vector_ang /= tangent_vector_ang.norm(dim=1, keepdim=True)
Expand All @@ -94,6 +97,7 @@ def test_log_map():

check_SE3_log_map(tangent_vector)

# SE3.log_map uses the exact logarithm map for small theta
for batch_size in [1, 20, 100]:
tangent_vector_ang = torch.rand(batch_size, 3).double() - 0.5
tangent_vector_ang /= tangent_vector_ang.norm(dim=1, keepdim=True)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.