Specifying the remoteApiPort using the command line

Requests or suggestions for new features
Post Reply
Pierre
Posts: 10
Joined: 24 Nov 2014, 16:46

Specifying the remoteApiPort using the command line

Post by Pierre »

Hi everyone,

Is there a way to directly specify the port for the remote Api connection as an argument of the command line or by specifying a specific config file ?

I know you can directly modify the remoteApiConnections.txt file, but as I'm using v-rep on a cluster it means that I have to submit a job which launches v-rep on a specific port, wait for v-rep to actually be launched, submit another job, etc...

This makes the job submission process way harder and slower.

Thanks in advance for your help!

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

Re: Specifying the remoteApiPort using the command line

Post by coppelia »

Hello Pierre,

if you want flexibility in remote API ports, then you will have to manually start a temporary remote API server service. The documentation is not exactly correct, since you can also start a temporary remote API server service from an add-on or customization script too (which run also when simulation is not running).
There is just a small issue: when simulation stops, then all temporary remote API server services will be stopped (which shouldn't be the case for add-ons and customization scripts). This has been corrected for next release. As a work-around, you could restart a temporary remote API server service upon simulation end.

To pass command-line arguments to V-REP, use:

Code: Select all

./vrep.sh -gargument1 -gargument2 -gargument3
Then from an embedded script you could retrieve those arguments with:

Code: Select all

argument1=simGetStringParameter(sim_stringparam_app_arg1)
argument2=simGetStringParameter(sim_stringparam_app_arg2)
argument3=simGetStringParameter(sim_stringparam_app_arg3)
...
Cheers

Post Reply