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

Typically: "How do I... ", "How can I... " questions
Post Reply
RobAtLab
Posts: 68
Joined: 10 Jan 2018, 17:49

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

Post by RobAtLab » 14 Aug 2019, 17:17

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

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

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

Post by coppelia » 15 Aug 2019, 05:55

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

fferri
Posts: 350
Joined: 09 Sep 2013, 19:28

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

Post by fferri » 19 Aug 2019, 09:58

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.

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

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

Post by RobAtLab » 21 Aug 2019, 20:33

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.

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

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

Post by coppelia » 22 Aug 2019, 05:51

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

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

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

Post by RobAtLab » 24 Aug 2019, 16:26

Thanks, that sim.setInt32Parameter(sim.intparam_speedmodifier,x) tip is exactly what I needed.

Post Reply