rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
728 stars 344 forks source link

"local variable 'AUinvvalue' referenced before assignment" error when running ikfast generator #338

Open skohlbr opened 9 years ago

skohlbr commented 9 years ago

Using the "production" branch of OpenRAVE I get the following error relatively fast after invoking ikfast for a robot model. I updated from an older version, which does not exhibit the error but appears to never finish.

INFO: not unique: (Poly(-23*npx/1250*cj16*cj17 + 23*npy/1250*cj16*sj17 - 529/3125000*cj16 - 23*npz/1250*sj16 + (23*npx/1250 + 153*npy/250)*cj17 + (153*npx/250 - 23*npy/1250)*sj17, cj16, sj16, cj17, sj17, htj15, domain='QQ[npx,npy,npz]'), Poly(1683/25000*cj13 + 253/125000*sj13*cj14 - 11/3125*sj13 - 23/78125*cj14 - pp + 9587/781250, cj13, sj13, cj14, sj14, htj15, domain='QQ[pp]'))
INFO: not unique: [Poly(23*r20/2500*cj16*cj17 - 23*r21/2500*cj16*sj17 + 23*r22/2500*sj16 + (-23*r20/2500 - 153*r21/500)*cj17 + (-153*r20/500 + 23*r21/2500)*sj17, cj16, sj16, cj17, sj17, htj15, domain='QQ[pz,r20,r21,r22]'), Poly(-23/2500*cj13*cj14 + 2/125*cj13 + 153/500*sj13 + pz, cj13, sj13, cj14, sj14, htj15, domain='QQ[pz]')]
INFO: assuming equation htj15 is non-zero
INFO: not unique: (Poly(23*r20/2500*cj16*cj17 - 23*r21/2500*cj16*sj17 + 23*r22/2500*sj16 + (-23*r20/2500 - 153*r21/500)*cj17 + (-153*r20/500 + 23*r21/2500)*sj17, cj16, sj16, cj17, sj17, htj15, domain='QQ[r20,r21,r22]'), Poly(-23/2500*cj13*cj14 + 2/125*cj13 + 153/500*sj13 + pz, cj13, sj13, cj14, sj14, htj15, domain='QQ[pz]'))
INFO: assuming equation htj15 is non-zero
INFO: not unique: (Poly((153*rxp0_2/250 - 23*rxp1_2/1250)*cj16*cj17 + (-23*rxp0_2/1250 - 153*rxp1_2/250)*cj16*sj17 + (-2*npz*pz + pp*r22 + 586283*r22/6250000)*cj16 + (2*npx*pz - pp*r20 - 23409*r20/250000 + 3519*r21/625000)*sj16*cj17 + (-2*npy*pz + pp*r21 + 3519*r20/625000 + 23409*r21/250000)*sj16*sj17 + (23*pz/1250 + 153*rxp2_2/250)*sj16 + 23*rxp1_2/1250*cj17 + 23*rxp0_2/1250*sj17, cj16, sj16, cj17, sj17, htj15, domain='QQ[r20,r21,r22,npx,npy,npz,pp,pz,rxp0_2,rxp1_2,rxp2_2]'), Poly(-659779/6250000*cj13*sj14 + 153/15625*sj13*sj14 - 1683/25000*sj14 + 529*r22/3125000, cj13, sj13, cj14, sj14, htj15, domain='QQ[r22]'))
INFO: matrix has 64 symbols
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py", line 9203, in 
    chaintree = solver.generateIkSolver(options.baselink,options.eelink,options.freeindices,solvefn=solvefn)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py", line 2257, in generateIkSolver
    chaintree = solvefn(self, LinksRaw, jointvars, isolvejointvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py", line 2911, in solveFullIK_6D
    tree = self.solveFullIK_6DGeneral(T0links, T1links, solvejointvars, endbranchtree, usesolvers=1)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py", line 3213, in solveFullIK_6DGeneral
    coupledsolutions,usedvars = solvemethod(rawpolyeqs,solvejointvars,endbranchtree=endbranchtree,AllEquationsExtra=AllEquationsExtra)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py", line 4818, in solveLiWoernleHiller
    for i in range(AUinvvalue.shape[0]):
UnboundLocalError: local variable 'AUinvvalue' referenced before assignment

This is on Ubuntu 12.04/AMD64 using the latest OpenRAVE production branch. If it helps, I can upload further info (full output, robot model data etc.) too. Figured the output could already be enough to get an idea what´s wrong though.

skohlbr commented 9 years ago

Both older version and current master appear to never finish, so maybe the IK for this arm is not quite solvable for ikfast. I uploaded the terminal output for all versions I tried here: https://github.com/skohlbr/kohlbr_notes/tree/master/openrave_issue_338

rdiankov commented 9 years ago

thanks for reporting this! i just made a minor fix to the master branch on ikfast.py, can you try again?

skohlbr commented 9 years ago

Works now in that it doesn´t crash anymore. Still appears to never finish, but that´s probably expected given the non-intersecting axes of the arm in question.

rdiankov commented 9 years ago

does it freeze in the same point?

skohlbr commented 9 years ago

Looks like, this is the output so far: https://github.com/skohlbr/kohlbr_notes/blob/e2e1c42d32064a48b101e97acd0903c4adcd8872/openrave_issue_338/ikfast_output_production_59e7865.txt

Still have it running, but from experience I don´t think it will finish. Can´t really blame ikfast, as the axes on the atlas v4 arm have small offsets, making them non-intersecting: rviz_screenshot_2015_01_06-09_20_51