BerkeleyLearnVerify / Scenic

A compiler and scenario generator for the Scenic scenario description language.
https://scenic-lang.org/
Other
256 stars 91 forks source link

city_intersection worlds `city_intersection.wbt` file is broken when loaded into Webots #261

Closed abanuelo closed 3 weeks ago

abanuelo commented 2 months ago

System Details

  1. Python version: 3.10.12
  2. Scenic Version: 3.0.0b2
  3. Operating System: Linux
  4. Simulator Version: Webots 2023a

Detailed Description

  1. When you load the city_intersection.wbt file into Webots, it generates the stack trace below
  2. scenic runs when you load the city_intersection.wbt file
  3. Error log:
    INFO: scenic_supervisor: Starting controller: /home/ubuntu/Scenic/venv/bin/python -u scenic_supervisor.py
    WARNING: autonomous_vehicle: Could not find controller file:
    WARNING: autonomous_vehicle: Expected either: autonomous_vehicle, autonomous_vehicle.jar, autonomous_vehicle.class, autonomous_vehicle.py, autonomous_vehicle.m  or Dockerfile
    INFO: autonomous_vehicle: Try to compile the C/C++ source code, to get a new executable file.
    WARNING: autonomous_vehicle: Starts the <generic> controller instead.
    INFO: <generic>: Starting controller: /software/webotsR2023a/resources/projects/controllers/generic/generic
    WARNING: autonomous_vehicle: Could not find controller file:
    WARNING: autonomous_vehicle: Expected either: autonomous_vehicle, autonomous_vehicle.jar, autonomous_vehicle.class, autonomous_vehicle.py, autonomous_vehicle.m  or Dockerfile
    INFO: autonomous_vehicle: Try to compile the C/C++ source code, to get a new executable file.
    WARNING: autonomous_vehicle: Starts the <generic> controller instead.
    INFO: <generic>: Starting controller: /software/webotsR2023a/resources/projects/controllers/generic/generic
    Traceback (most recent call last; use -b to show Scenic internals):
    File "/home/ubuntu/actions/Scenic/examples/webots/city_intersection/controllers/scenic_supervisor/scenic_supervisor.py", line 26, in <module>
    sim_results = simulator.simulate(scene, timestep=0.5, verbosity=2)
    File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 56, in createSimulation
    return WebotsSimulation(
    File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 82, in __init__
    super().__init__(scene, timestep=timestep, **kwargs)
    File "/home/ubuntu/actions/Scenic/examples/webots/city_intersection/city_intersection.scenic", line 55, in applyTo
    target_path = self.path + "/"
    TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'
    Loading Scenic scenario ../../city_intersection.scenic
    Starting new simulation...
    Starting simulation 1...
    Other Car Visible: False
    WARNING: 'scenic_supervisor' controller exited with status: 1.

Steps To Reproduce

  1. Open up webots
  2. Load in world file city_intersection.wbt
  3. Click the run button ** Note make sure that the python path is pointing to the python installed within the venv created for Scenic related dependencies

Issue Submission Checklist

abanuelo commented 2 months ago

Following up on this example, I noticed that there were additional steps needed to run this example, namely: running make within the controllers directory. After that was done and I loaded up the city_intersection.wbt file within webots I faced this issue:

WARNING: scenic_supervisor: Forced termination (because process didn't terminate itself after 1 second).
INFO: scenic_supervisor: Starting controller: /home/ubuntu/Scenic/venv/bin/python -u scenic_supervisor.py
INFO: autonomous_vehicle: Starting controller: /home/ubuntu/Scenic/examples/webots/city_intersection/controllers/autonomous_vehicle/autonomous_vehicle
INFO: autonomous_vehicle: Starting controller: /home/ubuntu/Scenic/examples/webots/city_intersection/controllers/autonomous_vehicle/autonomous_vehicle
Traceback (most recent call last; use -b to show Scenic internals):
  File "/home/ubuntu/Scenic/examples/webots/city_intersection/controllers/scenic_supervisor/scenic_supervisor.py", line 26, in <module>
    sim_results = simulator.simulate(scene, timestep=0.5, verbosity=2)
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 56, in createSimulation
    return WebotsSimulation(
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 82, in __init__
    super().__init__(scene, timestep=timestep, **kwargs)
  File "/home/ubuntu/Scenic/examples/webots/city_intersection/city_intersection.scenic", line 55, in applyTo
    target_path = self.path + "/"
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'
Loading Scenic scenario ../../city_intersection.scenic
Starting new simulation...
  Starting simulation 1...
Other Car Visible: False
WARNING: 'scenic_supervisor' controller exited with status: 1.
Error: could not open "../../images/live_img.jpeg" for writing
Error: could not open "../../images/live_img.jpeg" for writing
Error: could not open "../../images/live_img.jpeg" for writing
Error: could not open "../../images/live_img.jpeg" for writing
Error: could not open "../../images/live_img.jpeg" for writing