BerkeleyLearnVerify / Scenic

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

Adding default `carla_map` value if `map` present in .scenic files #228

Closed abanuelo closed 2 months ago

abanuelo commented 3 months ago

Describe the feature and motivation

When running some examples within the examples/carla/ directory, there were some files such as car.scenic that were throwing errors as a result of a missing param carla_map in file. By default, the carla_map is set to None. The recommended feature enhancement would be making this value set to the town being loaded in from the param map variable if carla_map is missing from the .scenic file.

For example:

param map = localPath('../../assets/maps/CARLA/Town01.xodr')
model scenic.simulators.carla.model

ego = new Car

would implicitly assume that param carla_map='Town01', from the map parameter.

Additional context

No response

Issue Submission Checklist

abanuelo commented 3 months ago

Just for replication purposes, if you were to run the badlyParkedCarPullingIn.scenic example by running:

scenic examples/driving/badlyParkedCarPullingIn.scenic --2d --simulate --model scenic.simulators.carla.model --count 1

and comment out this line defining the carla_map param, it will yield a simulation that looks as follows

https://github.com/BerkeleyLearnVerify/Scenic/assets/32311654/c88b0b67-92dc-4392-8ba8-4d13810ff3e1