Universal Robots Forum

Get_inverse_kin - qnear is not always updated


get_inverse_kin() is not always updating the qnear if it is called several time with the same x (Tool pose)


  • Affected Robot Software Version(s): 5.8.2
  • Affected Robot Hardware Version(s): Simulator
  • Robot Serial Number: Simulator
  • UR+ product(s) installed:-
  • URCaps Software version(s): -


The returned joint angles will, in some cases, be different than expected

Issue details

The issue was found during looking into the functionality of qnear. The investigations is made on the simulator and with the TCP set to p[0,0,0,0,0,0]. The script to trig the issue

qn1 = [-1.6007 ,2.51106 ,2.203,-3.16898 ,1.5951,-0.031]
qn2 = [-1.6007 ,2.61264 ,1.63712 ,0.436917,-1.5951 ,3.11059]
p = get_forward_kin(qn1)
p_mod = p
p_mod[0] = 0     
s1 = get_inverse_kin(p,qn1)
s2 = get_inverse_kin(p,qn2)
#s1 and is s2 is expected to be different due to the q_near -> t1 should be True 
global t1 = s1!=s2

get_inverse_kin(p_mod)    #other pose as argument is "refreshing get_inverse_kin()s memory" 
s1 = get_inverse_kin(p,qn1)
get_inverse_kin(p_mod) #other pose as argument is "refreshing get_inverse_kin()s memory"
s2 = get_inverse_kin(p,qn2)
global t2 = s1!=s2


Use Case and Setup

The simulator with an empty program, add a single script node and insert the script.

Project status at point of discovered

in every use

Steps to Reproduce

Run the program described in the Setup

Expected Behavior

The assert should not trig an exception

Actual Behavior

The assert is triggering an exception

Workaround Suggestion

As shown in the sample. The issue can be avoided by making another get_inverse_kin() call with a different tool pose in between the calls where the returned value is used.

This bug is now resolved in Polyscope version 5.9.4 and 3.14.3

1 Like