Esempio n. 1
0
def test_set_joint_angle():
    from panda_gym.pybullet import PyBullet

    pybullet = PyBullet()
    pybullet.loadURDF(
        body_name="panda",
        fileName="franka_panda/panda.urdf",
        basePosition=[0.0, 0.0, 0.0],
        useFixedBase=True,
    )
    pybullet.set_joint_angle("panda", 3, 0.4)
    joint_angle = pybullet.get_joint_angle("panda", 3)
    assert np.allclose(joint_angle, 0.4, atol=1e-3)
    pybullet.close()
Esempio n. 2
0
def test_get_joint_angle():
    from panda_gym.pybullet import PyBullet

    pybullet = PyBullet()
    pybullet.loadURDF(
        body_name="panda",
        fileName="franka_panda/panda.urdf",
        basePosition=[0.0, 0.0, 0.0],
        useFixedBase=True,
    )
    pybullet.control_joints("panda", [5], [0.3], [5.0])
    pybullet.step()
    joint_angle = pybullet.get_joint_angle("panda", 5)
    assert np.allclose(joint_angle, 0.063, atol=1e-3)
    pybullet.close()