Esempio n. 1
0
def test_init():
    """Test."""
    # test error
    with raises(PyboticsError):
        MDHKinematicChain(np.eye(5))

    # test sequence of links
    MDHKinematicChain([RevoluteMDHLink()])
Esempio n. 2
0
class UR10(Robot):
    """Universal Robots UR10 collaborative robot."""

    # TODO: add manufacturer's joint limits
    kinematic_chain = MDHKinematicChain(
        np.array([
            0, 0, 0, 118, np.pi / 2, 0, np.pi, 0, 0, 612.7, 0, 0, 0, 571.6, 0,
            163.9, -np.pi / 2, 0, 0, 115.7, np.pi / 2, 0, np.pi, 92.2
        ]))

    def __init__(self, **kwargs: Any) -> None:
        """Init robot."""
        super().__init__(deepcopy(self.kinematic_chain), **kwargs)
Esempio n. 3
0
class MecademicMeca500(Robot):
    """Mecademic Meca500 small robot."""

    # TODO: add manufacturer's joint limits
    kinematic_chain = MDHKinematicChain(
        np.array([
            0, 0, 0, 135, -np.pi / 2, 0, -np.pi / 2, 0, 0, 135, 0, 0,
            -np.pi / 2, 38, 0, 120, np.pi / 2, 0, 0, 0, -np.pi / 2, 0, np.pi,
            72
        ]))

    def __init__(self, **kwargs: Any) -> None:
        """Init robot."""
        super().__init__(deepcopy(self.kinematic_chain), **kwargs)
Esempio n. 4
0
class KukaLBRiiwa7(Robot):
    """KUKA LBR iiwa 7 R800 collaborative robot."""

    # TODO: add manufacturer's joint limits
    kinematic_chain = MDHKinematicChain(
        np.array([
            0, 0, 0, 340, -np.pi / 2, 0, 0, 0, np.pi / 2, 0, 0, 400, np.pi / 2,
            0, 0, 0, -np.pi / 2, 0, 0, 400, -np.pi / 2, 0, 0, 0, np.pi / 2, 0,
            0, 126
        ]))

    def __init__(self, **kwargs: Any) -> None:
        """Init robot."""
        super().__init__(deepcopy(self.kinematic_chain), **kwargs)
Esempio n. 5
0
def planar_robot():
    """Generate planar robot."""
    return Robot(
        MDHKinematicChain(
            np.array([[0, 0, 0, 0], [0, 10, 0, 0], [0, 20, 0, 0]])))
Esempio n. 6
0
def test_ndof():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    assert kc.ndof == 1
Esempio n. 7
0
def test_links_setter():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    kc.links = link
Esempio n. 8
0
def test_to_json():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    kc.to_json()
Esempio n. 9
0
def test_repr():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    repr(kc)
Esempio n. 10
0
def test_vector():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    np.testing.assert_allclose(kc.vector, link.vector)
Esempio n. 11
0
def test_num_parameters():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    assert kc.num_parameters == MDHLink._size
Esempio n. 12
0
 def from_parameters(cls, parameters: Sequence[float]) -> Sized:
     """Construct Robot from Kinematic Chain parameters."""
     # FIXME: assumes MDH revolute robot
     kc = MDHKinematicChain.from_parameters(parameters)
     return cls(kinematic_chain=kc)