Compiler errors when using ikfast?

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

Compiler errors when using ikfast?

Aaron
Hello all,

I've been searching through the achives for an answer, and have ran across many similar problems, but I haven't solved my problem after several hours so I figured I might as well ask for help while I continue seaching.

I'm trying to construct the IK solution for a Kinova Jaco arm. I'll attach a 2D drawing and the robot description xml

jaco.robot.xml

JACO_Dimensions_TF.png

When I run "openrave.py --example tutorial-iksolutions --scene=data\jacos.env.xml"
It seems that IKfast will finish finding a solution, but when it tries to write the cpp code it fails with the following error:

......snip.........

openravepy.ikfast: addSolution, checkforzero too big (235): -571258827*cj4**2*cj
5**2*r00*r11/400000000 + 571258827*cj4**2*cj5**2*r01*r10/400000000 + 32633664742
5415929*cj4**2*cj5*r01*r12/160000000000000000 - 326336647425415929*cj4**2*cj5*r0
2*r11/160000000000000000 - 571258827*cj4**2*r00*r11*sj5**2/400000000 + 326336647
425415929*cj4**2*r00*r12*sj5/160000000000000000 + 571258827*cj4**2*r01*r10*sj5**
2/400000000 - 326336647425415929*cj4**2*r02*r10*sj5/160000000000000000 + 5712588
27*cj4*cj5**2*r00*r11/400000000 - 571258827*cj4*cj5**2*r01*r10/400000000 + cj4*c
j5*r01*r12 - cj4*cj5*r02*r11 + 571258827*cj4*r00*r11*sj5**2/400000000 + cj4*r00*
r12*sj5 - 571258827*cj4*r01*r10*sj5**2/400000000 - cj4*r02*r10*sj5 - 571258827*c
j5**2*r00*r11*sj4**2/400000000 + 571258827*cj5**2*r01*r10*sj4**2/400000000 + 486
336647425415929**(1/2)*cj5*r00*r12*sj4/400000000 + 326336647425415929*cj5*r01*r1
2*sj4**2/160000000000000000 - 486336647425415929**(1/2)*cj5*r02*r10*sj4/40000000
0 - 326336647425415929*cj5*r02*r11*sj4**2/160000000000000000 - 571258827*r00*r11
*sj4**2*sj5**2/400000000 + 326336647425415929*r00*r12*sj4**2*sj5/160000000000000
000 + 571258827*r01*r10*sj4**2*sj5**2/400000000 - 486336647425415929**(1/2)*r01*
r12*sj4*sj5/400000000 - 326336647425415929*r02*r10*sj4**2*sj5/160000000000000000
 + 486336647425415929**(1/2)*r02*r11*sj4*sj5/400000000
openravepy.ikfast: writeIkSolver, generating cpp code...
openravepy.databases.inversekinematics: getcompiler, default compiler v 9.0 the
same version as openrave compiler v 10.000000, look for a different compiler
openravepy.databases.inversekinematics: generate, command '"C:\Program Files\Mic
rosoft Visual Studio 10.0\VC\BIN\link.exe"' failed with exit status 1181
openravepy.databases.inversekinematics: generate, linking again with None... (MS
VC bug?)
Traceback (most recent call last):
  File "C:\Program Files\OpenRAVE-0.8.2\bin\openrave.py", line 149, in <module>
    example.run(args=args)
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\openravepy_ext.py", line 56, in newfn
    return fn(*args,**kwargs)
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\examples\tutorial_iksolutions.py", line 143, in run
    OpenRAVEGlobalArguments.parseAndCreateThreadedUser(options,main,defaultviewe
r=True)
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\misc.py", line 237, in parseAndCreateThreadedUser
    SetViewerUserThread(env,viewername,lambda: userfn(env,options))
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\misc.py", line 99, in SetViewerUserThread
    userfn()
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\misc.py", line 237, in <lambda>
    SetViewerUserThread(env,viewername,lambda: userfn(env,options))
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\examples\tutorial_iksolutions.py", line 92, in main
    ikmodel.autogenerate()
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\databases\inversekinematics.py", line 510, in autogenerate
    self.generate(iktype=iktype,freejoints=freejoints,precision=precision,forcei
kbuild=forceikbuild,outputlang=outputlang,ipython=ipython)
  File "C:\Program Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
_\databases\inversekinematics.py", line 764, in generate
    compiler.link_shared_object(objectfiles,output_filename=output_filename, lib
raries=libraries)
  File "C:\Python26\lib\distutils\ccompiler.py", line 769, in link_shared_object

    extra_preargs, extra_postargs, build_temp, target_lang)
  File "C:\Python26\lib\distutils\msvc9compiler.py", line 647, in link
    raise LinkError(msg)
distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 1
0.0\VC\BIN\link.exe"' failed with exit status 1120
QObject::killTimers: timers cannot be stopped from another thread


I'm using Windows XP, openrave-0.8.2-win32-vc100-setup.exe, I have MSVS 2010 and 2008 installed.
I don't have Lapack installed, not sure if I need it or not.

Any help would be appreciated.

Thanks,
Aaron



Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Rosen Diankov
Administrator
aaron,

if the IK CPP got generated, try compiling it yourself in VS2010 and
see what problems there are. My guess is that LAPACK is needed since
the kinematics are so complex.

if you manage to compile it manually, make sure you rename it to the
same DLL file as outputted with the "--getfilename" command.

by the way, are the jaco WRL files available freely? can we put this
robot in the openrave database?

rosen,


2013/5/10 Aaron <[hidden email]>:

> Hello all,
>
> I've been searching through the achives for an answer, and have ran across
> many similar problems, but I haven't solved my problem after several hours
> so I figured I might as well ask for help while I continue seaching.
>
> I'm trying to construct the IK solution for a Kinova Jaco arm. I'll attach a
> 2D drawing and the robot description xml
>
> jaco.robot.xml
> <http://openrave-users-list.185357.n3.nabble.com/file/n4026357/jaco.robot.xml>
>
> JACO_Dimensions_TF.png
> <http://openrave-users-list.185357.n3.nabble.com/file/n4026357/JACO_Dimensions_TF.png>
>
> When I run "openrave.py --example tutorial-iksolutions
> --scene=data\jacos.env.xml"
> It seems that IKfast will finish finding a solution, but when it tries to
> write the cpp code it fails with the following error:
>
> ......snip.........
>
> *openravepy.ikfast: addSolution, checkforzero too big (235):
> -571258827*cj4**2*cj
> 5**2*r00*r11/400000000 + 571258827*cj4**2*cj5**2*r01*r10/400000000 +
> 32633664742
> 5415929*cj4**2*cj5*r01*r12/160000000000000000 -
> 326336647425415929*cj4**2*cj5*r0
> 2*r11/160000000000000000 - 571258827*cj4**2*r00*r11*sj5**2/400000000 +
> 326336647
> 425415929*cj4**2*r00*r12*sj5/160000000000000000 +
> 571258827*cj4**2*r01*r10*sj5**
> 2/400000000 - 326336647425415929*cj4**2*r02*r10*sj5/160000000000000000 +
> 5712588
> 27*cj4*cj5**2*r00*r11/400000000 - 571258827*cj4*cj5**2*r01*r10/400000000 +
> cj4*c
> j5*r01*r12 - cj4*cj5*r02*r11 + 571258827*cj4*r00*r11*sj5**2/400000000 +
> cj4*r00*
> r12*sj5 - 571258827*cj4*r01*r10*sj5**2/400000000 - cj4*r02*r10*sj5 -
> 571258827*c
> j5**2*r00*r11*sj4**2/400000000 + 571258827*cj5**2*r01*r10*sj4**2/400000000 +
> 486
> 336647425415929**(1/2)*cj5*r00*r12*sj4/400000000 +
> 326336647425415929*cj5*r01*r1
> 2*sj4**2/160000000000000000 -
> 486336647425415929**(1/2)*cj5*r02*r10*sj4/40000000
> 0 - 326336647425415929*cj5*r02*r11*sj4**2/160000000000000000 -
> 571258827*r00*r11
> *sj4**2*sj5**2/400000000 +
> 326336647425415929*r00*r12*sj4**2*sj5/160000000000000
> 000 + 571258827*r01*r10*sj4**2*sj5**2/400000000 -
> 486336647425415929**(1/2)*r01*
> r12*sj4*sj5/400000000 -
> 326336647425415929*r02*r10*sj4**2*sj5/160000000000000000
>  + 486336647425415929**(1/2)*r02*r11*sj4*sj5/400000000
> openravepy.ikfast: writeIkSolver, generating cpp code...
> openravepy.databases.inversekinematics: getcompiler, default compiler v 9.0
> the
> same version as openrave compiler v 10.000000, look for a different compiler
> openravepy.databases.inversekinematics: generate, command '"C:\Program
> Files\Mic
> rosoft Visual Studio 10.0\VC\BIN\link.exe"' failed with exit status 1181
> openravepy.databases.inversekinematics: generate, linking again with None...
> (MS
> VC bug?)
> Traceback (most recent call last):
>   File "C:\Program Files\OpenRAVE-0.8.2\bin\openrave.py", line 149, in
> <module>
>     example.run(args=args)
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\openravepy_ext.py", line 56, in newfn
>     return fn(*args,**kwargs)
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\examples\tutorial_iksolutions.py", line 143, in run
>
> OpenRAVEGlobalArguments.parseAndCreateThreadedUser(options,main,defaultviewe
> r=True)
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\misc.py", line 237, in parseAndCreateThreadedUser
>     SetViewerUserThread(env,viewername,lambda: userfn(env,options))
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\misc.py", line 99, in SetViewerUserThread
>     userfn()
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\misc.py", line 237, in <lambda>
>     SetViewerUserThread(env,viewername,lambda: userfn(env,options))
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\examples\tutorial_iksolutions.py", line 92, in main
>     ikmodel.autogenerate()
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\databases\inversekinematics.py", line 510, in autogenerate
>
> self.generate(iktype=iktype,freejoints=freejoints,precision=precision,forcei
> kbuild=forceikbuild,outputlang=outputlang,ipython=ipython)
>   File "C:\Program
> Files\OpenRAVE-0.8.2\Lib\site-packages\openravepy\_openravepy
> _\databases\inversekinematics.py", line 764, in generate
>     compiler.link_shared_object(objectfiles,output_filename=output_filename,
> lib
> raries=libraries)
>   File "C:\Python26\lib\distutils\ccompiler.py", line 769, in
> link_shared_object
>
>     extra_preargs, extra_postargs, build_temp, target_lang)
>   File "C:\Python26\lib\distutils\msvc9compiler.py", line 647, in link
>     raise LinkError(msg)
> distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual
> Studio 1
> 0.0\VC\BIN\link.exe"' failed with exit status 1120
> QObject::killTimers: timers cannot be stopped from another thread*
>
> I'm using Windows XP, openrave-0.8.2-win32-vc100-setup.exe, I have MSVS 2010
> and 2008 installed.
> I don't have Lapack installed, not sure if I need it or not.
>
> Any help would be appreciated.
>
> Thanks,
> Aaron
>
>
>
>
>
>
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/Compiler-errors-when-using-ikfast-tp4026357.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
This post was updated on .
Thanks for the reply,

ikfast created 4 files:

ikfast61.Transform6D.0_1_2_3_4_5.cpp
ikfast61.Transform6D.x86.0_1_2_3_4_5.exp
ikfast61.Transform6D.x86.0_1_2_3_4_5.lib
ikfast.h

I started a new VS project, included the .h and .cpp. Then added the .lib to "Additional Dependencies". I'm guessing that is all I would need to do to compile it. When I try to build the solution, I get three LNK2019 unresolved external symbol errors. They are for dgeev, dgetrs, and dgetrf.

After quick google searches, those all look like they have something to do with LAPACK, so I will go ahead and try to get LAPACK built. However their instruction page looks pretty daunting (http://icl.cs.utk.edu/lapack-for-windows/lapack/index.html#libraries). Do I need to build dynamic or static? Can I get by using LAPACKE and just download the provided VS solution? Will that create a dll I can link to when trying to build my ikfast generated code? Are there instructions somewhere that cover LAPACK with OpenRAVE?

As for the JACO files. They are not public, the company gave me some .STLs and I had to tweak them a bit. I'll talk to the company about me posting them. If they don't mind, there will be a little bit of work needed on them.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
So that seems to have worked. I used the LAPACKE MSVC solution and that built liblapack.lib and liblapack.dll. Next I started a new VS project to build a dll and included ikfast61.Transform6D.0_1_2_3_4_5.cpp, and linked to liblapack.lib and ikfast61.Transform6D.x86.0_1_2_3_4_5.lib as well as linking the directory that holds ikfast.h. And this built just fine which produced a brand new dll.

Based on Rosen's input, I'm thinking I name this dll as ikfast61.Transform6D.x86.0_1_2_3_4_5.dll because that is the output of openrave.py --database inversekinematics --robot=robots\jaco.robot.xml --getfilename.

But now I'm not sure what I need to do from here. If I try
openrave.py --database inversekinematics --robot=robots\jaco.robot.xml --usecached --iktests=100
It just starts and tries to compile the ikfast61.Transform6D.0_1_2_3_4_5.cpp again, but I don't want it to because I already did that.

How do I use my new dll?

Thanks,
Aaron


Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
If I try to link the solver to my robot description using
<iksolver>ikfast61.Transform6D.x86.0_1_2_3_4_5.dll</iksolver>

I get the following error when I load the robot

[xmlreaders-core.cpp:2386] failed to create iksolver C:\..snip..\ikfast61.Transform6D.x86.0_1_2_3_4_5.dll
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Rosen Diankov
Administrator
can you try specifying the full path including the drive letter in the
<iksolver> tag?

if inversekinematics still complains, try opening your robot with
"openrave.py -i" and check if
robot.GetActiveManipulator().GetIkSolver() is initialized. if it is,
you can use IK!

rosen,

2013/5/11 Aaron <[hidden email]>:

> If I try to link the solver to my robot description using
> <iksolver>ikfast61.Transform6D.x86.0_1_2_3_4_5.dll</iksolver>
>
> I get the following error when I load the robot
>
> [xmlreaders-core.cpp:2386] failed to create iksolver
> C:\..snip..\ikfast61.Transform6D.x86.0_1_2_3_4_5.dll
>
>
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/Compiler-errors-when-using-ikfast-tp4026357p4026374.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
After changing my robot.xml to have:

<iksolver>C:\Documents and Settings\Test\.openrave\kinematics.4e08bad5a94727637e539e064a7a74d1\ikfast61.Transform6D.x86.0_1_2_3_4_5.dll</iksolver>

And running "openrave.py -i data\jacos.env.xml" I still get [xmlreaders-core.cpp:2386] failed to create iksolver C:\Documents and Settings\Test\.openrave\kinematics.4e08bad5a94727637e539e064a7a74d1\ikfast61.Transform6D.x86.0_1_2_3_4_5.dll

And then of course robot.GetActiveManipulator().GetIkSolver() doesn't produce any output.

Umm, did you notice that the word "bad" appears in the hash part of the folder name that ikfast produced? Is there some intellegence in the hash generation that is trying to tell me something? Or is this just a sick twist of irony? :)

Eitherway, That error message is the same error that gets thrown when I put jibberish in the <iksolver> tag, so I'm still not sure if my .dll is bad because openrave seems to be acting like it can't find it. I'm assuming my .dll is good because everything compiled without any complaints.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
Is there a way I can check to see if this dll is good? I'm stumped. I went through the whole process of creating the IK solution (dll) for a puma arm just to make sure I didn't have anything setup wrong, but I didn't have any problems at all. It has to do with my arm and the way ikfast solves for it, but the fact that I don't get compiler errors is confusing me.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
Oh, hold the front door. I spoke to soon. When I said I went through the process of building the ik dll for the puma, I was letting openrave do the compiling to create the dll.

This morning, I deleted the openrave generated dll, and replaced it will a dll (with the same name) that I made using MSVC 2010. And now when I try to use the puma ik, I see the same errors I've been seeing with my jaco arm (xmlreaders-core.cpp:2386: failed to create iksolver...). I've also built the dll using MSVC 2008 with the same results.

So now I've narrowed down my problem a little. I think when openrave creates a dll, it is doing something that I am not doing when I create mine.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Rosen Diankov
Administrator
we define

IKFAST_CLIBRARY
IKFAST_NO_MAIN

when compiling. perhaps you are missing them?

2013/5/14 Aaron <[hidden email]>:

> Oh, hold the front door. I spoke to soon. When I said I went through the
> process of building the ik dll for the puma, I was letting openrave do the
> compiling to create the dll.
>
> This morning, I deleted the openrave generated dll, and replaced it will a
> dll (with the same name) that I made using MSVC 2010. And now when I try to
> use the puma ik, I see the same errors I've been seeing with my jaco arm
> (xmlreaders-core.cpp:2386: failed to create iksolver...). I've also built
> the dll using MSVC 2008 with the same results.
>
> So now I've narrowed down my problem a little. I think when openrave creates
> a dll, it is doing something that I am not doing when I create mine.
>
>
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/Compiler-errors-when-using-ikfast-tp4026357p4026410.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
I have not defined those, I'll try that.

I see that is what is done here: http://openrave.org/docs/0.8.0/_modules/openravepy/databases/inversekinematics/

By this line
 objectfiles = compiler.compile(sources=[platformsourcefilename],macros=[('IKFAST_CLIBRARY',1),('IKFAST_NO_MAIN',1)],extra_postargs=compile_flags,output_dir=output_dir)
                   
Do you know off the top of your head how to set these in MSVC (I'm use to cmake)?
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
If I add /DIKFAST_NO_MAIN /DIKFAST_CLIBRARY to C/C++ -> Command Line, I am able to build a working dll for the puma and am able to use it with the examples.

If I try the same with my arm, nothing changes, I still get the same error. I do notice though, that when ikfast generates the puma files, it includes a .pp file. But I don't get a .pp file for my robot.
Reply | Threaded
Open this post in threaded view
|

Re: Compiler errors when using ikfast?

Aaron
Just to follow up. I tried doing the ik for the jaco on ubuntu and it worked flawlessly because lapack links by default. I do need to go back and get it working on windows for another project. I'm guess there are still compiler setting that openrave does that I'm not setting in VS, so I'm going to try looking at inversekinematics.py for hints.