Collision object being removed

Report crashes, strange behaviour, or apparent bugs
Post Reply
JoakimMagnusson

Collision object being removed

Post 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?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Collision object being removed

Post 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

JoakimMagnusson

Re: Collision object being removed

Post 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?

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Collision object being removed

Post 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

Post Reply