Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenvivek committed Dec 7, 2023
1 parent b56c609 commit 35be645
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 43 deletions.
2 changes: 1 addition & 1 deletion pytorchse3/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.3"
5 changes: 1 addition & 4 deletions pytorchse3/_modidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
'git_url': 'https://github.com/eigenvivek/pytorchse3',
'lib_path': 'pytorchse3'},
'syms': { 'pytorchse3.se3': { 'pytorchse3.se3.se3_exp_map': ('se3.html#se3_exp_map', 'pytorchse3/se3.py'),
'pytorchse3.se3.se3_log_map': ('se3.html#se3_log_map', 'pytorchse3/se3.py'),
'pytorchse3.se3.taylor_A': ('se3.html#taylor_a', 'pytorchse3/se3.py'),
'pytorchse3.se3.taylor_B': ('se3.html#taylor_b', 'pytorchse3/se3.py'),
'pytorchse3.se3.taylor_C': ('se3.html#taylor_c', 'pytorchse3/se3.py')},
'pytorchse3.se3.se3_log_map': ('se3.html#se3_log_map', 'pytorchse3/se3.py')},
'pytorchse3.so3': { 'pytorchse3.so3.cross_product_matrix': ('so3.html#cross_product_matrix', 'pytorchse3/so3.py'),
'pytorchse3.so3.so3_exp_map': ('so3.html#so3_exp_map', 'pytorchse3/so3.py'),
'pytorchse3.so3.so3_log_map': ('so3.html#so3_log_map', 'pytorchse3/so3.py')},
Expand Down
39 changes: 2 additions & 37 deletions pytorchse3/se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,9 @@
import torch

from .so3 import cross_product_matrix, so3_log_map
from .utils import taylor_A, taylor_B, taylor_C

# %% ../notebooks/01_se3.ipynb 5
"""
Taylor expansions taken from : https://github.com/SYSU-STAR/H2-Mapping/blob/11b8ab15f3302ccb2b4b3d2b30f76d86dcfcde2c/mapping/src/se3pose.py#L89-L118
"""


def taylor_A(x, nth=10):
# Taylor expansion of sin(x)/x
ans = torch.zeros_like(x)
denom = 1.0
for i in range(nth + 1):
if i > 0:
denom *= (2 * i) * (2 * i + 1)
ans = ans + (-1) ** i * x ** (2 * i) / denom
return ans


def taylor_B(x, nth=10):
# Taylor expansion of (1-cos(x))/x**2
ans = torch.zeros_like(x)
denom = 1.0
for i in range(nth + 1):
denom *= (2 * i + 1) * (2 * i + 2)
ans = ans + (-1) ** i * x ** (2 * i) / denom
return ans


def taylor_C(x, nth=10):
# Taylor expansion of (x-sin(x))/x**3
ans = torch.zeros_like(x)
denom = 1.0
for i in range(nth + 1):
denom *= (2 * i + 2) * (2 * i + 3)
ans = ans + (-1) ** i * x ** (2 * i) / denom
return ans

# %% ../notebooks/01_se3.ipynb 6
def se3_log_map(T: torch.Tensor):
R = T[..., :3, :3]
t = T[..., :3, 3]
Expand All @@ -63,7 +28,7 @@ def se3_log_map(T: torch.Tensor):

return torch.concat([log_R_vee, log_t_vee], dim=-1)

# %% ../notebooks/01_se3.ipynb 8
# %% ../notebooks/01_se3.ipynb 7
def se3_exp_map(log_T_vee, n=10):
log_R_vee = log_T_vee[..., :3]
log_t_vee = log_T_vee[..., 3:]
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[DEFAULT]
repo = pytorchse3
lib_name = pytorchse3
version = 0.0.2
version = 0.0.3
min_python = 3.7
license = mit
black_formatting = True
Expand Down

0 comments on commit 35be645

Please sign in to comment.