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

Custom road map crashes Scenic #274

Open
3 tasks done
dgenin opened this issue Jun 2, 2024 · 1 comment · May be fixed by #193
Open
3 tasks done

Custom road map crashes Scenic #274

dgenin opened this issue Jun 2, 2024 · 1 comment · May be fixed by #193
Assignees
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working

Comments

@dgenin
Copy link

dgenin commented Jun 2, 2024

System Details

Python 3.10.12
Scenic 3.0.0b2
Ubuntu 22.04

Detailed Description

When running newtonian driving simulator with a custom road created in Matlab 2023a Driving Scenario Designer app it crashes with

$ scenic -b --2d -S --model scenic.simulators.newtonian.driving_model search_and_track.scenic 
Beginning scenario construction...
pygame 2.5.2 (SDL 2.28.2, Python 3.10.12)
Hello from the pygame community. https://www.pygame.org/contribute.html
  Parsing OpenDRIVE file...
  Computing road geometry... (this may take a while)
Traceback (most recent call last):
  File "/home/genindi1/projects/ANSR/venv/ANSR/bin/scenic", line 5, in <module>
    from scenic.__main__ import dummy
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/__main__.py", line 195, in <module>
    scenario = errors.callBeginningScenicTrace(
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/core/errors.py", line 282, in callBeginningScenicTrace
    return func()
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/__main__.py", line 196, in <lambda>
    lambda: translator.scenarioFromFile(
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 142, in scenarioFromFile
    return _scenarioFromStream(
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 172, in _scenarioFromStream
    compileStream(stream, namespace, compileOptions, filename)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 321, in compileStream
    executeCodeIn(code, namespace)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 560, in executeCodeIn
    exec(code, namespace)
  File "/home/genindi1/other_projects/verified_driving/search_and_track.scenic", line 1, in <module>
    param map = localPath('matlab_road4.xodr')
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/veneer.py", line 930, in model
    module = importlib.import_module(modelName)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 398, in exec_module
    code, pythonSource = compileStream(
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 321, in compileStream
    executeCodeIn(code, namespace)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 560, in executeCodeIn
    exec(code, namespace)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/simulators/newtonian/driving_model.scenic", line 13, in <module>
    from scenic.domains.driving.model import *  # includes basic actions and behaviors
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 398, in exec_module
    code, pythonSource = compileStream(
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 321, in compileStream
    executeCodeIn(code, namespace)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/syntax/translator.py", line 560, in executeCodeIn
    exec(code, namespace)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/domains/driving/model.scenic", line 49, in <module>
    network : Network = Network.fromFile(globalParameters.map, **globalParameters.map_options)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/domains/driving/roads.py", line 1071, in fromFile
    network = handlers[ext](path, **kwargs)
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/domains/driving/roads.py", line 1112, in fromOpenDrive
    network = road_map.toScenicNetwork()
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/formats/opendrive/xodr_parser.py", line 1901, in toScenicNetwork
    return roadDomain.Network(
  File "<attrs generated init scenic.domains.driving.roads.Network>", line 26, in __init__
    self.__attrs_post_init__()
  File "/home/genindi1/projects/ANSR/Scenic/src/scenic/domains/driving/roads.py", line 933, in __attrs_post_init__
    assert self.drivableRegion.containsRegion(
AssertionError

Steps To Reproduce

scenic -b --2d -S --model scenic.simulators.newtonian.driving_model search_and_track.scenic

The files required to reproduce the bug are in the attached zip file.
road_bug.zip

Issue Submission Checklist

  • I am reporting an issue, not asking a question
  • I checked the open and closed issues, forum, etc. and have not found any solution
  • I have provided all necessary code, etc. to reproduce the issue
@dgenin dgenin added status: triage Issue needs to be assessed type: bug Something isn't working labels Jun 2, 2024
@abanuelo abanuelo self-assigned this Jun 6, 2024
@Eric-Vin Eric-Vin added status: valid Issue is valid and will be worked on and removed status: triage Issue needs to be assessed labels Jul 18, 2024
@Eric-Vin
Copy link
Collaborator

Sorry for the late response! We've been trying to improve the XODR parser for a while but it's going slowly. We'll hopefully address this issue in this PR.

@Eric-Vin Eric-Vin linked a pull request Jul 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants