Skip to content

Impossible to get the pedestrian crossings on the map #281

@dx6nxr

Description

@dx6nxr

System Details

  1. Python ver.: 3.8.10
  2. Scenic ver.: 3.0.0b2
  3. OS: Intel / Win 11
  4. Simulation in carla

Detailed Description

  1. When trying to extract all of the pedestrian crossings on the map, none are returned, doesn't matter if I try to get them from the intersections or the roads. I.e. if I try to get all the roads where crossings are not an empty tuple, roads = filter(lambda i: i.crossings != (), network.roads), and assert that list is not empty, I get the assertionError. I checked the .xodr file of the Town05 map, and it has multiple Crosswalks (exact number is 66). Code is as follows:
param map = 'assets/maps/CARLA/Town05.xodr'
param carla_map = 'Town05'
param time_step = 1.0/10

model scenic.simulators.carla.model

roads = filter(lambda i: i.crossings != (), network.roads)

assert len(roads) > 0, \
    'No roads with crossings found in the network'
  1. scenic -S --2d --count 1 ..\ScenicToOSC\scenic\scenarioUnexpectedPedestrianOnIntersection.scenic -b

pygame 2.5.2 (SDL 2.28.3, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
Loading cached version of road network...
Loaded cached network in 0.36 seconds.
Traceback (most recent call last):
File "C:\Users\ivbu01\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\ivbu01\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\venv1\Scripts\scenic.exe_main
.py", line 4, in
from scenic.main import dummy
File "C:\Scenic\src\scenic_main
.py", line 195, in
scenario = errors.callBeginningScenicTrace(
File "C:\Scenic\src\scenic\core\errors.py", line 282, in callBeginningScenicTrace
return func()
File "C:\Scenic\src\scenic_main.py", line 196, in
lambda: translator.scenarioFromFile(
File "C:\Scenic\src\scenic\syntax\translator.py", line 142, in scenarioFromFile
return _scenarioFromStream(
File "C:\Scenic\src\scenic\syntax\translator.py", line 172, in _scenarioFromStream
compileStream(stream, namespace, compileOptions, filename)
File "C:\Scenic\src\scenic\syntax\translator.py", line 321, in compileStream
executeCodeIn(code, namespace)
File "C:\Scenic\src\scenic\syntax\translator.py", line 560, in executeCodeIn
exec(code, namespace)
File "C:\ScenicToOSC\scenic\scenarioUnexpectedPedestrianOnIntersection.scenic", line 12, in
assert len(roads) > 0,
AssertionError: No roads with crossings found in the network```

Steps To Reproduce

  1. Just running the code on any map is enough to reproduce the problem.
param map = 'assets/maps/CARLA/Town05.xodr'
param carla_map = 'Town05'
param time_step = 1.0/10

model scenic.simulators.carla.model

roads = filter(lambda i: i.crossings != (), network.roads)

assert len(roads) > 0, \
    'No roads with crossings found in the network'

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions