Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed exception when using OSC scenarios without environment init #656

Merged
merged 1 commit into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion srunner/scenarioconfigs/openscenario_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
10 changes: 8 additions & 2 deletions srunner/tools/openscenario_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down