Skip to content

Commit 362646e

Browse files
author
Peter
committed
new test for Val FK
1 parent 6ec0d34 commit 362646e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_kinematics.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,19 @@ def test_mjcf_slide_joint_parsing():
260260
print(chain.get_frame_names())
261261

262262

263+
def test_fk_val():
264+
chain = pk.build_chain_from_mjcf(open(os.path.join(TEST_DIR, "val.xml")).read())
265+
chain = chain.to(dtype=torch.float64)
266+
ret = chain.forward_kinematics(torch.zeros([1000, chain.n_joints], dtype=torch.float64))
267+
tg = ret['drive45']
268+
pos, rot = quat_pos_from_transform3d(tg)
269+
assert quaternion_equality(rot, torch.tensor([0.5, 0.5, -0.5, 0.5], dtype=torch.float64))
270+
assert torch.allclose(pos, torch.tensor([-0.225692, 0.259045, 0.262139], dtype=torch.float64))
271+
272+
263273
if __name__ == "__main__":
274+
test_fk_val()
275+
test_sdf_serial_chain()
264276
test_urdf_serial()
265277
test_fkik()
266278
test_fk_simple_arm()

0 commit comments

Comments
 (0)