Hello, I am trying to move my tool a specific rotation and distance so that it goes this same distance no matter where the robotic arm starts instead of using waypoints which all ways bring the tool to the same spot. I thought p[x,y,z,rx,ry,rv] would do this but, every time the robotic arm moves far away from the designated area.
The trick is to use the get_actual_joint_positions(), get_actual_tcp_pose(), get_target_joint_positions(), & get_target_tcp_pose() functions, then offset from there.
Which one of these functions you use depends on the situation.
The general code looks like this:
pos1 = get_actual_joint_positions()
pos1[0] = pos1[0] + .001
pos1[1] = pos1[1] + .002
pos1[2] = pos1[2] + .003
pos1[3] = pos1[3] + .1.57
pos1[4] = pos1[4] + 3.14
pos1[5] = pos1[5] + 4.71
movej(pos1), a=0.5,v=0.4)
Here’s a simple function which will move a specified joint to a specified angle:
def move_joint(joint_num, angle_deg):
global move_pos= get_actual_joint_positions()
angle_rad = angle_deg*3.14159/180
move_pos[joint_num]=angle_rad
movej(move_pos, a=0.5, v=0.4)
end
Are you familiar with Relative Waypoints?
These do exactly what you describe; move a certain distance/rotation no matter where the robot is located.
You can change the type of a waypoint from Fixed to Relative in the upper right corner.
Thankyou this helped