Running Multiple Headless Simulation

Typically: "How do I... ", "How can I... " questions
Post Reply
major_david
Posts: 14
Joined: 16 Jun 2023, 18:44

Running Multiple Headless Simulation

Post by major_david »

Hi fellow,

I'm trying to train a reinforcement learning agent, and the simulation environment was constructed using CoppeliaSim. To accelerate the training process, I want to run multiple environments simultaneously. I have already figured out how to run several CS and establish a connection using ZMQRemoteAPI using different port numbers, like this:
in terminal: ./coppeliaSim.sh -GzmqRemoteApi.rpcPort=23001 -h
in Python script:
client = RemoteAPIClient(host='localhost',port = port)
self.sim = client.getObject('sim')

However, the problem is that after running the second environment, this error message showed up:
[sandboxScript:info] Simulator launched, welcome!
[Connectivity >> WebSocket remote API server@addOnScript:error] 124: in sim.genericFunctionHandler: Address already in use
stack traceback:
[C]: in function 'simWS.start'
[string "Connectivity >> WebSocket remote API server@a..."]:124: in function 'sysCall_init'

Since the info is shown as an error, I thought I should not ignore it.
Is there any solution?

Thanks

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

Re: Running Multiple Headless Simulation

Post by fferri »

If you don't use the WebSockets Remote API nor the WebSockets (simWS) plugin, you can safely ignore that error.

You can pass command line option -GwsRemoteApi.autoStart=false to disable the WebSockets Remote API Server if you don't want to see that error.

Post Reply