Page 1 of 1

How to change the position of objects randomly at every simulation step

Posted: 02 Jul 2018, 12:08
by ravi
I have a Kinect sensor in a home environment inside V-REP. I want to change the position of objects such as dining chair and sofa kept inside the room.

After changing the position of objects, I plan to capture the view using the Kinect sensor. So I want to change the positions before every simulation step.

Should I add non-thread child script with each object such as dining chair, sofa, etc. and then inside the (sim_call_type==sim_childscriptcall_actuation) block, change the positions?

I am afraid as I am not sure the execution order of these non-thread child scripts and I don't want to change the position while Kinect is capturing the view.

Please download the scene from shared DropBox link-
https://www.dropbox.com/s/cx0pdhmdsregen9/home.ttt?dl=0

Re: How to change the position of objects randomly at every simulation step

Posted: 04 Jul 2018, 06:17
by coppelia
Hello,

why don't you put all that code inside of your kinect script? In the init section of that script, retrieve the handles of the furniture models. Then, in the actuation section of that script, modify the position of the furniture.

Cheers

Re: How to change the position of objects randomly at every simulation step

Posted: 04 Jul 2018, 10:46
by ravi
coppelia wrote: 04 Jul 2018, 06:17 Why don't you put all that code inside of your Kinect script?
makes sense... thank you very much.