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

    # test sequence of links
    MDHKinematicChain([RevoluteMDHLink()])
예제 #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)
예제 #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)
예제 #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)
예제 #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]])))
예제 #6
0
def test_ndof():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    assert kc.ndof == 1
예제 #7
0
def test_links_setter():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    kc.links = link
예제 #8
0
def test_to_json():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    kc.to_json()
예제 #9
0
def test_repr():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    repr(kc)
예제 #10
0
def test_vector():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    np.testing.assert_allclose(kc.vector, link.vector)
예제 #11
0
def test_num_parameters():
    """Test."""
    link = RevoluteMDHLink()
    kc = MDHKinematicChain([link])
    assert kc.num_parameters == MDHLink._size
예제 #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)