Collision object being removed

Report crashes, strange behaviour, or apparent bugs
Post Reply
JoakimMagnusson
Posts: 11
Joined: 09 May 2018, 10:31

Collision object being removed

Post by JoakimMagnusson » 12 Jul 2018, 14:58

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: 6766
Joined: 14 Dec 2012, 00:25

Re: Collision object being removed

Post by coppelia » 16 Jul 2018, 06:30

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
Posts: 11
Joined: 09 May 2018, 10:31

Re: Collision object being removed

Post by JoakimMagnusson » 02 Aug 2018, 10:15

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: 6766
Joined: 14 Dec 2012, 00:25

Re: Collision object being removed

Post by coppelia » 03 Aug 2018, 07:02

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