BerkeleyLearnVerify / Scenic

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

WalkBehavior() for Pedestrian in scenic.simulators.carla.model is broken #255

Open abanuelo opened 2 months ago

abanuelo commented 2 months ago

System Details

  1. Python Version: 3.10.12
  2. Scenic Version: 3.0.0b2
  3. Operating System / Platform: Linux
  4. Simulator Version: CARLA 0.9.14

Detailed Description

  1. When a WalkBehavior() is applied to a Pedestrian object, it fails to build the scene/scenario.
  2. Scenic command: scenic examples/carla/backgroundActivity.scenic --2d --model scenic.simulators.carla.model --simulate -b
  3. Error Log:
    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
    Loading cached version of road network...
    Loaded cached network in 0.43 seconds.
    Pruning scenario...
    Pruned scenario in 0.0001512 seconds.
    Scenario constructed in 1.59 seconds.
    Connecting to CARLA on port 2000
    WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API 
    WARNING: Client API version     = 0.9.15 
    WARNING: Simulator API version  = 0.9.14 
    Map loaded in simulator.
    Generated scene in 4 iterations, 0.3317 seconds.
    Beginning simulation of top-level scenario...
    Failed to create simulation: Unable to spawn object unnamed Pedestrian
    Generated scene in 37 iterations, 1.698 seconds.
    Beginning simulation of top-level scenario...
    Failed to create simulation: Unable to spawn object unnamed Pedestrian
    Generated scene in 63 iterations, 2.862 seconds.
    Beginning simulation of top-level scenario...
    WARNING: attempting to destroy an actor that is already dead: Actor 3921 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3920 (walker.pedestrian.0011) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3923 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3922 (walker.pedestrian.0007) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3925 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3924 (walker.pedestrian.0005) 
    Failed to create simulation: Unable to spawn object unnamed Pedestrian
    Generated scene in 39 iterations, 1.699 seconds.
    Beginning simulation of top-level scenario...
    WARNING: attempting to destroy an actor that is already dead: Actor 3953 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3952 (walker.pedestrian.0009) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3955 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3954 (walker.pedestrian.0006) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3957 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3956 (walker.pedestrian.0003) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3959 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3958 (walker.pedestrian.0004) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3961 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3960 (walker.pedestrian.0002) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3963 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3962 (walker.pedestrian.0009) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3965 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3964 (walker.pedestrian.0006) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3967 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3966 (walker.pedestrian.0008) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3969 (controller.ai.walker) 
    WARNING: attempting to destroy an actor that is already dead: Actor 3968 (walker.pedestrian.0012) 
    Failed to create simulation: Unable to spawn object unnamed Pedestrian
    Generated scene in 19 iterations, 0.9999 seconds.
    Beginning simulation of top-level scenario...
    Traceback (most recent call last):
    File "/home/abanuelo/Scenic/venv/bin/scenic", line 5, in <module>
    from scenic.__main__ import dummy
    File "/home/abanuelo/Scenic/src/scenic/__main__.py", line 274, in <module>
    success = runSimulation(scene)
    File "/home/abanuelo/Scenic/src/scenic/__main__.py", line 231, in runSimulation
    simulation = errors.callBeginningScenicTrace(
    File "/home/abanuelo/Scenic/src/scenic/core/errors.py", line 282, in callBeginningScenicTrace
    return func()
    File "/home/abanuelo/Scenic/src/scenic/__main__.py", line 232, in <lambda>
    lambda: simulator.simulate(
    File "/home/abanuelo/Scenic/src/scenic/core/simulators.py", line 178, in simulate
    simulation = self._runSingleSimulation(
    File "/home/abanuelo/Scenic/src/scenic/core/simulators.py", line 210, in _runSingleSimulation
    simulation = self.createSimulation(
    File "/home/abanuelo/Scenic/src/scenic/simulators/carla/simulator.py", line 83, in createSimulation
    return CarlaSimulation(
    File "/home/abanuelo/Scenic/src/scenic/simulators/carla/simulator.py", line 115, in __init__
    super().__init__(scene, **kwargs)
    File "/home/abanuelo/Scenic/src/scenic/core/simulators.py", line 370, in __init__
    terminationType, terminationReason = self._run(dynamicScenario, maxSteps)
    File "/home/abanuelo/Scenic/src/scenic/core/simulators.py", line 481, in _run
    self.executeActions(allActions)
    File "/home/abanuelo/Scenic/src/scenic/simulators/carla/simulator.py", line 251, in executeActions
    super().executeActions(allActions)
    File "/home/abanuelo/Scenic/src/scenic/core/simulators.py", line 633, in executeActions
    action.applyTo(agent, self)
    File "/home/abanuelo/Scenic/src/scenic/simulators/carla/actions.py", line 173, in applyTo
    controller.start()
    RuntimeError: rpc::rpc_error during call in function set_actor_collisions

Steps To Reproduce

Just clone the repo, and run the commands above.

Issue Submission Checklist

abanuelo commented 1 month ago

Following up on this issue. I launched a fresh Carla server on the Linux machine and reran the Scenic command above and the error still holds. See the video attached for reference.

https://github.com/BerkeleyLearnVerify/Scenic/assets/32311654/63fcebbd-588b-4eed-b25a-44966f850040

abanuelo commented 1 month ago

@ek65 I am tagging you here to investigate this issue further as its related to some of the code you wrote!