Closed jgvictores closed 4 years ago
This issue is becoming increasingly necessary (e.g. https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/99).
This is the reachability of Teo's right arm with the original model:
To know if it's considering the joint limits, I've tried to remove all the<limitsdeg>
tags along the teo_rightArm.kinbody.xml
file, but when I generate the reachability again, it shows the same result...
@rsantos88 Looks great, thanks!
Yes, the command line used is:
openrave.py --database kinematicreachability --robot=/home/teo/repos/teo-openrave-models/openrave/teo/teo.robot.xml --numthreads=4 --manipname=rightArm
This will take some time to generate the reachability... you've to wait...
Then, it will create some files in /home/user/.openrave/
. When the process finishes, you can see the result writing the same line adding show
parameter:
openrave.py --database kinematicreachability --robot=/home/teo/repos/teo-openrave-models/openrave/teo/teo.robot.xml --numthreads=4 --manipname=rightArm --show
Remember that you need to install mayavi2 if you don't have it installed .
Changed the "circular" joints to false, the reachability result is... max reachability: 0.91666666666666663 changes to: 0.069444444444444448
Great job! Could you commit the updated model?
It seems like an improvement. Would this model work with teoSim
etc?
The limits works well apparently. However, when you exceed the limits in teoSim, openrave warns to you with a message like this: [kinbody.cpp:1515 SetDOFValues] dof 4 value is not in limits 1.566438e+00<1.221730e+00
and the model stops respecting the limit configured in the xml, but if you want to know the actual position, it returns the extraimited position value.
This problem is referenced at [YarpOpenraveControlboard] could get limits from openrave] issue.
Even so, @jgvictores do you want to update the model with this changes?
The changes are done in (b1db54994f409bb04bdb5cd845c8d370cc501add)
I'm not a big fan of duplicate files, but stranded branches and open issues do not help either. I'm strongly considering having both versions with different names on develop
.
@rsantos88 Do you think you could create 2 more manipulators? Something like fullRightArm
and fullLeftArm
that include the trunk (initially, including all joint limits).
Ok @jgvictores , this is the visual result after calculate the reachability with the corrections of (#4) issue:
Here you have other nice top view:
I've added these two other manipulators in a different branch. If you want, we can merge it with develop
branch.
I attach here the database generated this weekend with the inverse reachability (rightArm + trunk):
robot.4a0cf68d3eba8fe6aa3e92f28fa3c9ed.zip
I append this updated info: openravepy.databases.kinematicreachability: show, max reachability: 0.1388888888888889
I understand it just involves a few extra lines in teo.robot.xml
. It would be nice to see these changes in develop
(not the full .zip though).
lol.. it's not the changes of teo.robot.xml
. It's just the inverse-reachability database generated through the new manipulator rightArm_trunk
. I've upload this database with the porpouse of see the results if you want without doing this process (you can read more here). You can also generate database but it takes to much time ;)
Ok, done it (#7)
Great, thanks! I haven't deleted the branch, in case there was anything you were still working on. Feel free to delete as required!
Ok, it's already deleted :)
I want to find a utility to this database, so I am trying first to follow the inverse reachability tutorial but I've too many problems. I've written my issue here, so if you know how to solve it I'll be very grateful :)
I'll close this issue. , Currently, i am learning and using this database generator to generate a optimized and stable analytic inverse kinematics solvers for rightArmTrunk
and leftArmTrunk
and load them when we use a TEO model for OpenRave
Could you point to the corresponding repositories, code, models?
Reopening.
Will close after adding:
Ok, I've done the script here
It creates the database reachability correctly but it breaks and doesn't show the graphic result with this error:
2018-04-26 16:57:51,145 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r1Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,167 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r2Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,180 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r5dummy with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,195 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r5Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,203 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r6dummy with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,222 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r6Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,272 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r1Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,293 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r2Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,307 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r5dummy with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,322 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r5Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,331 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r6dummy with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
2018-04-26 16:57:51,348 openrave [WARN] [fclspace.h:248 FCLSpace::KinBodyInfoPtr fclrave::FCLSpace::InitKinBody] Initializing link teoSim/r6Man with 0 geometries (env 1) (userdatakey fclcollision0x1e99ce0)
Set for kinematic reachability of: trunkAndRightArm. Change the above code line for trunkAndLeftArm, etc...
openravepy.databases.inversekinematics: GetDefaultIndices, found 3-intersection centered on index 5
openravepy.databases.inversekinematics: GetDefaultIndices, found 3-intersection centered on index 7
Could load existing kinematicreachability of trunkAndRightArm, not generating!
openravepy.databases.kinematicreachability: show, max reachability: 0.20833333333333334
2018-04-26 16:57:53,737 openrave [INFO] [OpenraveYarpForceEstimator.cpp:419 DestroyPlugin] destroying plugin
2018-04-26 16:57:53,738 openrave [INFO] [OpenraveYarpCoupled.cpp:421 DestroyPlugin] destroying plugin
2018-04-26 16:57:53,738 openrave [INFO] [OpenraveYarpPaintSquares.cpp:396 DestroyPlugin] destroying plugin
2018-04-26 16:57:53,738 openrave [INFO] [OpenraveYarpWorldRpcResponder.cpp:674 DestroyPlugin] destroying plugin
2018-04-26 16:57:53,738 openrave [INFO] [OpenraveYarpPluginLoader.cpp:358 DestroyPlugin] destroying plugin
Traceback (most recent call last):
File "generateReachability.py", line 31, in <module>
reachabilitymodel.show()
File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/databases/kinematicreachability.py", line 378, in show
src = mlab.pipeline.scalar_field(reachability3d)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 1136, in scalar_field
data_source.reset(x=x, y=y, z=z, scalars=s)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 358, in reset
self.set(trait_change_notify=False, **traits)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 113, in set
super(MlabSource, self).set(trait_change_notify, **traits)
File "/usr/lib/python2.7/dist-packages/traits/has_traits.py", line 1946, in trait_set
for name, value in traits.items():
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I've tried to follow the steps of the barrettsegway robot example:
Running the Generator
openrave.py --database kinematicreachability --robot=robots/barrettsegway.robot.xml
Showing the Reachability (uses mayavi2)
openrave.py --database kinematicreachability --robot=robots/barrettsegway.robot.xml --show
but it breaks with the same message:
teo@teo-oliver:~/repos/teo-openrave-models/scripts/python$ openrave.py --database kinematicreachability --robot=robots/barrettsegway.robot.xml --show
2018-04-26 17:01:59,304 openrave [WARN] [openravepy_robot.cpp:874 PyRobotBase::PyManipulatorPtr openravepy::PyRobotBase::SetActiveManipulator] SetActiveManipulator(int) is deprecated
openravepy.databases.inversekinematics: GetDefaultIndices, found 3-intersection centered on index 1
openravepy.databases.inversekinematics: GetDefaultIndices, found 3-intersection centered on index 5
openravepy.databases.kinematicreachability: show, max reachability: 0.91666666666666663
2018-04-26 17:02:01,595 openrave [INFO] [OpenraveYarpForceEstimator.cpp:419 DestroyPlugin] destroying plugin
2018-04-26 17:02:01,595 openrave [INFO] [OpenraveYarpCoupled.cpp:421 DestroyPlugin] destroying plugin
2018-04-26 17:02:01,595 openrave [INFO] [OpenraveYarpPaintSquares.cpp:396 DestroyPlugin] destroying plugin
2018-04-26 17:02:01,595 openrave [INFO] [OpenraveYarpWorldRpcResponder.cpp:674 DestroyPlugin] destroying plugin
2018-04-26 17:02:01,596 openrave [INFO] [OpenraveYarpPluginLoader.cpp:358 DestroyPlugin] destroying plugin
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/kinematicreachability.py", line 440, in run
ReachabilityModel.RunFromParser(Model = lambda robot: ReachabilityModel(robot=robot), parser = ReachabilityModel.CreateOptionParser(), *args,**kwargs)
File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/__init__.py", line 262, in RunFromParser
model.show(options=options)
File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/databases/kinematicreachability.py", line 378, in show
src = mlab.pipeline.scalar_field(reachability3d)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 1136, in scalar_field
data_source.reset(x=x, y=y, z=z, scalars=s)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 358, in reset
self.set(trait_change_notify=False, **traits)
File "/usr/lib/python2.7/dist-packages/mayavi/tools/sources.py", line 113, in set
super(MlabSource, self).set(trait_change_notify, **traits)
File "/usr/lib/python2.7/dist-packages/traits/has_traits.py", line 1946, in trait_set
for name, value in traits.items():
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
May be of relevance for this issue some day: Adopt
May be of relevance for this issue some day: Adopt tag regarding robot grippers (roboticslab-uc3m/openrave-yarp-plugins#86)
I confirm the <joints>
tag (aka <gripperjoints>
afaik) is required for the OpenRAVE grasping module (databases.grasping.GraspingModel(robot, target)
) (else chokes on some kind of gripper release). Recovered for TEO at https://github.com/roboticslab-uc3m/teo-openrave-models/commit/083998bfde1d05dcd96b7626da8a8c3bc8edf719
BTW, added horizontal
label to this issue. Should be split into issues per database generator, at least if we ever want to close it. ^^
Ok, I've done the script here
Rebased and merged at https://github.com/roboticslab-uc3m/teo-openrave-models/commit/1115cc4d78b283bb0b469f6865b7f007838bb8ef [ @rsantos88 thanks! ]
Generated a cool kinematicreachability
linked at https://github.com/roboticslab-uc3m/teo-openrave-models/commit/673cdcada7fc3b43f95af61ec6eaa6c433145b0b, attaching screenshot below.
Some links from https://github.com/roboticslab-uc3m/teo-openrave-models/issues/3#issuecomment-315730184 and also some new ones:
And, yes, as stated above: for (...) kinematicreachability (...) --show
, mayavi
is required. On this PC it was as easy as a sudo -H pip2 install mayavi
(yep, using sudo and not on pip3 yet ftw).
A --show
on inversereachability
seems to place an object at a random position, then show how to reach it.
To sum up what we can see regarding http://openrave.org/docs/latest_stable/databases/#openrave-database-generators as of https://github.com/roboticslab-uc3m/teo-openrave-models/tree/e6401ac329d2c1716c95a6b4795560f7e60d7a40/scripts/bash#scriptsbash:
convexdecomposition
(:heavy_check_mark:): good (we expect to use this for collision again some day)grasping
(:white_check_mark:): good, but not introduced here as we already have https://github.com/roboticslab-uc3m/teo-grasp with cool examples. Note that as part of this study, at https://github.com/roboticslab-uc3m/teo-openrave-models/issues/44 we imported the grasping models into this repository.inversekinematics
(:heavy_check_mark:): good (this is actually IKFast)inversereachability
(:heavy_check_mark:): good (nice viz)kinematicreachability
(:heavy_check_mark:): good (makes us see how limited we are, possibly due to joint limits)linkstatistics
(:question:): only a small .pp
file is generated, and we cannot viz.visibilitymodel
(:x:): the generating script breaksRegarding reachability/manipulability, see also https://github.com/robotology/community/discussions/559.
Think about http://openrave.org/docs/latest_stable/databases/#openrave-database-generators