Tutorial on creating automatic V-REP simulations for statistical studies

Requests or suggestions for new features
Post Reply
RobAtLab
Posts: 42
Joined: 10 Jan 2018, 17:49

Tutorial on creating automatic V-REP simulations for statistical studies

Post by RobAtLab » 18 Jul 2018, 14:45

I need to run a large number of V-REP simulations for similar scenarios but with some starting parameters slightly varied for each. I need to do this both in cases of randomly varied (within defined limits) parameters and other cases where I will need to try a simulation with a certain parameter, then raise or lower it a little, then repeat. From these simulations I need to collect certain pieces of data and log them to a text file for later analysis.

Are there any tutorials or guides for setting up this kind of thing, especially in regards to running it on a cluster computer for which there is no GUI environment present at all? Is there any example overall script into which a user can drop in robots and other objects with the relevant robot controller child scripts on them and state somewhere what they want to log and how? My hope is to perform these kind of statistics gathering simulations after developing robot objects and their controller child scripts by using V-REP in the normal way and so I would already have my objects all set up and would need only to copy and paste them from the scenes where I have been developing them into a statistical simulation V-REP scene which could handle automatically generating new starting positions/orientations and editing some specific variuables within child scripts for a series of N runs each set to last either a certain amnount of simulated time or set to terminate when a certain condition is achieved.

I have read about this sort of thing being done with V-REP but have not been able to find any guide on how.

Thanks

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

Re: Tutorial on creating automatic V-REP simulations for statistical studies

Post by coppelia » 20 Jul 2018, 08:55

Hello,

you have several possibilities. The best would probably to use an add-on script: you can launch a specific add-on script at V-REP launch via the -b command line argument. From within that script, load a scene, set various parameters (such as object positions, etc.), run a simulation (with the newest V-REP you can collect data in each simulation step), stop simulation, write data to a file, close the scene, and start all over by loading the scene again, etc.

Cheers

RobAtLab
Posts: 42
Joined: 10 Jan 2018, 17:49

Re: Tutorial on creating automatic V-REP simulations for statistical studies

Post by RobAtLab » 20 Jul 2018, 17:06

Are you effectively saying to write a bash (I'm on a linux PC) script to start V-REP, run my sim, then close V-REP then start V-REP up again with new parameters fed in? Wouldn't that be quite slow, V-REP always takes several seconds between me pressing "enter" at the command line after ./vrep.sh and the program being ready to do anything? Is there a way to get V-REP itself to close and load neew scenes automatically? Or just stop a sim, edit some parameters, then run the same sim again but with parameters changed (for example altering the value of a particular variale which several child scripts each use)?

Thanks

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

Re: Tutorial on creating automatic V-REP simulations for statistical studies

Post by coppelia » 24 Jul 2018, 13:12

You have both possibilities. But your add-on script can trigger start/stop/restart/load/close/etc. without the need to restart V-REP.

Cheers

Post Reply