Exemplo n.º 1
0
    def movePTPArc_AC(self, theta, c, k, vel):
        check_size(3, "Center of circle", c)
        check_size(3, "Orientation vector", k)
        check_scalar("Angle", theta)
        check_scalar("Relative velocity", vel)

        pos = self.getter.getEEFPos()
        x = math.pow(c[0] - pos[0], 2) + math.pow(c[1] - pos[1], 2) + math.pow(
            c[2] - pos[2], 2)
        r = math.pow(x, 0.5)

        check_non_zero("Radius", r)
        check_non_zero("Angle", theta)

        #calculate unit vector
        x = math.pow(k[0], 2) + math.pow(k[1], 2) + math.pow(k[2], 2)
        normK = math.pow(x, 0.5)
        check_non_zero("Norm with direction of vector k", normK)

        k[0] = k[0] / normK
        k[1] = k[1] / normK
        k[2] = k[2] / normK
        s = [c[0] - pos[0], c[1] - pos[1], c[2] - pos[2]]
        s[0] = -s[0] / r
        s[1] = -s[1] / r
        s[2] = -s[2] / r
        n = [(k[1] * s[2] - k[2] * s[1]), (k[2] * s[0] - k[0] * s[2]),
             (k[0] * s[1] - k[1] * s[0])]
        c1 = self.rotTheThing(theta / 2, r, s, n, c)
        c2 = self.rotTheThing(theta, r, s, n, c)
        self.movePTPCirc1OrintationInter(c1, c2, vel)
Exemplo n.º 2
0
    def movePTPArcXY_AC(self, theta, c, vel):
        check_size(2, "Center of circle", c)
        check_scalar("Angle", theta)
        check_scalar("Relative velocity", vel)

        k = [0, 0, 1]
        pos = self.getter.getEEFPos()
        c1 = [c, pos[2]]
        self.movePTPArc_AC(theta, c1, k, vel)
Exemplo n.º 3
0
    def movePTPJointSpace(self, jpos, relVel):
        check_size(7, "Joints ", jpos)
        check_scalar("Relative Velocity", relVel)

        command = self.createCommand("jRelVel", relVel)
        self.send(command)

        self.sender.sendJointsPositions(jpos)

        theCommand = b'doPTPinJS'
        self.send(theCommand)
        self.blockUntilAcknowledgment()
Exemplo n.º 4
0
    def movePTPHomeJointSpace(self, relVel):
        check_scalar("Relative Velocity", relVel)

        command = self.createCommand("jRelVel", relVel)
        self.send(command)

        jpos = [0, 0, 0, 0, 0, 0, 0]
        self.sender.sendJointsPositions(jpos)

        theCommand = b'doPTPinJS_'
        self.send(theCommand)

        self.blockUntilAcknowledgment()
Exemplo n.º 5
0
    def movePTPLineEEF(self, pos, vel):
        check_size(6, "Position ", pos)
        check_scalar("Velocity", vel)

        command = self.createCommand("jRelVel", vel)

        #
        self.send(command)
        self.sender.sendEEfPositions(pos)

        theCommand = b'doPTPinCS_'
        self.send(theCommand)
        self.blockUntilAcknowledgment()
Exemplo n.º 6
0
    def movePTPCirc1OrintationInter(self, f1, f2, relVel):
        check_size(6, "First frame [x,y,z,alpha,beta,gamma]", f1)
        check_size(6, "Second frame [x,y,z,alpha,beta,gamma]", f2)
        check_scalar("Relative velocity", relVel)

        command = self.createCommand('jRelVel', relVel)
        self.send(command)

        self.sender.sendCirc1FramePos(f1)
        self.sender.sendCirc2FramePos(f2)

        theCommand = b'doPTPinCSCircle1_'
        self.send(theCommand)
        self.blockUntilAcknowledgment()
Exemplo n.º 7
0
    def movePTPLineEEFRelBase(self, pos, vel):
        check_size(3, "Position ", pos)
        check_scalar("Velocity", vel)

        command = self.createCommand("jRelVel", vel)
        self.send(command)

        newPos = [0, 0, 0, 0, 0, 0, 0]
        newPos[0] = pos[0]
        newPos[1] = pos[1]
        newPos[2] = pos[2]
        self.sender.sendEEfPositions(newPos)

        theCommand = b'doPTPinCSRelBase'
        self.send(theCommand)
        self.blockUntilAcknowledgment()
Exemplo n.º 8
0
 def movePTPTransportPositionJointSpace(self, relVel):
     check_scalar("Relative Velocity", relVel)
     jpos = [0, 0, 0, 0, 0, 0, 0]
     jpos[3] = 25 * math.pi / 180
     jpos[5] = 90 * math.pi / 180
     self.movePTPJointSpace(jpos, relVel)