Page 1 of 1

Collision object being removed

Posted: 12 Jul 2018, 14:58
by JoakimMagnusson
Hi,
I'm trying to do collision detection in V-rep. I'm creating a new collision object but when I start the simulation with the remote API the collision object is removed. This behavior does not occur when starting the simulation from the V-rep GUI. Any Idea on what could be the problem?

Re: Collision object being removed

Posted: 16 Jul 2018, 06:30
by coppelia
Hello,

that sounds strange. Is the object erased or is that object still visible in the scene hierarchy? Is the object dynamic or static?

Cheers

Re: Collision object being removed

Posted: 02 Aug 2018, 10:15
by JoakimMagnusson
The objects are still visible in the scene hierarchy. But I figured out the problem. I'm doing reinforcement learning and each iteration I reload my robot model. I guess there's no way of having a collision object checking a model that's being reloaded several times during the simulation?

Re: Collision object being removed

Posted: 03 Aug 2018, 07:02
by coppelia
You have following possibility:

define a collection that contains all objects built on top of, say, a dummy. Then, each time you load the model, attach the model to the dummy (sim.setObjectParent). Then the model will automatically be part of the collection.

Now, you can define a collision object between that collection, and the environment.

Cheers