My task is to align a object with a surface using a force torque sensor.
For that task it would be very helpful if I could write “my own movement” method in URScript.
I could achieve this with the movement in x-, respectively y- and z- axis.
But with the rotation I have difficulties due to the coordinate system, I couldn´t find a reference to base or tcp coordinate system in the function parameters.
Maybe I have to use a different function, I don´t know yet?
Here is my method to move the robot relative to the actual position by 100mm:
def move_rel_z(velocity):
xVal = 0.4
yVal = 0.4
zVal = 0.4
rx = 3.141
ry = 0
rz = 0
fromVal = 0.95
toVal = 1.95
a = 0.5
r = 0.0movel(pose_add(get_forward_kin(), pose_sub(p[xVal, yVal, fromVal, rx, ry, rz], p[xVal, yVal, toVal, rx, ry, rz])), a=a, v=velocity, r=r)
end
I don´t exactly understand why there must be a “pose_add(…(get_forward_kin), pose_sub(…)))” but the important thing is that the difference between the two poses is only in the z-axis and has the value of 100mm.
When I try the same idea with the rotations the robots move “very strange”, a difference in the “rz”- value doesn´t create a rotation in the z- axis of the tcp.
When tcp and base are aligned in the z-axis the rotation should be the same, but somehow it isn´t.
Looking forward to your answer. Thanks so far.
The method is called in a URScript call by: move_rel_z(0.01)
Here´s a screenshot from the Polyscope MoveRelative method I “redesigned”: