Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed May 6, 2024
1 parent d01a108 commit 727db09
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/viser/transforms/_se2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SE2(_base.SEBase[SO2]):

# SE2-specific.

unit_complex_xy: onp.ndarray
unit_complex_xy: onpt.NDArray[onp.floating]
"""Internal parameters. `(cos, sin, x, y)`. Shape should be `(*, 3)`."""

@override
Expand Down
2 changes: 1 addition & 1 deletion src/viser/transforms/_se3.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SE3(_base.SEBase[SO3]):

# SE3-specific.

wxyz_xyz: onp.ndarray
wxyz_xyz: onpt.NDArray[onp.floating]
"""Internal parameters. wxyz quaternion followed by xyz translation. Shape should be `(*, 7)`."""

@override
Expand Down
2 changes: 1 addition & 1 deletion src/viser/transforms/_so2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SO2(_base.SOBase):

# SO2-specific.

unit_complex: onp.ndarray
unit_complex: onpt.NDArray[onp.floating]
"""Internal parameters. `(cos, sin)`. Shape should be `(*, 2)`."""

@override
Expand Down
2 changes: 1 addition & 1 deletion src/viser/transforms/_so3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SO3(_base.SOBase):
`(omega_x, omega_y, omega_z)`.
"""

wxyz: onp.ndarray
wxyz: onpt.NDArray[onp.floating]
"""Internal parameters. `(w, x, y, z)` quaternion. Shape should be `(*, 4)`."""

@override
Expand Down
10 changes: 6 additions & 4 deletions src/viser/transforms/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ def get_epsilon(dtype: onp.dtype) -> float:
Returns:
Output float.
"""
return {
onp.dtype("float32"): 1e-5,
onp.dtype("float64"): 1e-10,
}[dtype]
if dtype == onp.float32:
return 1e-5
elif dtype == onp.float64:
return 1e-10
else:
assert False


def register_lie_group(
Expand Down

0 comments on commit 727db09

Please sign in to comment.