BerkeleyLearnVerify / Scenic

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

Not able to run any examples #199

Closed nidhiyatittas closed 7 months ago

nidhiyatittas commented 8 months ago

I have installed Carla version 0.9.13 and python version 3.8 in the virtual environment. when i try to run examples i am getting the below error.

(carlascenic) C:.....\Documents\Scenic>scenic --2d examples\driving\car.scenic Beginning scenario construction... Parsing OpenDRIVE file... Computing road geometry... (this may take a while) Finished loading OpenDRIVE map in 3.03 seconds. Caching road network in .snet file. Traceback (most recent call last; use -b to show Scenic internals): File "C:....\Documents\Scenic\examples\driving\car.scenic", line 1, in File "C:.....\Documents\Scenic\src\scenic\domains\driving\model.scenic", line 248, in class Vehicle(DrivingObject): NameError: name 'types' is not defined

i am getting the same error when i try carla examples

ego = new Car -- > this line of code is throwing error

Eric-Vin commented 7 months ago

Hello,

It doesn't look like the error you're getting has anything to do with the Carla package, since that scenario uses the driving domain unless you specify otherwise. Unfortunately I'm unable to reproduce this error on my machine using the current Scenic main branch. Can you provide the following information to help us reproduce the failure?

  1. What Scenic version you are running
  2. What OS you are using.
  3. What Python 3.8 release you are using (e.g. 3.8.18)
nidhiyatittas commented 7 months ago

Scenic version Scenic 3.0.0b2 OS Windows 10 python 3.8.0

I followed steps mentioned in https://scenic-lang.readthedocs.io/en/latest/quickstart.html for installing scenic. I have followed the repository method ,the one with examples and I was able to successfully install scenic. Also I have installed Blender 3.5 and OpenSCAD which are required for scenic.

dfremont commented 7 months ago

Hello Nidhiya, could you please run your command with the -b option (i.e. scenic -b --2d examples\driving\car.scenic) so that we can get a full traceback? Thanks!

nidhiyatittas commented 7 months ago
(myenv) C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic>scenic -b --2d examples\carla\car.scenic
Beginning scenario construction...
pygame 2.1.2 (SDL 2.0.18, Python 3.8.0)
Hello from the pygame community. https://www.pygame.org/contribute.html
  Loading cached version of road network...
  Loaded cached network in 0.14 seconds.
Traceback (most recent call last):
  File "C:\Users\uig31661\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\uig31661\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\myenv\Scripts\scenic.exe\__main__.py", line 4, in <module>
    from scenic.__main__ import dummy
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\__main__.py", line 195, in <module>
    scenario = errors.callBeginningScenicTrace(
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\errors.py", line 282, in callBeginningScenicTrace
    return func()
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\__main__.py", line 196, in <lambda>
    lambda: translator.scenarioFromFile(
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\translator.py", line 142, in scenarioFromFile
    return _scenarioFromStream(
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\translator.py", line 172, in _scenarioFromStream
    compileStream(stream, namespace, compileOptions, filename)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\translator.py", line 321, in compileStream
    executeCodeIn(code, namespace)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\translator.py", line 560, in executeCodeIn
    exec(code, namespace)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\examples\carla\car.scenic", line 1, in <module>
    param map = localPath('../../assets/maps/CARLA/Town01.xodr')
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\veneer.py", line 664, in new
    return cls._withSpecifiers(specifiers)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\object_types.py", line 239, in _withSpecifiers
    properties, consts = cls._resolveSpecifiers(newspecs)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\object_types.py", line 438, in _resolveSpecifiers
    specifiedValues = spec.getValuesFor(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\specifiers.py", line 55, in getValuesFor
    val = valueInContext(self.value, obj)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 226, in valueInContext
    return value.evaluateIn(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 57, in evaluateIn
    value = self.evaluateInner(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 131, in evaluateInner
    return self.value(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 218, in value
    return func(*subvalues, **kwsubvals)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 216, in <genexpr>
    subvalues = (valueInContext(arg, context) for arg in args)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 226, in valueInContext
    return value.evaluateIn(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 57, in evaluateIn
    value = self.evaluateInner(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 131, in evaluateInner
    return self.value(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 218, in value
    return func(*subvalues, **kwsubvals)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 216, in <genexpr>
    subvalues = (valueInContext(arg, context) for arg in args)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 226, in valueInContext
    return value.evaluateIn(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 57, in evaluateIn
    value = self.evaluateInner(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 131, in evaluateInner
    return self.value(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 218, in value
    return func(*subvalues, **kwsubvals)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 216, in <genexpr>
    subvalues = (valueInContext(arg, context) for arg in args)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 226, in valueInContext
    return value.evaluateIn(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 57, in evaluateIn
    value = self.evaluateInner(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 131, in evaluateInner
    return self.value(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\domains\driving\model.scenic", line 248, in <lambda>
    class Vehicle(DrivingObject):
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\veneer.py", line 664, in new
    return cls._withSpecifiers(specifiers)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\object_types.py", line 239, in _withSpecifiers
    properties, consts = cls._resolveSpecifiers(newspecs)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\object_types.py", line 438, in _resolveSpecifiers
    specifiedValues = spec.getValuesFor(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\specifiers.py", line 55, in getValuesFor
    val = valueInContext(self.value, obj)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 226, in valueInContext
    return value.evaluateIn(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 57, in evaluateIn
    value = self.evaluateInner(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\lazy_eval.py", line 131, in evaluateInner
    return self.value(context)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\syntax\veneer.py", line 1484, in helper
    values["parentOrientation"] = target.orientation[pos]
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\distributions.py", line 611, in helper
    return MethodDistribution(method, self, args, kwargs)
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\distributions.py", line 570, in __init__
    valueType = get_type_hints(method).get("return")
  File "C:\Users\uig31661\Downloads\CARLA_0.9.13\Scenic\src\scenic\core\utils.py", line 372, in get_type_hints
    if not isinstance(obj, (type, types.ModuleType)) and globalns is None:
NameError: name 'types' is not defined
Eric-Vin commented 7 months ago

Ah, this is definitely a bug on our end. I'll create a patch that should resolve the problem. Thanks for the report!

nidhiyatittas commented 7 months ago

Patch worked. Thanks.