Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions diffdrr/pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ def get_se3_log(self):

# %% ../notebooks/api/06_pose.ipynb 7
def make_matrix(R, t):
assert (batch_size := len(R)) == len(t)
batch_size = len(R)
assert batch_size == len(t)
matrix = torch.zeros(batch_size, 4, 4).to(R)
matrix[..., :3, :3] = R
matrix[..., :3, 3] = t
matrix[..., -1, -1] = 1.0
return matrix

# %% ../notebooks/api/06_pose.ipynb 8
from scipy.spatial.transform import Rotation

Expand Down
3 changes: 2 additions & 1 deletion notebooks/api/06_pose.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
"source": [
"#| exporti\n",
"def make_matrix(R, t):\n",
" assert (batch_size := len(R)) == len(t)\n",
" batch_size = len(R)\n",
" assert batch_size == len(t)\n",
" matrix = torch.zeros(batch_size, 4, 4).to(R)\n",
" matrix[..., :3, :3] = R\n",
" matrix[..., :3, 3] = t\n",
Expand Down
Loading