Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#8552 from EricCousineau-TRI/featur…
Browse files Browse the repository at this point in the history
…e/py_geometry_matrix_ctor

pydrake eigen_geometry: Ensure that matrix constructor is tested
  • Loading branch information
EricCousineau-TRI authored Apr 9, 2018
2 parents ad194a9 + 3095208 commit 1decd9d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bindings/pydrake/util/test/eigen_geometry_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@ def test_quaternion(self):
test_util.check_quaternion(value)

def test_transform(self):
# - Default constructor
transform = mut.Isometry3()
X = np.eye(4, 4)
self.assertTrue(np.allclose(transform.matrix(), X))
self.assertEquals(str(transform), str(X))
# - Constructor with (X)
transform = mut.Isometry3(matrix=X)
self.assertTrue(np.allclose(transform.matrix(), X))
# - Identity
transform = mut.Isometry3.Identity()
self.assertTrue(np.allclose(transform.matrix(), X))
# - Constructor with (R, p)
R = np.array([
[0., 1, 0],
[-1, 0, 0],
Expand All @@ -100,7 +108,6 @@ def test_transform(self):
with self.assertRaises(RuntimeError):
transform.set_matrix(X_bad)
self.assertTrue(np.allclose(X, transform.matrix()))

# Test `type_caster`s.
value = test_util.create_isometry()
self.assertTrue(isinstance(value, mut.Isometry3))
Expand Down

0 comments on commit 1decd9d

Please sign in to comment.