diff --git a/python/example_robot_data/robots_loader.py b/python/example_robot_data/robots_loader.py index 5e51873c96e06a554c871da69abcadb840b3d4c0..6374a869ddb64242b95a7ed654a72f1b2b556a81 100644 --- a/python/example_robot_data/robots_loader.py +++ b/python/example_robot_data/robots_loader.py @@ -236,8 +236,9 @@ def loadICub(reduced=True): return robot -def loadUR(robot=5, limited=False): - URDF_FILENAME = "ur%i%s_robot.urdf" % (robot, "_joint_limited" if limited else '') +def loadUR(robot=5, limited=False, gripper=False): + assert (not (gripper and (robot == 10 or limited))) + URDF_FILENAME = "ur%i%s_%s.urdf" % (robot, "_joint_limited" if limited else '', 'gripper' if gripper else 'robot') URDF_SUBPATH = "/ur_description/urdf/" + URDF_FILENAME modelPath = getModelPath(URDF_SUBPATH) return RobotWrapper.BuildFromURDF(modelPath + URDF_SUBPATH, [modelPath]) diff --git a/unittest/test_load.py b/unittest/test_load.py index 2052199d1b577d94c0540ea9dc91cb0c1e8b8e6c..1c5dcee2b0422acec54703ac6c8fadd1dfab47c9 100755 --- a/unittest/test_load.py +++ b/unittest/test_load.py @@ -101,6 +101,18 @@ class UR5Test(RobotTestCase): RobotTestCase.NV = 6 +class UR5LimitedTest(RobotTestCase): + RobotTestCase.ROBOT = example_robot_data.loadUR(limited=True) + RobotTestCase.NQ = 6 + RobotTestCase.NV = 6 + + +class UR5GripperTest(RobotTestCase): + RobotTestCase.ROBOT = example_robot_data.loadUR(gripper=True) + RobotTestCase.NQ = 6 + RobotTestCase.NV = 6 + + class KinovaTest(RobotTestCase): RobotTestCase.ROBOT = example_robot_data.loadKinova() RobotTestCase.NQ = 9