PJLab-ADG / LimSim

LimSim & LimSim++: Integrated traffic and autonomous driving simulators with (M)LLM support
https://pjlab-adg.github.io/LimSim/
GNU General Public License v3.0
415 stars 35 forks source link

some errors happened when using co-simulation with CARLA 0.9.13 #3

Closed gah07123 closed 1 year ago

gah07123 commented 1 year ago

I can normally use LimSim, but when I co-simulate with CARLA, something wrong happens. Here are my environment and log. Thanks. ----environment---- Windows 10 python 3.9 SUMO 1.18.0 CARLA 0.9.13 ----environment----

----run_synchronization.py Log---- INFO: Connection to sumo server. Host: 127.0.0.1 Port: 8813 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds File "run_synchronization.py", line 319, in synchronization_loop(arguments) File "run_synchronization.py", line 246, in synchronization_loop synchronization.tick() File "run_synchronization.py", line 106, in tick self.sumo.tick() File "D:\Pycharm\PytorchProjects\CARLA\Sumo\sumo_integration\sumo_simulation.py", line 505, in tick traci.simulationStep() connection.check().simulationStep(step) File "D:\SUMO\tools\traci\connection.py", line 368, in simulationStep result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step) File "D:\SUMO\tools\traci\connection.py", line 231, in _sendCmd return self._sendExact() File "D:\SUMO\tools\traci\connection.py", line 137, in _sendExact raise FatalTraCIError("Connection closed by SUMO.") traci.exceptions.FatalTraCIError: Connection closed by SUMO. (pytorch) PS D:\Pycharm\PytorchProjects\CARLA\Sumo> python run_synchronization.py examples/Town05.sumocfg --sumo-host 127.0.0.1 --sumo-port 8813 INFO: Connection to sumo server. Host: 127.0.0.1 Port: 8813 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds Could not connect to TraCI server at 127.0.0.1:8813 [WinError 10061] 由于目标计算机积极拒绝,无法连接。 Retrying in 1 seconds

INFO: Found the required file in cache! Carla/Maps/TM/Town05.bin INFO: Cleaning synchronization Traceback (most recent call last): File "run_synchronization.py", line 319, in synchronization_loop(arguments) File "run_synchronization.py", line 246, in synchronization_loop synchronization.tick() File "run_synchronization.py", line 106, in tick self.sumo.tick() File "D:\Pycharm\PytorchProjects\CARLA\Sumo\sumo_integration\sumo_simulation.py", line 505, in tick traci.simulationStep() File "D:\SUMO\tools\traci\main.py", line 198, in simulationStep connection.check().simulationStep(step) File "D:\SUMO\tools\traci\connection.py", line 368, in simulationStep result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step) File "D:\SUMO\tools\traci\connection.py", line 231, in _sendCmd return self._sendExact() File "D:\SUMO\tools\traci\connection.py", line 137, in _sendExact raise FatalTraCIError("Connection closed by SUMO.") traci.exceptions.FatalTraCIError: Connection closed by SUMO.

----ModelExample.py Log---- Model initialized at 18:39:47.106. Network building finished at 18:39:49.246. Network information commited at 18:39:49.272. Error: Answered with error to command 0x03: Order '1' is already taken. Traceback (most recent call last): File "D:\Pycharm\PytorchProjects\LimSim-master\ModelExample.py", line 83, in run_model(net_file, rou_file, ego_veh_id="4", carla_cosim=True) File "D:\Pycharm\PytorchProjects\LimSim-master\ModelExample.py", line 62, in run_model model.start() File "D:\Pycharm\PytorchProjects\LimSim-master\simModel\egoTracking\model.py", line 302, in start traci.setOrder(1) File "D:\SUMO\tools\traci\main.py", line 255, in setOrder return connection.check().setOrder(order) File "D:\SUMO\tools\traci\connection.py", line 389, in setOrder self._sendCmd(tc.CMD_SETORDER, None, None, "I", order) File "D:\SUMO\tools\traci\connection.py", line 231, in _sendCmd return self._sendExact() File "D:\SUMO\tools\traci\connection.py", line 144, in _sendExact raise TraCIException(err, prefix[1], _RESULTS[prefix[2]]) traci.exceptions.TraCIException: Order '1' is already taken.

Fdarco commented 1 year ago

We apologize for some oversights in writing the documentation. When running run_synchronization.py, you also need to specify --client-order 2. The correct command is:

python3 run_synchronization.py examples/Town05.sumocfg --sumo-host 127.0.0.1 --sumo-port 8813 --client-order 2

At present, the documentation has been updated. Please visit run CARLA installation Co-simulation to run your co-simulation.

zijinoier commented 1 year ago

Also if you're interested, please join our user community on WeChat:

gah07123 commented 1 year ago

image thank you for your replys, it can run normally on Windows 10