Hi,
I am creating a script that should allow the user to move the TCP to a position, and then select the radius of a circle to draw. Basically it would be a combination of Polyscope and URscript: the user creates a waypoint (that marks the beginning of the circle) and then calls the dCircle function described below.
I have tried to do this with both MoveC and MoveP but with unsatisfactory results.
Any comments and suggestions would be welcome.
MoveC:
def getRelativeTcp(x, y, z):
tcp = get_actual_tcp_pose()
tcp[0] = tcp[0] + x/1000
tcp[1] = tcp[1] + y/1000
tcp[2] = tcp[2] + z/1000
return tcp
end
#The user inputs radius and velocity
def dCircle(cRadius, velocity):
#Position at the topmost point of the circle, , in relation to the previous position
pos1 = getRelativeTcp(cRadius, cRadius , 0)
#Position at the rightmost point of the circle, in relation to the previous position
pos2 = getRelativeTcp(cRadius, -cRadius, 0)
#Here I try make the TCP move a half-moon to other side of the circle. For some reason I am not able to use other blend values than 1mm, meaning that the circle radius is not related to blend radius?
movec(pos1, pos2, a=1, v=velocity, r= cRadius/1000, mode = 0)
end
MoveP:
def getRelativeTcp(x, y, z):
tcp = get_actual_tcp_pose()
tcp[0] = tcp[0] + x/1000
tcp[1] = tcp[1] + y/1000
tcp[2] = tcp[2] + z/1000
return tcp
end
def dCircle(cRadius, velocity):
#Position on the other side of the circle
pos1 = getRelativeTcp(cRadius*2, 0, 0)
#Trying to tell the robot to move to the position by blending a half-circle with the wished radius
movep(pos, a=1.2, v=0.25, r=cRadius/1000)
end