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
The following snippet causes segmentation fault on the third iteration.
foriinrange(10):
print(i)
# Need at least 2 kinbodies in the environmentbox0=RaveCreateKinBody(env, ''); box0.InitFromBoxes(array([[0, 0, 0, 0.1, 0.1, 0.1]])); box0.SetName('box0'); env.Add(box0)
box1=RaveCreateKinBody(env, ''); box1.InitFromBoxes(array([[0, 0, 0, 0.1, 0.1, 0.1]])); box1.SetName('box1'); env.Add(box1)
env.CheckCollision(box0)
env.Reset()
In Environment::Reset function, we iterate through all kinbodies in the environment, set their _environmentBodyIndex to 0, Destroy them, and then call _CallBodyCallbacks. However, as Environment::_InvalidateKinBodyFromEnvBodyIndex is not called, the function RemoveKinBody of the collision checker is never called and the cache is not invalidated.
Maybe there are at least a couple of ways to fix this:
change from manually destroying kinbodies and calling their registered callbacks to just calling this->Remove(pbody) instead.
add a call to _InvalidateKinBodyFromEnvBodyIndex in the for-loop that iterates through _vecbodies.
The following snippet causes segmentation fault on the third iteration.
In
Environment::Reset
function, we iterate through all kinbodies in the environment, set their_environmentBodyIndex
to 0,Destroy
them, and then call_CallBodyCallbacks
. However, asEnvironment::_InvalidateKinBodyFromEnvBodyIndex
is not called, the functionRemoveKinBody
of the collision checker is never called and the cache is not invalidated.Maybe there are at least a couple of ways to fix this:
this->Remove(pbody)
instead._InvalidateKinBodyFromEnvBodyIndex
in the for-loop that iterates through_vecbodies
.cc @kanbouchou
The text was updated successfully, but these errors were encountered: