diff --git a/examples/sensors/carla/data_generation/data_generation.scenic b/examples/sensors/carla/data_generation/data_generation.scenic deleted file mode 100644 index 234c98b39..000000000 --- a/examples/sensors/carla/data_generation/data_generation.scenic +++ /dev/null @@ -1,32 +0,0 @@ -param map = localPath('../../../../assets/maps/CARLA/Town05.xodr') -param carla_map = 'Town05' -model scenic.simulators.carla.model - -# Sample a lane at random -lane = Uniform(*network.lanes) - -spot = new OrientedPoint on lane.centerline - -attrs = {"convert": "CityScapesPalette"} - -car_model = "vehicle.tesla.model3" - -# Spawn car on that spot with logging autopilot behavior and -# - an RGB Camera pointing forward with specific attributes -# - a semantic segmentation sensor -ego = new Car at spot, - with blueprint car_model, - with behavior AutopilotBehavior(), - with sensors {"front_ss": SSSensor(offset=(1.6, 0, 1.7), width=1056, height=704, attributes=attrs), - "front_rgb": RGBSensor(offset=(1.6, 0, 1.7), width=1056, height=704, attributes=attrs) - } - - -other = new Car offset by 0 @ Range(10, 30), - with behavior AutopilotBehavior() - -param recordFolder = "out/{simulation}" -record ego.observations["front_ss"] every 0.5 seconds after 5 seconds to "frontss_{time}.jpg" -record ego.observations["front_rgb"] after 5 seconds to "frontrgb.mp4" - -terminate after 15 seconds diff --git a/examples/sensors/conftest.py b/examples/sensors/conftest.py new file mode 100644 index 000000000..d40f9442c --- /dev/null +++ b/examples/sensors/conftest.py @@ -0,0 +1,6 @@ +import pytest + + +@pytest.fixture +def options(): + return dict(mode2D=True) diff --git a/src/scenic/domains/driving/model.scenic b/src/scenic/domains/driving/model.scenic index b6d0754af..40191b14b 100644 --- a/src/scenic/domains/driving/model.scenic +++ b/src/scenic/domains/driving/model.scenic @@ -43,6 +43,7 @@ from scenic.domains.driving.roads import (ManeuverType, Network, Road, Lane, Lan from scenic.domains.driving.actions import * from scenic.domains.driving.behaviors import * +from scenic.core.sensors import Sensor from scenic.core.distributions import RejectionException from scenic.simulators.utils.colors import Color @@ -325,6 +326,22 @@ class Pedestrian(DrivingObject): length: 0.75 color: [0, 0.5, 1] +## Stub sensor implementations + +class SSSensor(Sensor): + def __init__(self, *args, **kwargs): + pass + + def getObservation(self): + raise RuntimeError("This simulator does not support SSSensor") + +class RGBSensor(Sensor): + def __init__(self, *args, **kwargs): + pass + + def getObservation(self): + raise RuntimeError("This simulator does not support RGBSensor") + ## Utility functions def withinDistanceToAnyCars(car, thresholdDistance): diff --git a/tests/utils.py b/tests/utils.py index 3ae1cf8c1..d8b284fcf 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -504,7 +504,14 @@ def ignorable(attr): cache, debug, ignoreCacheAttrs=True, - extraIgnores=("__module__",), + extraIgnores=( + "__module__", + "_abc_impl", + "_abc_registry", + "_abc_cache", + "_abc_negative_cache", + "_abc_negative_cache_version", + ), ): fail() return False