Closed jgvictores closed 6 years ago
This is an already known behaviour with convexdecomposition, the problem is that when the convex decomposition model (cdmdel) is generated, this cdmodel is saved in the openrave database as a function of it's geometry. If some padding is done in the cdmodel, the geometry changes and therefore its hash. Since the "load" function always tries to load the not padded cdmodel, this will result in the program generating a new convexdecomposition model each time.
This behaviour has also been reported in the openrave forum.
Until its not fixed, a possible solution is to manually rename the padded model (robot_padding.pp) to have the same name as the not padded one (robot.pp).
Or at least slow... Some pointers:
openrave.py --database convexdecomposition --robot=/usr/local/share/teo-openrave-models/contexts/openrave/teo/teo.robot.xml --padding=0.02 --show --getfilename
Returns:
/home/yo/.openrave/robot.29d30d6ed41a0d1254635867fcebcd97/convexdecomposition_0.020.pp
More refs, freshly moved into this repo: #84
From what was commented at https://github.com/roboticslab-uc3m/openrave-yarp-plugins/issues/83#issuecomment-372999608 and with @RaulFdzbis in person, should be a very simple issue related to path names. Possibly due to https://github.com/rdiankov/openrave/issues/118, OpenRAVE does not look for the padded version.
No handlers could be found for logger "openravepy.databases.convexdecomposition"
For the record, this happens upon cdmodel.load() returning False.
For the record, cdmodel.generate(padding=0.02)
takes about 2 minutes, and uses 2 of a 4 core machine (1 constant, switching the other).
cdmodel.save()
takes 5 s, generates the 60 MB model robot.29d30d6ed41a0d1254635867fcebcd97/convexdecomposition_0.020.pp
(note the same hash, this is good).
cdmodel.setrobot()
takes another 10-15 s.
cdmodel.show()
possibly stuck in while True.
...but can be interrupted in a python console via ctrl-c. :-)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/databases/convexdecomposition.py", line 563, in show
time.sleep(0.5)
KeyboardInterrupt
Fixed at 756a3a3d57bc4e781e6dc13814ace3abca44d776. The most important change was to specify the padding in the constructor, before load(), as here. Minimal working example (see how paddings must match):
import openravepy
from openravepy import *
RaveInitialize()
env=Environment()
env.SetViewer('qtcoin')
env.Load('/usr/local/share/teo-openrave-models/contexts/openrave/teo/teo.robot.xml')
# Convex Decomposition
teo_robot = env.GetRobots()[0]
cdmodel = databases.convexdecomposition.ConvexDecompositionModel(teo_robot, padding=0.02) # Else defaults to zero padding
if not cdmodel.load():
# If not already in the database. Generate:
print 'ConvexDecomposition not found, generating...'
cdmodel.generate(padding=0.02) # Else defaults to 0.005 padding
print 'ConvexDecomposition generated, saving...'
cdmodel.save()
print 'Finished saving'
print 'Setting robot...'
cdmodel.setrobot()
print 'Finish setrobot'
print 'Starting visualization of the convexdecomposition model'
cdmodel.show() # blocking for now
Note how padding
must be the same (and defaults are different).
Times are reduced from 2:25 to 0:25.
Merged into develop
at 94a8b29b7ab38dfd469ee0567ee1640fec3143fe.
Collision model must be re-generated each run, namely these lines.
Possible hint at runtime: