Quantcast

sympy PolynomialError: 1/r01 contains an element of the generators set

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

sympy PolynomialError: 1/r01 contains an element of the generators set

kmohan
This post was updated on .
Hello OpenRAVE community,

I am trying to create a custom IKFast plugin for Moveit by following this tutorial. And I'm encountering the Polynomial Error when I run
openrave.py --database inversekinematics --robot=robot_manip.xml --iktype=translationdirection5d --iktests=100

The robot_manip.xml is an OpenRAVE XML as per the solution to this thread

I am working on a 5-DOF robot and hence, using "translationdirection5d" for the iktype. I am not sure of what else information you will need to help me. So please do let me know if you need any other info.

Has anyone else faced this issue? Thanks in advance.

Edit:  I am using Ubuntu 14.04, OpenRAVE 0.9.0, ROS Indigo, python 2.7, numpy 1.11.1, scipy 0.18.0 and sympy 0.7.1.

The error dump is as follows: (Apologies for the lengthy error dump. Didn't know which part to ignore).

openravepy.databases.inversekinematics: generate, Generating inverse kinematics for manip surg_rob_manip: TranslationDirection5D [0, 1, 2, 3, 4] (this might take up to 10 min)
openravepy.databases.inversekinematics: generate, creating ik file /home/kiran/.openrave/kinematics.c652c4a791a2a2ce98381da3f4cea7e9/ikfast62.TranslationDirection5D.0_1_2_3_4.cpp
openravepy.ikfast: forwardKinematicsChain, moved translation [0, 0, 2781/100000] to right end
openravepy.ikfast: forwardKinematicsChain, moved translation [343/10000, 239/20000, -27/5000] to left end
openravepy.ikfast: forwardKinematicsChain, moved translation on intersecting axis [7569/100000, 39/500, 1/10] to left
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 193/10000],[0, 1, 0, 717/20000],[0, 0, 1, -5423/50000]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j0]]
openravepy.ikfast: generateIkSolver, [[0, 0, 1, 0],[0, 1, 0, 0],[-1, 0, 0, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j1]]
openravepy.ikfast: generateIkSolver, [[0, 1, 0, 71/1000],[0, 0, 1, 14381/100000],[1, 0, 0, 8669/100000]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j2]]
openravepy.ikfast: generateIkSolver, [[0, 0, 1, 0],[1, 0, 0, 0],[0, 1, 0, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j3), -sin(j3), 0, 0],[sin(j3), cos(j3), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[0, 0, -1, 0],[0, 1, 0, 0],[1, 0, 0, -77/4000]]
openravepy.ikfast: generateIkSolver, [[cos(j4), -sin(j4), 0, 0],[sin(j4), cos(j4), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 2/25],[0, 0, 1, 221/5000]]
openravepy.ikfast: solveFullIK_TranslationDirection5D, ikfast translation direction 5d: [j0, j1, j2, j3, j4]
openravepy.ikfast: solveLiWoernleHiller, attempting li/woernle/hiller general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'need exactly 8 equations of one variable'
openravepy.ikfast: solveLiWoernleHiller, attempting li/woernle/hiller general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables, has 2'
openravepy.ikfast: solveKohliOsvatic, attempting kohli/osvatic general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables'
openravepy.ikfast: solveKohliOsvatic, attempting kohli/osvatic general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables'
openravepy.ikfast: solveManochaCanny, attempting manocha/canny general ik method
openravepy.ikfast: _computereducedequations, solving for all pairwise variables in (j0, j1), number of symbol coeffs are 20
openravepy.ikfast: _computereducedequations, finished with 10 equations
Traceback (most recent call last):
  File "/usr/local/bin/openrave.py", line 126, in <module>
    database.run(args=args)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 1025, in run
    InverseKinematicsModel.RunFromParser(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 998, in RunFromParser
    model = DatabaseGenerator.RunFromParser(Model=Model,parser=parser,robotatts=robotatts,args=args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/__init__.py", line 252, in RunFromParser
    model.autogenerate(options=options)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 599, in autogenerate
    self.generate(iktype=iktype,freejoints=freejoints,precision=precision,forceikbuild=forceikbuild,outputlang=outputlang,ipython=ipython)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 807, in generate
    chaintree = solver.generateIkSolver(baselink=baselink,eelink=eelink,freeindices=self.freeindices,solvefn=solvefn)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 1640, in generateIkSolver
    chaintree = solvefn(self, LinksRaw, jointvars, isolvejointvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 650, in solveFullIK_TranslationDirection5D
    return self.ikfast.IKFastSolver.solveFullIK_TranslationDirection5D(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 2034, in solveFullIK_TranslationDirection5D
    coupledsolutions,usedvars = solvemethod(rawpolyeqs2[index],solvejointvars,endbranchtree=[AST.SolverSequence([endbranchtree2])])
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 3179, in solveManochaCanny
    RightEquations.append(self.simplifyTransformPoly(peq[1]))
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 4182, in simplifyTransformPoly
    return peq.termwise(lambda m,c: self.simplifyTransform(c))
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 837, in termwise
    result = func(monom, coeff)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 4182, in <lambda>
    return peq.termwise(lambda m,c: self.simplifyTransform(c))
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 4297, in simplifyTransform
    neweq = fn(eq)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 4208, in _simplifynorm
    p = Poly(eq,group[0],group[1],group[2])
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 98, in __new__
    return cls._from_expr(rep, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 208, in _from_expr
    rep, opt = _dict_from_expr(rep, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polyutils.py", line 292, in _dict_from_expr
    rep, gens = _dict_from_expr_if_gens(expr, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polyutils.py", line 250, in _dict_from_expr_if_gens
    (poly,), gens = _parallel_dict_from_expr_if_gens((expr,), opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polyutils.py", line 160, in _parallel_dict_from_expr_if_gens
    raise PolynomialError("%s contains an element of the generators set" % factor)
sympy.polys.polyerrors.PolynomialError: 1/r01 contains an element of the generators set
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sympy PolynomialError: 1/r01 contains an element of the generators set

kmohan
It occurred to me that this issue was occurring in the Manocha / Canny method and decided to change the ikfast.py code to not include this method. Specifically, I changed line 2019 as follows.

Line 2019 in Original ikfast.py:
for solvemethod in [self.solveLiWoernleHiller, self.solveKohliOsvatic, self.solveManochaCanny]:

Modified line as:
for solvemethod in [self.solveLiWoernleHiller, self.solveKohliOsvatic]:

After making this modification, I see a different error - 'raghavan roth equations too complex'
Any idea about this one?

 The error dump is as follows:

openravepy.databases.inversekinematics: generate, Generating inverse kinematics for manip surg_rob_manip: TranslationDirection5D [0, 1, 2, 3, 4] (this might take up to 10 min)
openravepy.databases.inversekinematics: generate, creating ik file /home/kiran/.openrave/kinematics.c652c4a791a2a2ce98381da3f4cea7e9/ikfast62.TranslationDirection5D.0_1_2_3_4.cpp
openravepy.ikfast: forwardKinematicsChain, moved translation [0, 0, 2781/100000] to right end
openravepy.ikfast: forwardKinematicsChain, moved translation [343/10000, 239/20000, -27/5000] to left end
openravepy.ikfast: forwardKinematicsChain, moved translation on intersecting axis [7569/100000, 39/500, 1/10] to left
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 193/10000],[0, 1, 0, 717/20000],[0, 0, 1, -5423/50000]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j0]]
openravepy.ikfast: generateIkSolver, [[0, 0, 1, 0],[0, 1, 0, 0],[-1, 0, 0, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j1]]
openravepy.ikfast: generateIkSolver, [[0, 1, 0, 71/1000],[0, 0, 1, 14381/100000],[1, 0, 0, 8669/100000]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 1, j2]]
openravepy.ikfast: generateIkSolver, [[0, 0, 1, 0],[1, 0, 0, 0],[0, 1, 0, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j3), -sin(j3), 0, 0],[sin(j3), cos(j3), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[0, 0, -1, 0],[0, 1, 0, 0],[1, 0, 0, -77/4000]]
openravepy.ikfast: generateIkSolver, [[cos(j4), -sin(j4), 0, 0],[sin(j4), cos(j4), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, 2/25],[0, 0, 1, 221/5000]]
openravepy.ikfast: solveFullIK_TranslationDirection5D, ikfast translation direction 5d: [j0, j1, j2, j3, j4]
openravepy.ikfast: solveLiWoernleHiller, attempting li/woernle/hiller general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'need exactly 8 equations of one variable'
openravepy.ikfast: solveLiWoernleHiller, attempting li/woernle/hiller general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables, has 2'
openravepy.ikfast: solveKohliOsvatic, attempting kohli/osvatic general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables'
openravepy.ikfast: solveKohliOsvatic, attempting kohli/osvatic general ik method
openravepy.ikfast: solveFullIK_TranslationDirection5D, 'Kohli/Osvatic method requires 3 unknown variables'
Traceback (most recent call last):
  File "/usr/local/bin/openrave.py", line 126, in <module>
    database.run(args=args)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 1025, in run
    InverseKinematicsModel.RunFromParser(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 998, in RunFromParser
    model = DatabaseGenerator.RunFromParser(Model=Model,parser=parser,robotatts=robotatts,args=args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/__init__.py", line 252, in RunFromParser
    model.autogenerate(options=options)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 599, in autogenerate
    self.generate(iktype=iktype,freejoints=freejoints,precision=precision,forceikbuild=forceikbuild,outputlang=outputlang,ipython=ipython)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 807, in generate
    chaintree = solver.generateIkSolver(baselink=baselink,eelink=eelink,freeindices=self.freeindices,solvefn=solvefn)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 1640, in generateIkSolver
    chaintree = solvefn(self, LinksRaw, jointvars, isolvejointvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 650, in solveFullIK_TranslationDirection5D
    return self.ikfast.IKFastSolver.solveFullIK_TranslationDirection5D(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 2042, in solveFullIK_TranslationDirection5D
    raise self.CannotSolveError('raghavan roth equations too complex')
openravepy.ikfast.CannotSolveError: 'raghavan roth equations too complex'
Loading...