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

Typically: "How do I... ", "How can I... " questions
Post Reply
ravi
Posts: 85
Joined: 24 Oct 2016, 08:00

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

Post by ravi » 02 Jul 2018, 12:08

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

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

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

Post by coppelia » 04 Jul 2018, 06:17

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

ravi
Posts: 85
Joined: 24 Oct 2016, 08:00

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

Post by ravi » 04 Jul 2018, 10:46

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.

Post Reply