diff --git a/python/example_robot_data/robots_loader.py b/python/example_robot_data/robots_loader.py index 59294e247bc931fae06aa766c5d7a5b3dbcd6b94..1df545ac25cb42c0854b75427267e11b48e257b7 100644 --- a/python/example_robot_data/robots_loader.py +++ b/python/example_robot_data/robots_loader.py @@ -237,7 +237,12 @@ ROBOTS = { 'double_pendulum': (loadDoublePendulum, {}), 'hector': (loadHector, {}), 'hyq': (loadHyQ, {}), - 'icub': (loadICub, {}), + 'icub': (loadICub, { + 'reduced': False + }), + 'icub_reduced': (loadICub, { + 'reduced': True + }), 'iris': (loadIris, {}), 'kinova': (loadKinova, {}), 'panda': (loadPanda, {}), @@ -258,6 +263,12 @@ ROBOTS = { 'hand': False }), 'ur5': (loadUR, {}), + 'ur5_gripper': (loadUR, { + 'gripper': True + }), + 'ur5_limited': (loadUR, { + 'limited': True + }), } diff --git a/unittest/test_load.py b/unittest/test_load.py index 0fa6b95b4ab3c1218834cecde69579b58c2a05f7..70abac2bd90c6ce3ff15cc560076a4a16122fc1b 100755 --- a/unittest/test_load.py +++ b/unittest/test_load.py @@ -2,66 +2,70 @@ import unittest -import example_robot_data as erd +from example_robot_data import load class RobotTestCase(unittest.TestCase): - def check(self, robot, expected_nq, expected_nv): + def check(self, name, expected_nq, expected_nv): """Helper function for the real tests""" + robot = load(name, display=False) self.assertEqual(robot.model.nq, expected_nq) self.assertEqual(robot.model.nv, expected_nv) self.assertTrue(hasattr(robot, "q0")) def test_anymal(self): - self.check(erd.loadANYmal(), 19, 18) + self.check('anymal', 19, 18) def test_anymal_kinova(self): - self.check(erd.loadANYmal(withArm="kinova"), 25, 24) + self.check('anymal_kinova', 25, 24) def test_hyq(self): - self.check(erd.loadHyQ(), 19, 18) + self.check('hyq', 19, 18) def test_talos(self): - self.check(erd.loadTalos(), 39, 38) + self.check('talos', 39, 38) def test_talos_arm(self): - self.check(erd.loadTalos(arm=True), 7, 7) + self.check('talos_arm', 7, 7) def test_talos_legs(self): - self.check(erd.loadTalos(legs=True), 19, 18) + self.check('talos_legs', 19, 18) def test_icub(self): - self.check(erd.loadICub(reduced=False), 39, 38) + self.check('icub', 39, 38) + + def test_icub_reduced(self): + self.check('icub_reduced', 36, 35) def test_solo(self): - self.check(erd.loadSolo(), 15, 14) + self.check('solo', 15, 14) def test_solo12(self): - self.check(erd.loadSolo(False), 19, 18) + self.check('solo12', 19, 18) def test_tiago(self): - self.check(erd.loadTiago(), 50, 48) + self.check('tiago', 50, 48) def test_tiago_no_hand(self): - self.check(erd.loadTiago(hand=False), 14, 12) + self.check('tiago_no_hand', 14, 12) def test_ur5(self): - self.check(erd.loadUR(), 6, 6) + self.check('ur5', 6, 6) def test_ur5_limited(self): - self.check(erd.loadUR(limited=True), 6, 6) + self.check('ur5_limited', 6, 6) def test_ur5_gripper(self): - self.check(erd.loadUR(gripper=True), 6, 6) + self.check('ur5_gripper', 6, 6) def test_kinova(self): - self.check(erd.loadKinova(), 9, 6) + self.check('kinova', 9, 6) def test_romeo(self): - self.check(erd.loadRomeo(), 62, 61) + self.check('romeo', 62, 61) def test_panda(self): - self.check(erd.loadPanda(), 9, 9) + self.check('panda', 9, 9) if __name__ == '__main__':