Closed cmpute closed 7 months ago
You could try to get a reproducible failing test that runs without Carla by logging all traci commands (https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#generating_a_log_of_all_traci_commands) and then attach this test case.
Thanks for the suggestion! I tried to add the trace logging, but the logging isn't always successful (sometimes Traci will throw an error before anything is written to the trace file).
Here is an example with successful trace output:
And here's the Python stack trace
Traceback (most recent call last):
File "examples/example_carla_with_av.py", line 84, in <module>
sim.run()
File "/home/jacobz/MTL-Simulation-Platform/mtlsp/simulator.py", line 190, in run
self.step()
File "/home/jacobz/MTL-Simulation-Platform/mtlsp/simulator.py", line 153, in step
self.step_pipeline(self, self.ctx)
File "/home/jacobz/MTL-Simulation-Platform/mtlsp/pipeline.py", line 16, in __call__
output = element.executable(*args, **kwargs)
File "/home/jacobz/MTL-Simulation-Platform/mtlsp/simulator.py", line 166, in sumo_step
traci.simulationStep()
File "/home/jacobz/miniconda3/envs/carla/lib/python3.7/site-packages/traci/main.py", line 199, in simulationStep
return connection.check().simulationStep(step)
File "/home/jacobz/miniconda3/envs/carla/lib/python3.7/site-packages/traci/connection.py", line 363, in simulationStep
result = self._sendCmd(tc.CMD_SIMSTEP, None, None, "D", step)
File "/home/jacobz/miniconda3/envs/carla/lib/python3.7/site-packages/traci/connection.py", line 225, in _sendCmd
return self._sendExact()
File "/home/jacobz/miniconda3/envs/carla/lib/python3.7/site-packages/traci/connection.py", line 135, in _sendExact
raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO
I tried the trace commands locally and it does seem to be reproducing the behavior. But I don't know what caused the issue..
sorry, for the ambiguous wording: Having a trace file is a necessary but insufficient condition for replicating the problem. I also need the sumocfg and all files referenced therein (preferably as an attacked zip archive).
I tried to run your example with the Town04 scenario of the current CARLA Release 0.9.15 and it fails because the route "r_1" you used for your vehicle "hero" does not exist. Since the scenario did not seem to change from 0.9.14, the problem might be in you code. Please add more information in another comment if you fixed this and problems persist. Although I have to warn you that it is hard for us to reproduce CARLA problems because of https://github.com/carla-simulator/carla/issues/6484
I could also not reproduce the libsumo segfault.
In short, I met various crashes and segfaults when I co-simulated SUMO with Carla. I have no idea what the possible reasons behind these errors and any suggestions on is how to troubleshoot this is appreciated!
System info:
Unfortunately, I can't provide the code to reproduce this and it's hard to get a minimal reproducing example. I'm using the Traci / libsumo API with the Carla Python API to write the cosimulation code, however the simulation always crashes after a few simulation steps with one of my co-simulation settings.
If I use libsumo, the simulation always ends with segfaults. Below are an example of the segfault stack trace from gdb:
Libsumo Segfault Stacktrace
```log #0 0x00007fffe03a7382 in std::string toStringIf I use traci, the simulation will ends with various errors, stacktrace examples are listed below:
Traci Error Stacktrace 1
```log Traceback (most recent call last): File "/home/jacobz/MTL-Simulation-Platform/mtlsp/physics/carla/sensors.py", line 97, in store_data sm.push_variable(self._agent.id, self._name, data) File "/home/jacobz/MTL-Simulation-Platform/mtlsp/state_manager.py", line 69, in push_variable Traceback (most recent call last): File "examples/example_carla_with_av.py", line 84, inTraci Error Stacktrace 2
```log Traceback (most recent call last): File "examples/example_carla_with_av.py", line 84, inTraci Error Stacktrace 3
```log Traceback (most recent call last): File "examples/example_carla_with_av.py", line 84, inNote that all these errors happened with the same script and same co-simulation settings. Another thing I found hard to understand was that the script won't crash if I don't add vehicles to SUMO and don't get sensor data from the Carla side (although I'm not sure which one introduces the crash).
Again, any help would be appreciated, thanks in advance!