10 from example_robot_data
import load_full
14 def check(self, name, expected_nq, expected_nv, one_kg_bodies=[]):
15 """Helper function for the real tests""" 16 robot, _, urdf, _ =
load_full(name, display=
False)
17 self.assertEqual(robot.model.nq, expected_nq)
18 self.assertEqual(robot.model.nv, expected_nv)
19 self.assertTrue(hasattr(robot,
"q0"))
24 client_id = pybullet.connect(pybullet.DIRECT)
25 robot_id = pybullet.loadURDF(urdf, physicsClientId=client_id)
26 for joint_id
in range(pybullet.getNumJoints(robot_id, client_id)):
27 dynamics = pybullet.getDynamicsInfo(robot_id, joint_id, client_id)
29 joint = pybullet.getJointInfo(robot_id, joint_id, client_id)
31 self.assertIn(joint[12].decode(), one_kg_bodies)
32 pybullet.disconnect(client_id)
35 self.
check(
'anymal', 19, 18)
38 self.
check(
'anymal_kinova', 25, 24)
41 self.
check(
'double_pendulum', 2, 2)
44 self.
check(
'hector', 7, 6)
47 self.
check(
'hyq', 19, 18)
50 self.
check(
'icub', 39, 38)
53 self.
check(
'icub_reduced', 36, 35)
56 self.
check(
'iris', 7, 6)
59 self.
check(
'kinova', 9, 6)
62 self.
check(
'panda', 9, 9)
65 self.
check(
'romeo', 62, 61)
68 self.
check(
'simple_humanoid', 36, 35, one_kg_bodies=[
'LARM_LINK3',
'RARM_LINK3'])
71 self.
check(
'simple_humanoid_classical', 36, 35, one_kg_bodies=[
'LARM_LINK3',
'RARM_LINK3'])
74 self.
check(
'solo', 15, 14)
77 self.
check(
'solo12', 19, 18)
80 self.
check(
'talos', 39, 38)
83 self.
check(
'talos_box', 39, 38)
86 self.
check(
'talos_full', 51, 50)
89 self.
check(
'talos_full_box', 51, 50)
92 self.
check(
'talos_arm', 7, 7)
95 self.
check(
'talos_legs', 19, 18)
98 self.
check(
'tiago', 50, 48)
101 self.
check(
'tiago_no_hand', 14, 12)
104 self.
check(
'ur5', 6, 6)
107 self.
check(
'ur5_gripper', 6, 6)
110 self.
check(
'ur5_limited', 6, 6)
113 if __name__ ==
'__main__':
def test_talos_full_box(self)
def test_ur5_gripper(self)
def check_pybullet(self, urdf, one_kg_bodies)
def test_icub_reduced(self)
def test_talos_full(self)
def test_talos_legs(self)
def test_anymal_kinova(self)
def load_full(name, display=False, rootNodeName='')
def test_tiago_no_hand(self)
def test_simple_humanoid_classical(self)
def test_double_pendulum(self)
def test_simple_humanoid(self)
def check(self, name, expected_nq, expected_nv, one_kg_bodies=[])
def test_ur5_limited(self)