diff --git a/Docs/CHANGELOG.md b/Docs/CHANGELOG.md index 7af0a88f8..4dfa73da0 100644 --- a/Docs/CHANGELOG.md +++ b/Docs/CHANGELOG.md @@ -13,6 +13,9 @@ ### :rocket: New Features * Added a sensor barrier for the agents to ensure that the simulation waits for them to render their data. * Added an option to produce a machine-readable JSON version of the scenario report. +### :bug: Bug Fixes +* Fixed exception when using OSC scenarios without EnvironmentAction inside Storyboard-Init + ## CARLA ScenarioRunner 0.9.10 ### :rocket: New Features diff --git a/srunner/scenarioconfigs/openscenario_configuration.py b/srunner/scenarioconfigs/openscenario_configuration.py index 6934b0c40..02c118b87 100644 --- a/srunner/scenarioconfigs/openscenario_configuration.py +++ b/srunner/scenarioconfigs/openscenario_configuration.py @@ -220,7 +220,7 @@ def _set_actor_information(self): elif entry.tag == "MiscObject": self._extract_misc_information(entry, rolename, entry, args) else: - self.logger.error( + self.logger.debug( " A CatalogReference specifies a reference that is not an Entity. Skipping...") for vehicle in obj.iter("Vehicle"): diff --git a/srunner/tools/openscenario_parser.py b/srunner/tools/openscenario_parser.py index 6b05cc433..13f60e3f8 100644 --- a/srunner/tools/openscenario_parser.py +++ b/srunner/tools/openscenario_parser.py @@ -269,7 +269,10 @@ def get_friction_from_env_action(xml_tree, catalogs): returns: friction (float) """ - set_environment = next(xml_tree.iter("EnvironmentAction")) + if xml_tree.find("EnvironmentAction") is not None: + set_environment = next(xml_tree.iter("EnvironmentAction")) + else: + return 1.0 if sum(1 for _ in set_environment.iter("Weather")) != 0: environment = set_environment.find("Environment") @@ -298,7 +301,10 @@ def get_weather_from_env_action(xml_tree, catalogs): returns: Weather (srunner.scenariomanager.weather_sim.Weather) """ - set_environment = next(xml_tree.iter("EnvironmentAction")) + if xml_tree.find("EnvironmentAction") is not None: + set_environment = next(xml_tree.iter("EnvironmentAction")) + else: + return Weather(carla.WeatherParameters()) if sum(1 for _ in set_environment.iter("Weather")) != 0: environment = set_environment.find("Environment")