Exemple #1
0
    def __init__(self, base_link, link_1, link_2,
                 link_3, link_4, link_5, link_6, fk, interact=False):
        self.viewer = Viewer()
        self.grid = Grid()
        self.viewer.add(self.grid)

        self.base_link = base_link
        self.link_1 = link_1
        self.link_2 = link_2
        self.link_3 = link_3
        self.link_4 = link_4
        self.link_5 = link_5
        self.link_6 = link_6

        self.viewer.add(self.base_link)
        self.viewer.add(self.link_1)
        self.viewer.add(self.link_2)
        self.viewer.add(self.link_3)
        self.viewer.add(self.link_4)
        self.viewer.add(self.link_5)
        self.viewer.add(self.link_6)

        self._fk = fk

        if interact:
            self.interact()

        self.show(np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
    def __init__(self):
        self._viewer = Viewer()
        self._grid = Grid()
        self._viewer.add(self._grid)

        base_link = kr6.BaseLink()
        link1 = kr6.Link1()
        link2 = kr6.Link2()
        link3 = kr6.Link3()
        link4 = kr6.Link4()
        link5 = kr6.Link5()
        link6 = kr6.Link6()
        ee_link = Axes(0.1)

        joint1 = Object3D()
        joint1.position = (0.0, 0.0, 0.4)
        joint2 = Object3D()
        joint2.position = (0.025, 0.0, 0.0)
        joint3 = Object3D()
        joint3.position = (0.455, 0.0, 0.0)
        joint4 = Object3D()
        joint4.position = (0.0, 0.0, 0.035)
        joint5 = Object3D()
        joint5.position = (0.42, 0.0, 0.0)
        joint6 = Object3D()
        joint6.position = (0.08, 0.0, 0.0)

        ee_joint = Object3D()

        base_link.add(joint1)
        joint1.add(link1)
        link1.add(joint2)
        joint2.add(link2)
        link2.add(joint3)
        joint3.add(link3)
        link3.add(joint4)
        joint4.add(link4)
        link4.add(joint5)
        joint5.add(link5)
        link5.add(joint6)
        joint6.add(link6)
        link6.add(ee_joint)
        ee_joint.add(ee_link)

        self._joints = [joint1, joint2, joint3, joint4, joint5, joint6]
        self._offsets = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
        self._axes = np.array(
            [
                [0.0, 0.0, -1.0],
                [0.0, 1.0, 0.0],
                [0.0, 1.0, 0.0],
                [-1.0, 0.0, 0.0],
                [0.0, 1.0, 0.0],
                [-1.0, 0.0, 0.0],
            ]
        )

        self.theta = np.zeros(6)

        self._robot = base_link
        self._viewer.add(self._robot)
    def __init__(self):
        self._viewer = Viewer()
        self._grid = Grid()
        self._viewer.add(self._grid)

        base_link = ur5.BaseLink()
        link1 = ur5.Link1()
        link2 = ur5.Link2()
        link3 = ur5.Link3()
        link4 = ur5.Link4()
        link5 = ur5.Link5()
        link6 = ur5.Link6()
        ee_link = Axes(0.1)

        joint1 = Object3D()
        joint1.position = (0.0, 0.0, 0.089159)
        joint2 = Object3D()
        joint2.position = (0.0, 0.13585, 0.0)
        joint3 = Object3D()
        joint3.position = (0.0, -0.1197, 0.425)
        joint4 = Object3D()
        joint4.position = (0.0, 0.0, 0.39225)
        joint5 = Object3D()
        joint5.position = (0.0, 0.093, 0.0)
        joint6 = Object3D()
        joint6.position = (0.0, 0.0, 0.09465)

        ee_joint = Object3D()
        ee_joint.position = (0.0, 0.0823, 0.0)
        ee_joint.rotateX(-np.pi / 2)

        base_link.add(joint1)
        joint1.add(link1)
        link1.add(joint2)
        joint2.add(link2)
        link2.add(joint3)
        joint3.add(link3)
        link3.add(joint4)
        joint4.add(link4)
        link4.add(joint5)
        joint5.add(link5)
        link5.add(joint6)
        joint6.add(link6)
        link6.add(ee_joint)
        ee_joint.add(ee_link)

        self._joints = [joint1, joint2, joint3, joint4, joint5, joint6]
        self._offsets = np.array([0.0, np.pi / 2, 0.0, np.pi / 2, 0.0, 0.0])
        self._axes = np.array(
            [
                [0.0, 0.0, 1.0],
                [0.0, 1.0, 0.0],
                [0.0, 1.0, 0.0],
                [0.0, 1.0, 0.0],
                [0.0, 0.0, 1.0],
                [0.0, 1.0, 0.0],
            ]
        )

        self.theta = np.zeros(6)

        self._robot = base_link
        self._viewer.add(self._robot)