Running Multiple Headless Simulation
Posted: 01 Mar 2024, 02:52
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
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