Python API CARLA Simulator Not Working

Hello,

I can simulate any Scenic scenario through the command line, but when I use the Python API function i.e. simulator.simulate(scene) I get the following error: scenic.core.simulators.SimulationCreationError: Unable to spawn object unnamed car

This happens for every scenario I try, even the examples. I am on the latest version of Scenic.

The same error does not appear when I go back and install Scenic 2.1. (I do use the “use2DMap” parameter for both versions).

Any help would be appreciated, thank you!

I found the root cause. In the following line, I turn on 2D mode incorrectly.

scenario = scenic.scenarioFromFile('test.scenic', params={'use2DMap': True, "realization":realization})

This bypasses the error message

RuntimeError: 3D maps not supported at this time.(to use 2D maps set global parameter "use2DMap" to True)

that normally appears when you forget to turn on 2D mode. Same thing happens if you add

param use2DMap = True

to the start of the Scenic scenario.

When 2D mode is turned on correctly, i.e.:

scenario = scenic.scenarioFromFile('test.scenic', mode2D=True, params={"realization":realization})

everything works.