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

Update osc2_scenario_configuration.py #1040

Merged
merged 2 commits into from
May 3, 2024
Merged

Update osc2_scenario_configuration.py #1040

merged 2 commits into from
May 3, 2024

Conversation

Ylmdrin
Copy link
Contributor

@Ylmdrin Ylmdrin commented Dec 11, 2023

Description

Updated file srunner/scenarioconfigs/osc2_scenario_configuration.py to fix the following error, obtained when running scenario_runner.py with the --openscenario2 parameter and any of the OpenScenario v2 example scenarios in srunner/examples :

Preparing scenario: srunner/examples/*.osc
The scenario cannot be loaded
Traceback (most recent call last):
File "scenario_runner.py", line 400, in _load_and_run_scenario
scenario = OSC2Scenario(world=self.world,
File "scenario_runner/srunner/scenarios/osc2_scenario.py", line 466, in __init__
super(OSC2Scenario, self).__init__(
File "/scenario_runner/srunner/scenarios/basic_scenario.py", line 50, in __init__
self.route_mode = bool(config.route)
AttributeError: 'OSC2ScenarioConfiguration' object has no attribute 'route'
'OSC2ScenarioConfiguration' object has no attribute 'route'
No more scenarios .... Exiting

Added a call to the init method of the super class to OSC2ScenarioConfiguration.

Where has this been tested?

  • Platform(s): Ubuntu 20.04.6 LTS
  • Python version(s): Python 3.8.18
  • Unreal Engine version(s): 4.26
  • CARLA version: 0.9.15

This change is Reviewable

Add super.__init__() to class OSC2ScenarioConfiguration to prevent error "AttributeError: 'OSC2ScenarioConfiguration' object has no attribute 'route'" when running scenario_runner.py with --openscenario2 parameter
@germanros1987
Copy link
Member

@glopezdiest please review.

Copy link
Contributor

@glopezdiest glopezdiest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Ylmdrin)

@glopezdiest
Copy link
Contributor

Agreed, with the introduction of the Leaderboard 2.0, the route_mode was added, which broke OSC scenarios

Copy link
Contributor

@glopezdiest glopezdiest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Ylmdrin)

@glopezdiest glopezdiest merged commit 25db835 into carla-simulator:master May 3, 2024
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants