Quantcast

Move to 3D-cartesian position with ik-fast-solver-cpp-File

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

Move to 3D-cartesian position with ik-fast-solver-cpp-File

Lena
Hello everyone,

I wrote a Program (c++) for the youBot based on the youBot API. At the moment it is just possible to move the 5 different joints by changing the angles, so for example:

desiredJointAngle.angle = -0.0158 * radian;
myYouBotManipulator→getArmJoint(3).setData(desiredJointAngle);

Now I want to move the youbot to a cartestian 3D position with its endeffector (inverse kinematics) with IK Fast. It is important, that the solution is without ROS.

By now, I've created a solver-file (like this ones here: http://openrave.org/docs/latest_stable/ikfast/kuka-youbot/) and want to use it as .cpp-File in my existing Project. So I included it, as well as the header file (share/openrave-X.Y/python/ikfast.h.) in my project.
What are the next steps if I want to calculate now the axis-values to move the youbot with its end effector to the cartesian Position, e.g. (1,-1,0)?  It is not clear to me which functions I have to call with which parameters.
I just want to get five values for the axis as a result, which I can then pass to the existing function to move the different axis by the calculated angles.

Best wishes,
Lena
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Move to 3D-cartesian position with ik-fast-solver-cpp-File

Praveen
Hi ,

Did you try this example ?

it shows on how to use the TranslationDirection3d and how to set the value input.
Hope you are using 4th and 5th joint as free indices.

Best Regards
Praveen


On Sunday, July 20, 2014 9:21 AM, Lena [via OpenRAVE Users List] <[hidden email]> wrote:


Hello everyone,

I wrote a Program (c++) for the youBot based on the youBot API. At the moment it is just possible to move the 5 different joints by changing the angles, so for example:

desiredJointAngle.angle = -0.0158 * radian;
myYouBotManipulator→getArmJoint(3).setData(desiredJointAngle);

Now I want to move the youbot to a cartestian 3D position with its endeffector (inverse kinematics) with IK Fast. It is important, that the solution is without ROS.

By now, I've created a solver-file (like this ones here: http://openrave.org/docs/latest_stable/ikfast/kuka-youbot/) and want to use it as .cpp-File in my existing Project. So I included it, as well as the header file (share/openrave-X.Y/python/ikfast.h.) in my project.
What are the next steps if I want to calculate now the axis-values to move the youbot with its end effector to the cartesian Position, e.g. (1,-1,0)?  It is not clear to me which functions I have to call with which parameters.
I just want to get five values for the axis as a result, which I can then pass to the existing function to move the different axis by the calculated angles.

Best wishes,
Lena


If you reply to this email, your message will be added to the discussion below:
http://openrave-users-list.185357.n3.nabble.com/Move-to-3D-cartesian-position-with-ik-fast-solver-cpp-File-tp4027078.html
To start a new topic under OpenRAVE Users List, email [hidden email]
To unsubscribe from OpenRAVE Users List, click here.
NAML


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Move to 3D-cartesian position with ik-fast-solver-cpp-File

Lena
Hi Praveen,

thanks for your fast reply. When I try to run the example in the console, I get the following error I (ubuntu 14.04):

openrave.py --example tutorial_iktranslation
openravepy.databases.inversekinematics: generate, Generating inverse kinematics for manip arm: Translation3D [0, 1, 2] (this might take up to 10 min)
openravepy.databases.inversekinematics: generate, creating ik file /home/lena/.openrave/kinematics.ab9d03903279e44bc692e896791bcd05/ikfast62.Translation3D.0_1_2_f3_4.cpp
/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py:1123: RuntimeWarning: invalid value encountered in divide
  axisangle /= angle
openravepy.ikfast: forwardKinematicsChain, moved translation Matrix([[0, 0, 3/25]]) to right end
openravepy.ikfast: forwardKinematicsChain, moved translation Matrix([[0, 0, -133/2000]]) to left end
openravepy.ikfast: forwardKinematicsChain, moved translation on intersecting axis Matrix([[0, 0, 0]]) to left
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, -1, 0, 0],[0, 0, -1, 403/2000]]
openravepy.ikfast: generateIkSolver, [[cos(j0), -sin(j0), 0, 0],[sin(j0), cos(j0), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 0, -1, 0],[0, 1, 0, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j1), -sin(j1), 0, 0],[sin(j1), cos(j1), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 1, 0, -19/100],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j2), -sin(j2), 0, 0],[sin(j2), cos(j2), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, -1, 0, -139/1000],[0, 0, -1, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j3), -sin(j3), 0, 0],[sin(j3), cos(j3), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[1, 0, 0, 0],[0, 0, 1, 0],[0, -1, 0, 0]]
openravepy.ikfast: generateIkSolver, [[cos(j4), -sin(j4), 0, 0],[sin(j4), cos(j4), 0, 0],[0, 0, 1, 0]]
openravepy.ikfast: generateIkSolver, [[0, 0, 1, 0],[1, 0, 0, 0],[0, 1, 0, 183/1000]]
Traceback (most recent call last):
  File "/usr/local/bin/openrave.py", line 149, in <module>
    example.run(args=args)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/openravepy_ext.py", line 64, in newfn
    return fn(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/examples/tutorial_iktranslation.py", line 111, in run
    OpenRAVEGlobalArguments.parseAndCreateThreadedUser(options,main,defaultviewer=True)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/misc.py", line 237, in parseAndCreateThreadedUser
    SetViewerUserThread(env,viewername,lambda: userfn(env,options))
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/misc.py", line 99, in SetViewerUserThread
    userfn()
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/misc.py", line 237, in <lambda>
    SetViewerUserThread(env,viewername,lambda: userfn(env,options))
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/examples/tutorial_iktranslation.py", line 54, in main
    ikmodel.autogenerate()
  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 656, in solveFullIK_Translation3D
    return self.ikfast.IKFastSolver.solveFullIK_Translation3D(*args,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 1817, in solveFullIK_Translation3D
    return self._solveFullIK_Translation3D(LinksRaw,jointvars,isolvejointvars,basepos)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 1823, in _solveFullIK_Translation3D
    self.testconsistentvalues = self.computeConsistentValues(jointvars,Tfinal,numsolutions=4)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 1687, in computeConsistentValues
    psubs.append((s,v.subs(psubs)))
  File "/usr/lib/python2.7/dist-packages/sympy/core/basic.py", line 949, in subs
    rv = rv._subs(old, new, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sympy/core/cache.py", line 93, in wrapper
    r = func(*args, **kw_args)
  File "/usr/lib/python2.7/dist-packages/sympy/core/basic.py", line 1063, in _subs
    rv = fallback(self, old, new)
  File "/usr/lib/python2.7/dist-packages/sympy/core/basic.py", line 1035, in fallback
    arg = arg._subs(old, new, **hints)
  File "/usr/lib/python2.7/dist-packages/sympy/core/cache.py", line 93, in wrapper
    r = func(*args, **kw_args)
  File "/usr/lib/python2.7/dist-packages/sympy/core/basic.py", line 1061, in _subs
    rv = self._eval_subs(old, new)
  File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py", line 301, in Pow_eval_subs
    return Pow(self.base._eval_subs(old, new), self.exp._eval_subs(old, new))
  File "/usr/lib/python2.7/dist-packages/sympy/core/cache.py", line 93, in wrapper
    r = func(*args, **kw_args)
  File "/usr/lib/python2.7/dist-packages/sympy/core/power.py", line 94, in __new__
    b = _sympify(b)
  File "/usr/lib/python2.7/dist-packages/sympy/core/sympify.py", line 346, in _sympify
    return sympify(a, strict=True)
  File "/usr/lib/python2.7/dist-packages/sympy/core/sympify.py", line 239, in sympify
    raise SympifyError(a)
sympy.core.sympify.SympifyError: SympifyError: None
[qtcoinrave.cpp:80] SoQt releasing all memory
Coin debug: socontexthandler_cleanup(): 140 context-bound resources not free'd before exit.


Other examples like 'tutorial_ik5d' work. Can I also use this one as an orientation for my task?

Best wishes & thanks,
Lena
Loading...