carla-simulator / scenario_runner

Traffic scenario definition and execution engine
https://carla-scenariorunner.readthedocs.io/en/latest/
MIT License
519 stars 358 forks source link

OSC2ScenarioConfiguration' object has no attribute 'route' #1088

Closed zwhaa closed 3 months ago

zwhaa commented 3 months ago

When I run the python scenario_runner.py --openscenario2 srunner/examples/xxx.osc command, no matter which file I run, I will report an error:OSC2ScenarioConfiguration' object has no attribute 'route' 'OSC2ScenarioConfiguration' object has no attribute 'route' No more scenarios .... Exiting

Desktop (please complete the following information):

glopezdiest commented 3 months ago

Hey @zwhaa please check if you have this line in your code, as it is the one that fixes the issue. It was part of the 0.9.15 release though, so not sure why you wouldn't have it.

Feel free to reopen the issue if it is still happening

zwhaa commented 3 months ago

Hey @glopezdiest This line of code is included in my code. I tried to add the following content to the osc2scenariounconfiguration. py file according to the error prompt, and it ran without any problems. self.route = False self.trigger_points = [] self.friction = []

But now I have encountered another problem. Some OSC files (such as wait. osc \ emit. oscwait_elapsed. osc) encountered an error while running: AttributeError:'OSC2Scenario' object has no attribute 'event' Then I tried to add the 'event' attribute according to the prompt, but it was not successful. Please help me answer.