Launching V-Rep from Java
Posted: 25 Oct 2014, 01:43
Hi
I am trying to launch V-Rep from a java application using the ProcessBuilder class in java like this:
Which basically starts a new process and appends the stdout and stderr of the opened simulator to a file called "log". The simulator opens as expected but, after the java program is done and the simulator is closed the log file looks like this (I have removed some plugins):
As opposed to when I open it in a linux terminal:
Is the remote API plugin waiting for some signal to continue with the loading process? I know the remote API server is running because I can control the simulator from java, so is there a way to tell the simulator that the remote Api has been loaded for it to continue initializing?
Also can this affect the performance of the simulator? This is because I have noticed that simulations take more time to complete if I launch the simulator from java compared to when I launch it from a terminal so I am trying to find the reason for this.
Thanks!
I am trying to launch V-Rep from a java application using the ProcessBuilder class in java like this:
Code: Select all
try {
ProcessBuilder qq=new ProcessBuilder("./vrep.sh","-h");
qq.directory(new File("/home/.../V-REP_PRO_EDU_V3_1_3_64_Linux/"));
File log = new File("log");
qq.redirectErrorStream(true);
qq.redirectOutput(Redirect.appendTo(log));
Process p = qq.start();
} catch(Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}
Code: Select all
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'Dynamics': loading...
Plugin 'Dynamics': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Code: Select all
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
Simulator launched.
Plugin 'Dynamics': loading...
Plugin 'Dynamics': load succeeded.
Plugin 'RemoteApi': loading...
Starting a remote API server on port 19997
Plugin 'RemoteApi': load succeeded.
Using the internal 'MeshCalc' functionality.
Using the 'Dynamics' plugin.
Using the internal 'PathPlanning' functionality.
Also can this affect the performance of the simulator? This is because I have noticed that simulations take more time to complete if I launch the simulator from java compared to when I launch it from a terminal so I am trying to find the reason for this.
Thanks!