hello dear community, I am trying to implement by software the free movement with axis restriction, as you are implementing in polyscope and the free mode button of the programming tablet (attached image).
You can help me to find the right way to do it. I have tried the following options:
force_mode() command, restricting axes where force is applied.
def FreeDrive_force(register_flag):
global for_thrd = run force_thread(register_flag)
global for_thrd = run getForces()
end
##############################################
def end_FreeDrive_force():
kill for_thrd
kill for_thrd
end
##############################################
thread force_thread(register_flag):
limits = [0.1, 0.1, 0.1, 10, 10, 10]
frame = p[0.0,0.0,0.0,0.0,0.0,0.0]
#list to select axis move
selection = [0, 0, 0, 1, 1, 1]
type=2
wrench = [0, 0, 0, 0.1, 0.1, 0.1]
while (not(read_input_boolean_register(register_flag) == True )):
force_mode(frame,selection , wrench, type, limits)
sync()
end #while
end_FreeDrive_force()
end #thread define
###############################################
thread getForces():
zero_ftsensor()
while True:
global forces = get_tcp_force()
sync()
end
end
Force sensing with get_tcp_force() and get a proportional value of force to convert it into speed for speedl()
def admitance_mode(register_flag):
#list to select axis move
global speed_limits = [0, 0, 0, 0.5, 0.5, 0.5]
global pose_thrd = run getForce()
global ad_thrd = run admitance_thread(register_flag)
end
###############################################################################
def end_admitance_mode():
kill ad_thrd
kill pose_thrd
end
###############################################################################
thread admitance_thread(register_flag):
while (not(read_input_boolean_register(register_flag) == True )):
l = speed_limits
f = force
fn = force_nom
acc = 0.25
result = [l[0]*(f[0]/fn), l[1]*(f[1]/fn), l[2]*(f[2]/fn), l[3]*f[3], l[4]*f[4], l[5]*f[5]]
speedl(result, acc)
sync()
end #while
end_admitance_mode()
end #thread define
thread getForce():
zero_ftsensor()
while True:
global force = get_tcp_force()
global force_nom = force()
sync()
end
end
thanks for your help