BerkeleyLearnVerify / Scenic

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

Scenic only generates one scene per call #230

Open Kai-X-Org opened 7 months ago

Kai-X-Org commented 7 months ago

System Details

  1. Python 3.11.0
  2. Scenic 3.0.0b2
  3. Apple M1 Pro MacOS Ventura 13.4
  4. No simulator

Detailed Description

When running a scenic file from the command line without setting the --count flag, Scenic only generates one scene. After closing the window popped up by clicking the red x, Scenic terminates rather than generate another scene.

Steps To Reproduce

I simply ran ego = new Object in a Scenic file from the command line.

Issue Submission Checklist

ek65 commented 7 months ago

Hi, @Kai-X-Org, I could not replicate your error on my end. Could you try running a scenic program in examples/webots/vacuum/vacuum_simple.scenic and see if you run into the same issue?

abanuelo commented 7 months ago

@Eric-Vin @Kai-X-Org I have confirmed that this error exists. Namely, when you try to close out the pygame display it only generates a single simulation and when you try to close it out, it prevents you from doing so.

My script:

model scenic.simulators.newtonian.model
ego = new Object

My command:

scenic examples/carla/test.scenic \
    --2d       \
    --simulate \
    --model scenic.simulators.newtonian.model -b

Here is a video illustrating the process. Note, the only way to quit the simulation is to have a KeyboardInterrupt which is not ideal because it does not allow for subsequent simulations to continue.

https://github.com/BerkeleyLearnVerify/Scenic/assets/32311654/1e75b7f6-ebed-4cc5-a833-393840ae28e8

abanuelo commented 7 months ago

@Kai-X-Org following up on the issue, here I was able to reproduce the issue without a simulator. Also note the fix #238 above actually allows us to terminate dynamic scenarios mid-scenario so it's actually a feature and not related to the issue you indicated in this PR:

Here is the current behavior:

https://github.com/BerkeleyLearnVerify/Scenic/assets/32311654/476e7a8f-cfbd-4e4c-a27c-2b9c2ae071af

Here is the expected behavior

https://github.com/BerkeleyLearnVerify/Scenic/assets/32311654/c14b4586-eba3-47fa-97ad-f9729a1aaee2

abanuelo commented 7 months ago

Note, I think this may be the intended behavior for the Cocoa implementation that is used in MacOS environments by pyglet. More details can be reported in this open issue: https://github.com/mikedh/trimesh/issues/2131