You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromopenravepy.databasesimportconvexdecompositioncdmodel=convexdecomposition.ConvexDecompositionModel(robot=robot, padding=0.010)
ifnotcdmodel.load():
cdmodel.generate(padding=0.010)
linkGeometryGroups= [None] *len(robot.GetLinks())
forilink, linkinenumerate(robot.GetLinks()):
linkGeometryGroups[link.GetIndex()] =cdmodel.GetGeometryInfosFromLink(ilink)
robot.SetLinkGroupGeometries('padding=0.010', linkGeometryGroups)
robot.SetLinkGeometriesFromGroup('padding=0.010') # time consumping part
When we call SetLinkGeometriesFromGroup with a geometry group name (padding=0.010 in this case), _ResetCurrentGeometryCallback in _vlistRegisteredCallbacks is called. There are following 2 problems and it is time consuming.
_ResetCurrentGeometryCallback calls InitKinBody, and InitKinBody always computes FCL geometries from scratch.
_ResetCurrentGeometryCallback is called for all the geometry groups (padding=0.010 and self in this case) even though we have specified a certain geometry group name (padding=0.010 in this case)
In my case, roughly speaking, 1 call of InitKinBody takes 50ms and SetLinkGeometriesFromGroup takes 100ms = 50ms x 2 (= len(['padding=0.010', 'self'])) in total.
For 1, using a cache will help, but it is prone to bugs.
For 2, we should call _ResetCurrentGeometryCallback once for the specified geometry group name.
Here is a snippet to reproduce this issue.
When we call
SetLinkGeometriesFromGroup
with a geometry group name (padding=0.010
in this case),_ResetCurrentGeometryCallback
in_vlistRegisteredCallbacks
is called. There are following 2 problems and it is time consuming._ResetCurrentGeometryCallback
callsInitKinBody
, andInitKinBody
always computes FCL geometries from scratch._ResetCurrentGeometryCallback
is called for all the geometry groups (padding=0.010
andself
in this case) even though we have specified a certain geometry group name (padding=0.010
in this case)In my case, roughly speaking, 1 call of
InitKinBody
takes 50ms andSetLinkGeometriesFromGroup
takes 100ms = 50ms x 2 (=len(['padding=0.010', 'self'])
) in total.For 1, using a cache will help, but it is prone to bugs.
For 2, we should call
_ResetCurrentGeometryCallback
once for the specified geometry group name.cc @kanbouchou @yoshikikanemoto
The text was updated successfully, but these errors were encountered: