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 support for SE2 poses in Collision2D #278

Merged
merged 6 commits into from
Aug 30, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Minor cleanup in collision jacobians test.
  • Loading branch information
luisenp committed Aug 30, 2022
commit 2719173cf915ca9b594061c747ae36a12f8b3f30
8 changes: 2 additions & 6 deletions theseus/embodied/collision/tests/test_collision_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,14 @@ def test_collision2d_copy():
assert cost_function2.name == "new_name"


@pytest.mark.parametrize("pose_cls", [th.Vector, th.SE2])
@pytest.mark.parametrize("pose_cls", [th.Point2, th.SE2])
def test_collision2d_jacobians(pose_cls):
rng = torch.Generator()
rng.manual_seed(0)
for _ in range(10):
for batch_size in [1, 10, 100]:
cost_weight = th.ScaleCostWeight(torch.ones(1).squeeze().double())
if pose_cls == th.Vector:
pose = th.Point2.randn(batch_size, generator=rng, dtype=torch.float64)
else:
pose = th.SE2.randn(batch_size, generator=rng, dtype=torch.float64)

pose = pose_cls.randn(batch_size, generator=rng, dtype=torch.float64)
origin = th.Point2(torch.ones(batch_size, 2).double())
sdf_data = th.Variable(
torch.randn(batch_size, 10, 10, generator=rng).double()
Expand Down