Page 1 of 1

V-REP from command line, press the "hare" button

Posted: 14 Aug 2019, 17:17
by RobAtLab
On linux I can run V-REP from the command line using things like

../vrep.sh -g10 '/home/full/file/path/file.ttt' -s10000 -q

to launch a sim which will run until 10 seconds of sim time has elapsed which quits V-REP when the sim ends, with a parameter of 10 fed in as first argument. But once running I typically find I need to press the "hare" button beside the tortoise to speed up the sim. I can't run these sims fully headless as certain elements of the GUI are still needed. Is there a command line argument which will let me "click the hare button" a number of times as the sim begins?

Thank you

Re: V-REP from command line, press the "hare" button

Posted: 15 Aug 2019, 05:55
by coppelia
Hello,

no, you can't. The only thing you can do is use an add-on script (for instance)that does this for you. You need to have set a custom time step in the simulation dialog of that scene. Then, before simulation starts, then set your time step with:

Code: Select all

sim.setFloatParameter(sim.floatparam_simulation_time_step,yourTimeStep)
Cheers

Re: V-REP from command line, press the "hare" button

Posted: 19 Aug 2019, 09:58
by fferri
You can use the command-line option -aXXX which loads and runs an additional add-on script specified via its filename (XXX).

In the add-on script you set the sim.floatparam_simulation_time_step parameter, as suggested by coppelia.

Re: V-REP from command line, press the "hare" button

Posted: 21 Aug 2019, 20:33
by RobAtLab
The floatparam option isn't much help to me. I'm not looking to decrease the number of simulation ticks per second of sim time, I just want to do what the "hare" button does and only render a frame on a smaller fraction of those ticks.

Re: V-REP from command line, press the "hare" button

Posted: 22 Aug 2019, 05:51
by coppelia
Have a look at this:

Code: Select all

sim.setInt32Parameter(sim.intparam_speedmodifier,x)
where x can be a positive value between 1 and 6 (to skip display frames), or a negative value between -1 and -3 (to reduce the simulation time step). Make sure to execute this only when simulation is running for this to have an effect.

Cheers

Re: V-REP from command line, press the "hare" button

Posted: 24 Aug 2019, 16:26
by RobAtLab
Thanks, that sim.setInt32Parameter(sim.intparam_speedmodifier,x) tip is exactly what I needed.