def set_tcp(self, pose):
        """Set the Tool Center Point

        See :class:`URScript` for detailed information
        """
        script = URScript.set_tcp(pose).encode()
        return self._send_script(script)
    def stopj(self, a=1.5):
        """Stop (linear in joint space)

        See :class:`URScript` for detailed information
        """
        script = URScript.stopj(a).encode()
        return self._send_script(script)
    def movej(self, q, a=0.1, v=0.1, joint_p=True):
        """Move to position (linear in joint-space)

        See :class:`URScript` for detailed information
        """
        script = URScript.movej(q, a, v, joint_p=joint_p).encode()
        return self._send_script(script)
    def movel(self, pose, a=0.1, v=0.1, joint_p=False):
        """Move to position (linear in tool-space)

        See :class:`URScript` for detailed information
        """
        script = URScript.movel(pose, a, v, joint_p=joint_p).encode()
        return self._send_script(script)
    def __init__(self, host):
        self.secondaryPort = 30002
        self.secondaryInterface = SocketConnection(host, self.secondaryPort)
        self.secondaryInterface.connect()
        self.URModbusServer = URModbusServer(host)
        self.URScript = URScript()

        # variables that count how many times the arm moved to a certain direction
        self.right_moves = 0
        self.left_moves = 0
        self.down_moves = 0
        self.up_moves = 0
        self.forward_moves = 0
        self.backward_moves = 0

        # variable to memorize the state of the magnet: true if active, false otherwise
        self.is_magnet_active = False
        self.set_io(8, False)

        # variables representing the minimum and maximum values for the X, Y & Z axis, which the arm can reach (in mm)
        self.max_x = 100.00  # to right, 2 moves
        self.max_y = -750.00
        self.max_z = 400
        self.min_x = -300.00  # to left, 2 moves
        self.min_y = -850.00
        self.min_z = 6

        # Max safe values of acceleration and velocity are 0.4
        # DO NOT USE THE FOLLOWING VALUES
        # MAX a=1.3962634015954636
        # MAX v=1.0471975511965976
        # These are the absolute max for 'safe' movement and should only be used
        # if you know what your are doing, otherwise you WILL damage the UR internally
        self.acceleration = 0.1
        self.velocity = 0.1
Example #6
0
    def __init__(self, host):
        self.secondaryPort = 30002
        self.secondaryInterface = SocketConnection(host, self.secondaryPort)
        self.secondaryInterface.connect()
        self.URModbusServer = URModbusServer(host)
        self.URScript = URScript()

        # Max safe values of acceleration and velocity are 0.4
        # DO NOT USE THE FOLLOWING VALUES
        # MAX a=1.3962634015954636
        # MAX v=1.0471975511965976
        # These are the absolute max for 'safe' movement and should only be used
        # if you know what your are doing, otherwise you WILL damage the UR internally
        self.acceleration = 0.1
        self.velocity = 0.1