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

Fixed dtype error in se3.py that came up in unit tests #158

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions theseus/geometry/se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,24 @@ def exp_map(

jac[:, 3:, 3:] = jac[:, :3, :3]

minus_one_by_twelve = torch.tensor(
-1 / 12.0,
dtype=sine_by_theta.dtype,
device=sine_by_theta.device,
)
joeaortiz marked this conversation as resolved.
Show resolved Hide resolved
d_one_minus_cosine_by_theta2 = torch.where(
near_zero,
-1 / 12.0,
minus_one_by_twelve,
(sine_by_theta - 2 * one_minus_cosine_by_theta2) / theta2_nz,
)
minus_one_by_sixty = torch.tensor(
-1 / 60.0,
dtype=one_minus_cosine_by_theta2.dtype,
device=one_minus_cosine_by_theta2.device,
)
joeaortiz marked this conversation as resolved.
Show resolved Hide resolved
d_theta_minus_sine_by_theta3 = torch.where(
near_zero,
-1 / 60.0,
minus_one_by_sixty,
(one_minus_cosine_by_theta2 - 3 * theta_minus_sine_by_theta3_t)
/ theta2_nz,
)
Expand Down