Dekai21 / Multi_Agent_Intersection

GNU General Public License v3.0
28 stars 5 forks source link

'Connection' object has no attribute '_socket' in Co-Simulation between SUMO and CARLA #5

Open ShenZC25 opened 9 months ago

ShenZC25 commented 9 months ago

Thank you very much for your excellent work. I encountered the following problems when using SUMO and CARLA for joint simulation (it seems that there were similar problems in previous issues, but I still don't know how to solve them)

Traceback (most recent call last): File "run_synchronization.py", line 396, in synchronization_loop(arguments) File "run_synchronization.py", line 325, in synchronization_loop synchronization.tick() File "run_synchronization.py", line 117, in tick self.sumo.tick() File "F:\CARLA_0.9.10\WindowsNoEditor\Co-Simulation\Sumo\sumo_integration\sumo_simulation.py", line 532, in tick traci.simulationStep() File "F:\Program Files\Eclipse\Sumo\tools\traci\main.py", line 207, in simulationStep return _connections[""].simulationStep(step) File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 323, in simulationStep result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step) File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 185, in _sendCmd return self._sendExact() File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 83, in _sendExact if self._socket is None: AttributeError: 'Connection' object has no attribute '_socket'

This seems to be that I have too many cars colliding at the intersection, and then some cars can't be removed. If it is caused by this reason, please tell me how to solve it (for example, how to remove the vehicle), otherwise please help me to confirm the problem.

Besides, there are some other problems. That is to say, when I was conducting joint simulation, I found that the simulation time of SUMO and CARLA was out of sync. Can you tell me why? thank you Snipaste_2023-11-30_22-25-15

As the picture shows, SUMO has crashed, but CARLA hasn't, but my understanding is that they should be synchronized?

Looking forward to your answer, thank you.

ShenZC25 commented 9 months ago

Thank you very much for your excellent work. I encountered the following problems when using SUMO and CARLA for joint simulation (it seems that there were similar problems in previous issues, but I still don't know how to solve them)

Traceback (most recent call last): File "run_synchronization.py", line 396, in synchronization_loop(arguments) File "run_synchronization.py", line 325, in synchronization_loop synchronization.tick() File "run_synchronization.py", line 117, in tick self.sumo.tick() File "F:\CARLA_0.9.10\WindowsNoEditor\Co-Simulation\Sumo\sumo_integration\sumo_simulation.py", line 532, in tick traci.simulationStep() File "F:\Program Files\Eclipse\Sumo\tools\traci\main.py", line 207, in simulationStep return _connections[""].simulationStep(step) File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 323, in simulationStep result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step) File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 185, in _sendCmd return self._sendExact() File "F:\Program Files\Eclipse\Sumo\tools\traci\connection.py", line 83, in _sendExact if self._socket is None: AttributeError: 'Connection' object has no attribute '_socket'

This seems to be that I have too many cars colliding at the intersection, and then some cars can't be removed. If it is caused by this reason, please tell me how to solve it (for example, how to remove the vehicle), otherwise please help me to confirm the problem.

Besides, there are some other problems. That is to say, when I was conducting joint simulation, I found that the simulation time of SUMO and CARLA was out of sync. Can you tell me why? thank you Snipaste_2023-11-30_22-25-15

As the picture shows, SUMO has crashed, but CARLA hasn't, but my understanding is that they should be synchronized?

Looking forward to your answer, thank you.

In addition, I also encountered the following problems when conducting joint simulation: WARNING: cannot parse georeference: ''. Using default values.

It seems to be carla's problem, and it has already been solved (it can be found in carla's github issuses). But I don't know why I still encounter this problem. The complete error information is as follows:

(mvn) F:\CARLA_0.9.10\WindowsNoEditor\Co-Simulation\Sumo>python run_synchronization.py sumo_files/sumocfg/09-11-15-30-00400-0.09-val_10m_35m-7.sumocfg --tls-manager carla --sumo-gui --step-length 0.1 --pretrained-weights F:\PycharmProjects\MVI\trained_params\sumo_1130\model_gnn_np_sumo_1130_e3_10760.pth INFO: Starting new sumo server... INFO: Remember to press the play button to start the simulation WARNING: cannot parse georeference: ''. Using default values. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla0' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla1' is not known. Error! Vehicle 'carla2' is not known. Error! Vehicle 'carla2' is not known. Error! Vehicle 'carla2' is not known. Error! Vehicle 'carla2' is not known.