urdf to collada changing fixed joint location

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

urdf to collada changing fixed joint location

amatt
I have 2 problems I believe are unrelated.  The first is when I view my collada file in openrave the fixed joints are all expanded (offset) in a way that doesn't exist in my urdf file.  It is as if the joint offset units are interpreted wrong.  I am showing the visualized model in openrave and rviz(urdf).



However, I doubt that causes my main  problem of not being able to solve my robot.  It is an arm on a slide(prismatic axis) on a cart(another prismatic axis) which results in 7 dof.  However, I was just trying to solve from the slide to the end effector in order to simplify the problem.  So solving a 6dof the first joint of which is a prismatic joint after some time resulted in:

  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py", line 34, in from_sympy
    raise CoercionFailed("expected `Rational` object, got %s" % a)
sympy.polys.polyerrors.CoercionFailed: expected `Rational` object, got -oo

I have compiled from the master branch at https://github.com/rdiankov/openrave, because I couldn't get any ppa to work from my Ubuntu Trusty install.  So it is possible that I am missing some dependency that is important.  Is anybody able to point me in the correct direction?  Is my model likely flawed or possibly my openrave install?  Is this python exception a typical exit strategy for the solver if it cannot find a solution?

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: urdf to collada changing fixed joint location

Rosen Diankov
Administrator
Dear Matt,

Most likely the urdf->collada converter has bugs. You can open the file with openrave.py -i and check the joint positions using

[j.GetAnchor() for j in robot.GetJoints()]
[j.GetAxis() for j in robot.GetJoints()]

and see if they are what you expect.

as for the ikfast problem, please make sure you have python sympy version 0.7.1

best,


2016-03-25 3:06 GMT+09:00 Matt Anderson <[hidden email]>:
I have 2 problems I believe are unrelated.  The first is when I view my collada file in openrave the fixed joints are all expanded (offset) in a way that doesn't exist in my urdf file.  It is as if the joint offset units are interpreted wrong.  I am showing the visualized model in openrave and rviz(urdf).



However, I doubt that causes my main  problem of not being able to solve my robot.  It is an arm on a slide(prismatic axis) on a cart(another prismatic axis) which results in 7 dof.  However, I was just trying to solve from the slide to the end effector in order to simplify the problem.  So solving a 6dof the first joint of which is a prismatic joint after some time resulted in:

  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py", line 34, in from_sympy
    raise CoercionFailed("expected `Rational` object, got %s" % a)
sympy.polys.polyerrors.CoercionFailed: expected `Rational` object, got -oo

I have compiled from the master branch at https://github.com/rdiankov/openrave, because I couldn't get any ppa to work from my Ubuntu Trusty install.  So it is possible that I am missing some dependency that is important.  Is anybody able to point me in the correct direction?  Is my model likely flawed or possibly my openrave install?  Is this python exception a typical exit strategy for the solver if it cannot find a solution?

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: urdf to collada changing fixed joint location

amatt
This post was updated on .
Rosen,

Thank you for your reply.  In order to simplify things I converted just
the arm to collada and it looks good.  I changed my sympy version to
0.7.1 as you suggested but I am still getting

File
"/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py",
line 34, in from_sympy
     raise CoercionFailed("expected `Rational` object, got %s" % a)
sympy.polys.polyerrors.CoercionFailed: expected `Rational` object, got -oo

when I try with

python `openrave-config --python-dir`/openravepy/_openravepy_/ikfast.py
--robot=armOnly.rounded.dae --iktype=transform6d --baselink=0 --eelink=6
--savefile=armOnly.cpp

I'm not sure if you guys are interested in fixing specific failure cases
but I will post the collada file at the following link:
https://drive.google.com/open?id=0ByAqfl4quhJdZGxPUDgzQ2g0dVU

I am happy to help if possible, I'm ok with python but I'm afraid you
are way ahead of me with math specific to ik solving.

Thanks,
Matt
On 03/24/2016 10:34 PM, Rosen Diankov wrote:
> Dear Matt,
>
> Most likely the urdf->collada converter has bugs. You can open the
> file with openrave.py -i and check the joint positions using
>
> [j.GetAnchor() for j in robot.GetJoints()]
> [j.GetAxis() for j in robot.GetJoints()]
>
> and see if they are what you expect.
>
> as for the ikfast problem, please make sure you have python sympy
> version 0.7.1
>
> best,
>
>
> 2016-03-25 3:06 GMT+09:00 Matt Anderson <matt.anderson@is4s.com
> <mailto:matt.anderson@is4s.com>>:
>
>     I have 2 problems I believe are unrelated.  The first is when I
>     view my collada file in openrave the fixed joints are all expanded
>     (offset) in a way that doesn't exist in my urdf file.  It is as if
>     the joint offset units are interpreted wrong.  I am showing the
>     visualized model in openrave and rviz(urdf).
>
>
>
>     However, I doubt that causes my main  problem of not being able to
>     solve my robot.  It is an arm on a slide(prismatic axis) on a
>     cart(another prismatic axis) which results in 7 dof.  However, I
>     was just trying to solve from the slide to the end effector in
>     order to simplify the problem.  So solving a 6dof the first joint
>     of which is a prismatic joint after some time resulted in:
>
>       File
>     "/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py",
>     line 34, in from_sympy
>         raise CoercionFailed("expected `Rational` object, got %s" % a)
>     sympy.polys.polyerrors.CoercionFailed: expected `Rational` object,
>     got -oo
>
>     I have compiled from the master branch at
>     https://github.com/rdiankov/openrave, because I couldn't get any
>     ppa to work from my Ubuntu Trusty install.  So it is possible that
>     I am missing some dependency that is important.  Is anybody able
>     to point me in the correct direction?  Is my model likely flawed
>     or possibly my openrave install?  Is this python exception a
>     typical exit strategy for the solver if it cannot find a solution?
>
>     ------------------------------------------------------------------------------
>     Transform Data into Opportunity.
>     Accelerate data analysis in your applications with
>     Intel Data Analytics Acceleration Library.
>     Click to learn more.
>     http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
>     _______________________________________________
>     Openrave-users mailing list
>     Openrave-users@lists.sourceforge.net
>     <mailto:Openrave-users@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/openrave-users
>
>



------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
Openrave-users mailing list
Openrave-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openrave-users


part3.02080409.05070203@is4s.com (62K) <http://openrave-users-list.185357.n3.nabble.com/attachment/4027755/0/part3.02080409.05070203%40is4s.com>
part4.01010907.09060901@is4s.com (200K) <http://openrave-users-list.185357.n3.nabble.com/attachment/4027755/1/part4.01010907.09060901%40is4s.com>
Reply | Threaded
Open this post in threaded view
|

Re: urdf to collada changing fixed joint location

mlautman
HELP!

Did you ever find a solution or workaround for this issue?
I'm seeing the same error while trying to compile the IK for a custom 6dof arm.

Here were my steps in the process:
1. Built a version of the arm in solidworks that minimizes the mesh complexity and exported that to urdf.
2. Changed the package:/// uri's to absolute paths to the STL files using file://<absolute path>.
3. Translated the urdf to collada 1.5 using this command:
`rosrun collada_urdf urdf_to_collada K2armL.urdf K2armL.dae`
4. Added a manipulator
5. Used moveIt to round the floating point precision to a few decimal places using this command
`rosrun moveit_ikfast round_collada_numbers.py K2armL.dae K2armL_2.dae 2`

At this point I am able to load the arm into openrave and see it in the viewer. I am also able to directly move joints using
robot.SetDOFValues(<joint values>).

I am also able to validate that the manipulator is being loaded by running:
manip = robot.SetActiveManipulator('arm')

However, openrave crashes when I run:
openrave.py --database inversekinematics --robot=K2armL_2.dae --manipname=arm --iktype=transform6d

giving me this error :

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 1113, in run
    InverseKinematicsModel.RunFromParser(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 1078, 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 262, in RunFromParser
    model.autogenerate(options=options)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 648, in autogenerate
    self.generate(iktype=iktype,freejoints=freejoints,precision=precision,forceikbuild=forceikbuild,outputlang=outputlang,ipython=ipython,ikfastmaxcasedepth=ikfastmaxcasedepth)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 874, 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 2264, in generateIkSolver
    chaintree = solvefn(self, LinksRaw, jointvars, isolvejointvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/inversekinematics.py", line 741, in solveFullIK_6D
    return self.ikfast.IKFastSolver.solveFullIK_6D(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 2858, in solveFullIK_6D
    tree = self.TestIntersectingAxes(solvejointvars,Links, LinksInv,endbranchtree)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 2946, in TestIntersectingAxes
    return self.solve6DIntersectingAxes(T0links,T1links,transvars,rotvars,solveRotationFirst=solveRotationFirst, endbranchtree=endbranchtree)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 3141, in solve6DIntersectingAxes
    rottree += self.SolveAllEquations(AllEquations,curvars=currotvars,othersolvedvars=othersolvedvars,solsubs=self.freevarsubs[:],endbranchtree=storesolutiontree)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 6667, in SolveAllEquations
    return self.AddSolution(solutions,AllEquations,curvars,othersolvedvars,solsubs,endbranchtree,currentcases=currentcases, currentcasesubs=currentcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 6766, in AddSolution
    return [solution[0].subs(solsubs)]+self.SolveAllEquations(AllEquations,curvars=newvars,othersolvedvars=othersolvedvars+[var],solsubs=solsubs+self.Variable(var).subs,endbranchtree=endbranchtree,currentcases=currentcases, currentcasesubs=currentcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 6527, in SolveAllEquations
    return self.AddSolution(solutions,AllEquations,curvars,othersolvedvars,solsubs,endbranchtree,currentcases=currentcases, currentcasesubs=currentcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 7032, in AddSolution
    nextsolutions[var] = self.SolveAllEquations(AllEquations,curvars=newvars,othersolvedvars=othersolvedvars+[var],solsubs=solsubs+self.Variable(var).subs,endbranchtree=endbranchtree,currentcases=currentcases, currentcasesubs=currentcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 6527, in SolveAllEquations
    return self.AddSolution(solutions,AllEquations,curvars,othersolvedvars,solsubs,endbranchtree,currentcases=currentcases, currentcasesubs=currentcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 7330, in AddSolution
    newtree = self.SolveAllEquations(NewEquationsClean,curvars,othersolvedvars,solsubs,endbranchtree,currentcases=newcases, currentcasesubs=newcasesubs, unknownvars=unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 6510, in SolveAllEquations
    rawsolutions=self.solveSingleVariable(self.sortComplexity(raweqns),curvar,othersolvedvars, unknownvars=curvars+unknownvars)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 8007, in solveSingleVariable
    pc = Poly(eqnew,varsym.cvar)
  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 209, in _from_expr
    return cls._from_dict(rep, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 151, in _from_dict
    domain, rep = construct_domain(rep, opt=opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/constructor.py", line 217, in construct_domain
    result = _construct_composite(coeffs, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/constructor.py", line 169, in _construct_composite
    numer[monom] = ground.from_sympy(coeff)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py", line 34, in from_sympy
    raise CoercionFailed("expected `Rational` object, got %s" % a)
sympy.polys.polyerrors.CoercionFailed: expected `Rational` object, got -oo





Reply | Threaded
Open this post in threaded view
|

Re: urdf to collada changing fixed joint location

amatt
I don't recall exactly what I did, however, the problem is that the code is not checking to see if an expression is valid before asking sympy to make a polynomial out of it.

mlautman wrote
HELP!
giving me this error :

...
    pc = Poly(eqnew,varsym.cvar)
  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 209, in _from_expr
    return cls._from_dict(rep, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/polytools.py", line 151, in _from_dict
    domain, rep = construct_domain(rep, opt=opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/constructor.py", line 217, in construct_domain
    result = _construct_composite(coeffs, opt)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/constructor.py", line 169, in _construct_composite
    numer[monom] = ground.from_sympy(coeff)
  File "/usr/local/lib/python2.7/dist-packages/sympy/polys/domains/pythonrationalfield.py", line 34, in from_sympy
    raise CoercionFailed("expected `Rational` object, got %s" % a)
sympy.polys.polyerrors.CoercionFailed: expected `Rational` object, got -oo
So something about "(eqnew,varsym.cvar)" at this moment in time is not 'Rational' as far as sympy is concearned, so probably it needs a check like if(something valid): Poly(eqnew, varsym.cvar)

Sorry, I never used the kinematics that it generated to see if they were valid so I didn't consider my fix of much use.
Reply | Threaded
Open this post in threaded view
|

Re: urdf to collada changing fixed joint location

mlautman
In reply to this post by mlautman
To follow up on my previous post, it seems that the error was being caused by negative infinity being put through sympy. This was a symptom. The root cause seemed to be related to the way I was building the urdf export in solidworks. Looking at the ur3 urdf I was able to get working in OR, I noticed that in addition to the base link, there was also a world link that was attached to the base joint through a fixed joint. I added that to my solidworks urdf export tree and everything downstream worked out great. I was eventually able to compile the IK using this command.

openrave.py --database inversekinematics --robot=K2armL_2.dae --manipname=arm --iktype=transform6d