I am trying using Webots in combination with stable-baselines3 for reeinforcment-learning purpose. I tried using Webot with multiple instances, but connecting the controller to a specific one doesn't work. It mostly connects to the newest one. I wrote a runtime.ini giving the WEBOT_PID manually looking like
[environment variables]
WEBOTS_PID=1492
and even tried setting the environment variable in my Python code like
os.environ["WEBOTS_PID"] = str(1492)
self.simulation = WebotsInterface()
it doesn't connect to desired Instance.