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docs/simulators.rst b/docs/simulators.rst
index 0887a0cfe..3d5e37a45 100644
--- a/docs/simulators.rst
+++ b/docs/simulators.rst
@@ -69,14 +69,23 @@ Our interface to the `CARLA `_ simulator enables using Sceni
The interface supports dynamic scenarios written using the CARLA world model (:obj:`scenic.simulators.carla.model`) as well as scenarios using the cross-platform :ref:`driving_domain`.
To use the interface, please follow these instructions:
-1. Install the latest version of CARLA (we've tested versions 0.9.9 through 0.9.16) from the `CARLA Release Page `_.
- Note that CARLA currently only supports Linux and Windows.
+1. Install the latest version of CARLA (we've tested versions 0.9.9 through 0.10.0) from the `CARLA Release Page `_.
+ Note that CARLA currently only supports Linux and Windows. If you plan to use **0.10.0**, double-check its higher system requirements in the `CARLA UE5 quick-start guide `_.
2. Install Scenic in your Python virtual environment as instructed in :ref:`quickstart`.
3. Within the same virtual environment, install CARLA's Python API.
How to do this depends on the CARLA version and whether you built it from source:
.. tabs::
+ .. tab:: 0.10.0
+
+ If you're using **CARLA 0.10.0** (not yet on PyPI), install the client wheel that ships with the simulator:
+
+ .. code-block:: text
+
+ cd CARLA_ROOT/PythonAPI/dist/
+ python3 -m pip install carla-*.*.*-cp3*-linux_x86_64.whl
+
.. tab:: 0.9.12+
Run the following command, replacing ``X.Y.Z`` with the version of CARLA you installed:
@@ -111,9 +120,16 @@ To use the interface, please follow these instructions:
You can check that the ``carla`` package was correctly installed by running :command:`python -c 'import carla'`: if it prints ``No module named 'carla'``, the installation didn't work.
We suggest upgrading to a newer version of CARLA so that you can use :command:`pip` to install the Python API.
-To start CARLA, run the command :command:`./CarlaUE4.sh` in your CARLA folder.
+To start CARLA, run the command :command:`./CarlaUE4.sh` in your CARLA folder (for **CARLA 0.10.0**, use :command:`./CarlaUnreal.sh` instead).
Once CARLA is running, you can run dynamic Scenic scenarios following the instructions in :ref:`the dynamics tutorial `.
+.. note:: CARLA 0.10.0 compatibility
+
+ - All ``examples/carla`` scenarios now support both CARLA 0.9.x and 0.10.0.
+ - Only the **Town10HD_Opt** map is available in 0.10.0.
+ - The 0.10.0 blueprint library is different (for example, bicycle blueprints are currently unavailable).
+ - There are some differences in physics in 0.10.0 (for example, car and pedestrian movement is slower).
+
Grand Theft Auto V
------------------
diff --git a/examples/carla/Carla_Challenge/carlaChallenge1.scenic b/examples/carla/Carla_Challenge/carlaChallenge1.scenic
index aba7b40ef..2f8d38a35 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge1.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge1.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
## DEFINING BEHAVIORS
diff --git a/examples/carla/Carla_Challenge/carlaChallenge10.scenic b/examples/carla/Carla_Challenge/carlaChallenge10.scenic
index 30e4b3b33..42891e8f1 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge10.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge10.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
SAFETY_DISTANCE = 20
BRAKE_INTENSITY = 1.0
@@ -36,6 +36,9 @@ behavior EgoBehavior(speed, trajectory):
fourWayIntersection = filter(lambda i: i.is4Way and not i.isSignalized, network.intersections)
+if not fourWayIntersection:
+ raise RuntimeError("This map doesn't have any four-way unsignalized intersections.")
+
# make sure to put '*' to uniformly randomly select from all elements of the list
intersec = Uniform(*fourWayIntersection)
ego_start_lane = Uniform(*intersec.incomingLanes)
diff --git a/examples/carla/Carla_Challenge/carlaChallenge2.scenic b/examples/carla/Carla_Challenge/carlaChallenge2.scenic
index 4c423f2b1..21046cb9b 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge2.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge2.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
EGO_BRAKING_THRESHOLD = 12
@@ -56,5 +56,5 @@ ego = new Car following roadDirection from leadCar for Range(-15, -10),
with blueprint EGO_MODEL,
with behavior EgoBehavior(EGO_SPEED)
-require (distance to intersection) > 80
+require (distance to intersection) > 50
terminate when ego.speed < 0.1 and (distance to obstacle) < 30
diff --git a/examples/carla/Carla_Challenge/carlaChallenge3_dynamic.scenic b/examples/carla/Carla_Challenge/carlaChallenge3_dynamic.scenic
index 9fb37b60c..fd2f5a1a8 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge3_dynamic.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge3_dynamic.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
# SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
# CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
SAFETY_DISTANCE = 10
BRAKE_INTENSITY = 1.0
@@ -36,8 +36,15 @@ behavior PedestrianBehavior(min_speed=1, threshold=10):
# Please refer to scenic/domains/driving/roads.py how to access detailed road infrastructure
# 'network' is the 'class Network' object in roads.py
-# make sure to put '*' to uniformly randomly select from all elements of the list, 'network.lanes'
-lane = Uniform(*network.lanes)
+# collect all the curb-side lanes
+curbLanes = [
+ lg.lanes[0]
+ for lg in network.laneGroups
+ if lg is lg.road.forwardLanes
+]
+
+# make sure to put '*' to uniformly randomly select from all elements of the list
+lane = Uniform(*curbLanes)
spot = new OrientedPoint on lane.centerline
vending_spot = new OrientedPoint following roadDirection from spot for -3
diff --git a/examples/carla/Carla_Challenge/carlaChallenge3_static.scenic b/examples/carla/Carla_Challenge/carlaChallenge3_static.scenic
index d01f5be21..40de4e7ab 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge3_static.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge3_static.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
EGO_BRAKING_THRESHOLD = 12
diff --git a/examples/carla/Carla_Challenge/carlaChallenge4.scenic b/examples/carla/Carla_Challenge/carlaChallenge4.scenic
index 4fe1cf019..aa50666b9 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge4.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge4.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
BICYCLE_MIN_SPEED = 1.5
THRESHOLD = 18
BRAKE_ACTION = 1.0
diff --git a/examples/carla/Carla_Challenge/carlaChallenge5.scenic b/examples/carla/Carla_Challenge/carlaChallenge5.scenic
index b97c64655..3d5d182e6 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge5.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge5.scenic
@@ -5,8 +5,8 @@ Ego-vehicle performs a lane changing to evade a leading vehicle, which is moving
To run this file using the Carla simulator:
scenic examples/carla/Carla_Challenge/carlaChallenge5.scenic --2d --model scenic.simulators.carla.model --simulate
"""
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#CONSTANTS
diff --git a/examples/carla/Carla_Challenge/carlaChallenge6.scenic b/examples/carla/Carla_Challenge/carlaChallenge6.scenic
index f51b68262..f3981ac82 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge6.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge6.scenic
@@ -9,8 +9,8 @@ To run this file using the Carla simulator:
# N.B. Town07 is not included with CARLA by default; see installation instructions at
# https://carla.readthedocs.io/en/latest/start_quickstart/#import-additional-assets
-param map = localPath('../../../assets/maps/CARLA/Town07.xodr')
-param carla_map = 'Town07'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
diff --git a/examples/carla/Carla_Challenge/carlaChallenge7.scenic b/examples/carla/Carla_Challenge/carlaChallenge7.scenic
index 92027273b..1668f8292 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge7.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge7.scenic
@@ -7,8 +7,8 @@ Note: The traffic light control is not implemented yet, but it will soon be.
To run this file using the Carla simulator:
scenic examples/carla/Carla_Challenge/carlaChallenge7.scenic --2d --model scenic.simulators.carla.model --simulate
"""
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
DELAY_TIME_1 = 1 # the delay time for ego
diff --git a/examples/carla/Carla_Challenge/carlaChallenge8.scenic b/examples/carla/Carla_Challenge/carlaChallenge8.scenic
index e1f8125df..e084b58f0 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge8.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge8.scenic
@@ -9,12 +9,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
SAFETY_DISTANCE = 20
BRAKE_INTENSITY = 1.0
@@ -78,7 +78,6 @@ ego = new Car at ego_spawn_pt,
adversary = new Car at adv_spawn_pt,
with behavior AdversaryBehavior(adv_trajectory)
-require (ego_start_section.laneToLeft == adv_end_section) # make sure the ego and adversary are spawned in opposite lanes
-require 25 <= (distance to intersec) <= 30
+require 10 <= (distance to intersec) <= 30
require 15 <= (distance from adversary to intersec) <= 20
terminate when (distance to ego_spawn_pt) > 70
diff --git a/examples/carla/Carla_Challenge/carlaChallenge9.scenic b/examples/carla/Carla_Challenge/carlaChallenge9.scenic
index 133b4e07c..209c267d7 100644
--- a/examples/carla/Carla_Challenge/carlaChallenge9.scenic
+++ b/examples/carla/Carla_Challenge/carlaChallenge9.scenic
@@ -5,8 +5,8 @@ Ego-vehicle is performing a right turn at an intersection, yielding to crossing
To run this file using the Carla simulator:
scenic examples/carla/Carla_Challenge/carlaChallenge9.scenic --2d --model scenic.simulators.carla.model --simulate
"""
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
DELAY_TIME_1 = 1 # the delay time for ego
diff --git a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_01.scenic b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_01.scenic
index b041174bf..17e700d30 100644
--- a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_01.scenic
+++ b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_01.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_02.scenic b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_02.scenic
index b95269650..861f637c9 100644
--- a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_02.scenic
+++ b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_02.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_SPEED = VerifaiRange(2, 4)
diff --git a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_03.scenic b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_03.scenic
index 6ec12c61e..f0128c928 100644
--- a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_03.scenic
+++ b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_03.scenic
@@ -15,15 +15,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.7, 1.0)
diff --git a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_04.scenic b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_04.scenic
index f4c42378c..6a06e338c 100644
--- a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_04.scenic
+++ b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_04.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_SPEED = VerifaiRange(6, 8)
diff --git a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_05.scenic b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_05.scenic
index 3001bcc92..0592c479e 100644
--- a/examples/carla/NHTSA_Scenarios/bypassing/bypassing_05.scenic
+++ b/examples/carla/NHTSA_Scenarios/bypassing/bypassing_05.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic
index d17fdb7c3..c9ea06b39 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic
@@ -14,26 +14,26 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
-param EGO_SPEED = VerifaiRange(7, 10)
+EGO_INIT_DIST = [10, 15]
+param EGO_SPEED = VerifaiRange(4, 6)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
-ADV_INIT_DIST = [15, 20]
-param ADV_SPEED = VerifaiRange(7, 10)
+ADV_INIT_DIST = [10, 15]
+param ADV_SPEED = VerifaiRange(8, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic
index 697e302b8..a83f4a474 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic
@@ -14,26 +14,26 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
+EGO_INIT_DIST = [10, 15]
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
-ADV_INIT_DIST = [15, 20]
+ADV_INIT_DIST = [10, 15]
param ADV_SPEED = VerifaiRange(7, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic
index 859898bec..1a45a82e0 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic
@@ -14,26 +14,26 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
+EGO_INIT_DIST = [6, 12]
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
-ADV_INIT_DIST = [15, 20]
+ADV_INIT_DIST = [6, 12]
param ADV_SPEED = VerifaiRange(7, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic
index 4ef689d10..a64797df6 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic
@@ -14,26 +14,26 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
+EGO_INIT_DIST = [6, 12]
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
-ADV_INIT_DIST = [15, 20]
+ADV_INIT_DIST = [6, 12]
param ADV_SPEED = VerifaiRange(7, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic
index eff0df4d9..0b45b4c16 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic
@@ -13,17 +13,17 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
+EGO_INIT_DIST = [10, 15]
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
@@ -32,7 +32,7 @@ param ADV_SPEED = VerifaiRange(7, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic
index 5c74c5f34..10c2d2093 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic
@@ -13,26 +13,26 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
-EGO_INIT_DIST = [20, 25]
+EGO_INIT_DIST = [6, 12]
param EGO_SPEED = VerifaiRange(7, 10)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
-ADV_INIT_DIST = [10, 15]
+ADV_INIT_DIST = [6, 12]
param ADV_SPEED = VerifaiRange(7, 10)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
-TERM_DIST = 70
+TERM_DIST = 35
#################################
# AGENT BEHAVIORS #
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic
index 22551f68e..9f74cb55d 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic
@@ -14,22 +14,22 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 40]
-param EGO_SPEED = VerifaiRange(7, 10)
+param EGO_SPEED = VerifaiRange(5, 8)
param EGO_BRAKE = VerifaiRange(0.5, 1.0)
ADV_INIT_DIST = [0, 20]
-param ADV_SPEED = VerifaiRange(7, 10)
+param ADV_SPEED = VerifaiRange(5, 8)
param SAFETY_DIST = VerifaiRange(10, 20)
CRASH_DIST = 5
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_08.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_08.scenic
index 89e1482ec..70b67423b 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_08.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_08.scenic
@@ -14,15 +14,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 40]
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_09.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_09.scenic
index e9c81ae4b..c539b7bf3 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_09.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_09.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 25]
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_10.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_10.scenic
index 50f34b6ec..b400a565d 100644
--- a/examples/carla/NHTSA_Scenarios/intersection/intersection_10.scenic
+++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_10.scenic
@@ -14,15 +14,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_INIT_DIST = VerifaiRange(10, 15)
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic
index c07454ccb..00a3c9f6c 100644
--- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic
+++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_INIT_DIST = VerifaiRange(-30, -20)
param EGO_SPEED = VerifaiRange(7, 10)
@@ -31,7 +31,7 @@ PED_MIN_SPEED = 1.0
PED_THRESHOLD = 20
param SAFETY_DIST = VerifaiRange(10, 15)
-BUFFER_DIST = 75
+BUFFER_DIST = 50
CRASH_DIST = 5
TERM_DIST = 50
@@ -51,7 +51,15 @@ behavior EgoBehavior():
# SPATIAL RELATIONS #
#################################
-lane = Uniform(*network.lanes)
+# collect all the curb-side lanes
+curbLanes = [
+ lg.lanes[0]
+ for lg in network.laneGroups
+ if lg is lg.road.forwardLanes
+]
+
+# make sure to put '*' to uniformly randomly select from all elements of the list
+lane = Uniform(*curbLanes)
spawnPt = new OrientedPoint on lane.centerline
#################################
@@ -68,6 +76,4 @@ ped = new Pedestrian right of spawnPt by 3,
with behavior CrossingBehavior(ego, PED_MIN_SPEED, PED_THRESHOLD)
require (distance to intersection) > BUFFER_DIST
-require always (ego.laneSection._slowerLane is None)
-require always (ego.laneSection._fasterLane is None)
terminate when (distance to spawnPt) > TERM_DIST
diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic
index eb4c0ea40..377427dc2 100644
--- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic
+++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town01.xodr')
-param carla_map = 'Town01'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
param EGO_INIT_DIST = VerifaiRange(-30, -20)
param EGO_SPEED = VerifaiRange(7, 10)
@@ -35,7 +35,7 @@ PED_MIN_SPEED = 1.0
PED_THRESHOLD = 20
param SAFETY_DIST = VerifaiRange(10, 15)
-BUFFER_DIST = 75
+BUFFER_DIST = 50
CRASH_DIST = 5
TERM_DIST = 50
@@ -63,8 +63,9 @@ behavior AdvBehavior():
# SPATIAL RELATIONS #
#################################
-road = Uniform(*filter(lambda r: len(r.forwardLanes.lanes) == len(r.backwardLanes.lanes) == 1, network.roads))
+road = Uniform(*filter(lambda r: len(r.forwardLanes.lanes) > 0 and len(r.backwardLanes.lanes) > 0, network.roads))
egoLane = Uniform(road.forwardLanes.lanes)[0]
+advLane = Uniform(*road.backwardLanes.lanes)
spawnPt = new OrientedPoint on egoLane.centerline
advSpawnPt = new OrientedPoint following roadDirection from spawnPt for globalParameters.ADV_INIT_DIST
@@ -81,14 +82,10 @@ ped = new Pedestrian right of spawnPt by 3,
with regionContainedIn None,
with behavior CrossingBehavior(ego, PED_MIN_SPEED, PED_THRESHOLD)
-adv = new Car left of advSpawnPt by 3,
+adv = new Car left of advSpawnPt by 7,
with blueprint MODEL,
with heading 180 deg relative to spawnPt.heading,
with behavior AdvBehavior()
require (distance from spawnPt to intersection) > BUFFER_DIST
-require always (ego.laneSection._slowerLane is None)
-require always (ego.laneSection._fasterLane is None)
-require always (adv.laneSection._slowerLane is None)
-require always (adv.laneSection._fasterLane is None)
terminate when (distance to spawnPt) > TERM_DIST
diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_03.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_03.scenic
index d07736569..4a828a62f 100644
--- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_03.scenic
+++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_03.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 25]
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_04.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_04.scenic
index edc9ff90c..24eccfbeb 100644
--- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_04.scenic
+++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_04.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 25]
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_05.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_05.scenic
index b2b6dbb4a..d1e7f321a 100644
--- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_05.scenic
+++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_05.scenic
@@ -13,15 +13,15 @@ To run this file using the Carla simulator:
# MAP AND MODEL #
#################################
-param map = localPath('../../../../assets/maps/CARLA/Town05.xodr')
-param carla_map = 'Town05'
+param map = localPath('../../../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
#################################
# CONSTANTS #
#################################
-MODEL = 'vehicle.lincoln.mkz_2017'
+MODEL = 'vehicle.nissan.patrol'
EGO_INIT_DIST = [20, 25]
param EGO_SPEED = VerifaiRange(7, 10)
diff --git a/examples/carla/OAS_Scenarios/oas_scenario_05.scenic b/examples/carla/OAS_Scenarios/oas_scenario_05.scenic
index 4573b8376..fde8f60e2 100644
--- a/examples/carla/OAS_Scenarios/oas_scenario_05.scenic
+++ b/examples/carla/OAS_Scenarios/oas_scenario_05.scenic
@@ -6,8 +6,8 @@ To run this file using the Carla simulator:
scenic examples/carla/NHTSA_Scenarios/OAS_Scenarios/oas_scenario_05.scenic --2d --model scenic.simulators.carla.model --simulate
"""
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
model scenic.domains.driving.model
MAX_BREAK_THRESHOLD = 1
diff --git a/examples/carla/OAS_Scenarios/oas_scenario_06.scenic b/examples/carla/OAS_Scenarios/oas_scenario_06.scenic
index f9c0b8aeb..c54f49dd9 100644
--- a/examples/carla/OAS_Scenarios/oas_scenario_06.scenic
+++ b/examples/carla/OAS_Scenarios/oas_scenario_06.scenic
@@ -8,8 +8,8 @@ To run this file using the Carla simulator:
"""
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
model scenic.domains.driving.model
MAX_BREAK_THRESHOLD = 1
diff --git a/examples/carla/adjacentLanes.scenic b/examples/carla/adjacentLanes.scenic
index 4bf11661e..ac1feb1ff 100644
--- a/examples/carla/adjacentLanes.scenic
+++ b/examples/carla/adjacentLanes.scenic
@@ -3,11 +3,11 @@ To run this file using the Carla simulator:
scenic examples/carla/adjacentLanes.scenic --2d --model scenic.simulators.carla.model
'''
-param map = localPath('../../assets/maps/CARLA/Town03.xodr')
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr')
model scenic.simulators.carla.model
# Cars on adjacent lanes of the first section of Road 69
-roadSec = network.elements['road69'].sections[0]
+roadSec = network.elements['road0'].sections[0]
ego = new Car in roadSec.forwardLanes[0], # rightmost lane
with color Color(1, 0, 0)
c1 = new Car in roadSec.forwardLanes[1], # next lane to left
diff --git a/examples/carla/adjacentOpposingPair.scenic b/examples/carla/adjacentOpposingPair.scenic
index f28044289..07a00bf1a 100644
--- a/examples/carla/adjacentOpposingPair.scenic
+++ b/examples/carla/adjacentOpposingPair.scenic
@@ -2,7 +2,7 @@
To run this file using the Carla simulator:
scenic examples/carla/adjacentOpposingPair.scenic --2d --model scenic.simulators.carla.model
'''
-param map = localPath('../../assets/maps/CARLA/Town01.xodr')
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr')
model scenic.simulators.carla.model
ego = new Car with visibleDistance 20
diff --git a/examples/carla/backgroundActivity.scenic b/examples/carla/backgroundActivity.scenic
index 8b29e1f01..a78191806 100644
--- a/examples/carla/backgroundActivity.scenic
+++ b/examples/carla/backgroundActivity.scenic
@@ -7,11 +7,11 @@ To run this file using the Carla simulator:
scenic examples/carla/backgroundActivity.scenic --2d --model scenic.simulators.carla.model --simulate
"""
# SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../assets/maps/CARLA/Town05.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town05'
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
# EGO BEHAVIOR: Follow lane and brake when reaches threshold distance to obstacle
diff --git a/examples/carla/car.scenic b/examples/carla/car.scenic
index 1f4c68cb7..f35dd4ce6 100644
--- a/examples/carla/car.scenic
+++ b/examples/carla/car.scenic
@@ -2,7 +2,8 @@
To run this file using the Carla simulator:
scenic examples/carla/car.scenic --2d --model scenic.simulators.carla.model --simulate
'''
-param map = localPath('../../assets/maps/CARLA/Town01.xodr')
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
ego = new Car
diff --git a/examples/carla/manual_control/carlaChallenge1.scenic b/examples/carla/manual_control/carlaChallenge1.scenic
index bb024a335..94dfae3f6 100644
--- a/examples/carla/manual_control/carlaChallenge1.scenic
+++ b/examples/carla/manual_control/carlaChallenge1.scenic
@@ -9,13 +9,13 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
param render = 0
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
## DEFINING SPATIAL RELATIONS
diff --git a/examples/carla/manual_control/carlaChallenge3_dynamic.scenic b/examples/carla/manual_control/carlaChallenge3_dynamic.scenic
index 1ae36f3f4..d4cffdf1f 100644
--- a/examples/carla/manual_control/carlaChallenge3_dynamic.scenic
+++ b/examples/carla/manual_control/carlaChallenge3_dynamic.scenic
@@ -9,13 +9,13 @@ To run this file using the Carla simulator:
"""
# SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
param render = 0
model scenic.simulators.carla.model
# CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
PEDESTRIAN_MIN_SPEED = 0.5
diff --git a/examples/carla/manual_control/carlaChallenge4.scenic b/examples/carla/manual_control/carlaChallenge4.scenic
index 4b3eb48e5..546bb51f5 100644
--- a/examples/carla/manual_control/carlaChallenge4.scenic
+++ b/examples/carla/manual_control/carlaChallenge4.scenic
@@ -9,13 +9,13 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town01'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
param render = 0
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
BICYCLE_MIN_SPEED = 1
THRESHOLD = 15
diff --git a/examples/carla/manual_control/carlaChallenge7.scenic b/examples/carla/manual_control/carlaChallenge7.scenic
index 49477f9c7..776ab3b02 100644
--- a/examples/carla/manual_control/carlaChallenge7.scenic
+++ b/examples/carla/manual_control/carlaChallenge7.scenic
@@ -9,8 +9,8 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../../assets/maps/CARLA/Town05.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town05'
+param map = localPath('../../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
param render = 0
model scenic.simulators.carla.model
diff --git a/examples/carla/pedestrian.scenic b/examples/carla/pedestrian.scenic
index 3298d69d6..50b0b7229 100644
--- a/examples/carla/pedestrian.scenic
+++ b/examples/carla/pedestrian.scenic
@@ -2,8 +2,8 @@
To run this file using the Carla simulator:
scenic examples/carla/pedestrian.scenic --2d --model scenic.simulators.carla.model --simulate
'''
-param map = localPath('../../assets/maps/CARLA/Town03.xodr')
-param carla_map = 'Town03'
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr')
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
ego = new Car
diff --git a/examples/carla/trafficLights.scenic b/examples/carla/trafficLights.scenic
index 17013211f..6e2143da7 100644
--- a/examples/carla/trafficLights.scenic
+++ b/examples/carla/trafficLights.scenic
@@ -6,12 +6,12 @@ To run this file using the Carla simulator:
"""
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc)
-param map = localPath('../../assets/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works
-param carla_map = 'Town01'
+param map = localPath('../../assets/maps/CARLA/Town10HD_Opt.xodr') # or other CARLA map that definitely works
+param carla_map = 'Town10HD_Opt'
model scenic.simulators.carla.model
## CONSTANTS
-EGO_MODEL = "vehicle.lincoln.mkz_2017"
+EGO_MODEL = "vehicle.nissan.patrol"
EGO_SPEED = 10
## DEFINING BEHAVIORS
diff --git a/pyproject.toml b/pyproject.toml
index 8fca8cd4e..8ffcc78ee 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -70,7 +70,7 @@ test-full = [ # like 'test' but adds dependencies for optional features
"scenic[guideways]", # for running guideways modules
'scenic[metadrive]; python_version < "3.12"', # MetaDrive not on PyPI for Py3.12+ yet; use GitHub (see docs)
"astor >= 0.8.1",
- 'carla >= 0.9.12; python_version <= "3.10" and (platform_system == "Linux" or platform_system == "Windows")',
+ 'carla >= 0.9.12; python_version <= "3.12" and (platform_system == "Linux" or platform_system == "Windows")',
"dill",
"exceptiongroup",
"inflect ~= 5.5",
diff --git a/src/scenic/simulators/carla/model.scenic b/src/scenic/simulators/carla/model.scenic
index 6fbb94ffb..b2edc16d6 100644
--- a/src/scenic/simulators/carla/model.scenic
+++ b/src/scenic/simulators/carla/model.scenic
@@ -30,7 +30,7 @@ Global Parameters:
(127.0.0.1).
port (int): Port on which to connect to CARLA. Default is 2000.
timeout (float): Maximum time to wait when attempting to connect to CARLA, in
- seconds. Default is 10.
+ seconds. Default is 60.
render (int): Whether or not to have CARLA create a window showing the
simulations from the point of view of the ego object: 1 for yes, 0
@@ -80,7 +80,7 @@ map_town = pathlib.Path(globalParameters.map).stem
param carla_map = map_town
param address = '127.0.0.1'
param port = 2000
-param timeout = 10
+param timeout = 60
param render = 1
if globalParameters.render not in [0, 1]:
raise ValueError('render param must be either 0 or 1')
diff --git a/src/scenic/simulators/carla/simulator.py b/src/scenic/simulators/carla/simulator.py
index e69b4f860..00ad2200b 100644
--- a/src/scenic/simulators/carla/simulator.py
+++ b/src/scenic/simulators/carla/simulator.py
@@ -17,6 +17,10 @@
import pygame
from scenic.core.simulators import SimulationCreationError
+from scenic.domains.driving.controllers import (
+ PIDLateralController,
+ PIDLongitudinalController,
+)
from scenic.domains.driving.simulators import DrivingSimulation, DrivingSimulator
from scenic.simulators.carla.blueprints import oldBlueprintNames
import scenic.simulators.carla.utils.utils as utils
@@ -33,7 +37,7 @@ def __init__(
map_path,
address="127.0.0.1",
port=2000,
- timeout=10,
+ timeout=60,
render=True,
record="",
timestep=0.1,
@@ -155,7 +159,8 @@ def setup(self):
self.cameraManager = visuals.CameraManager(self.world, egoActor, self.hud)
self.cameraManager._transform_index = camPosIndex
self.cameraManager.set_sensor(camIndex)
- self.cameraManager.set_transform(self.camTransform)
+ if self.client.get_server_version() != "0.10.0":
+ self.cameraManager.set_transform(self.camTransform)
self.world.tick() ## allowing manualgearshift to take effect # TODO still need this?
@@ -366,3 +371,55 @@ def destroy(self):
self.world.tick()
super().destroy()
+
+ # CARLA 0.10 uses UE5/Chaos physics, so the lane-following
+ # controllers need separate PID gains from the 0.9.x defaults.
+ def getLaneFollowingControllers(self, agent):
+ if self.client.get_server_version() == "0.10.0":
+ dt = self.timestep
+ if agent.isCar:
+ lon_controller = PIDLongitudinalController(
+ K_P=1.0, K_D=0.2, K_I=1.4, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=1.0, K_D=0.2, K_I=0.0, dt=dt)
+ else:
+ lon_controller = PIDLongitudinalController(
+ K_P=0.5, K_D=0.05, K_I=0.0, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=1.0, K_D=0.2, K_I=0.0, dt=dt)
+ return lon_controller, lat_controller
+ return super().getLaneFollowingControllers(agent)
+
+ def getTurningControllers(self, agent):
+ """Get longitudinal and lateral controllers for turning."""
+ if self.client.get_server_version() == "0.10.0":
+ dt = self.timestep
+ if agent.isCar:
+ lon_controller = PIDLongitudinalController(
+ K_P=1.0, K_D=0.2, K_I=1.4, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=2.0, K_D=0.2, K_I=0.0, dt=dt)
+ else:
+ lon_controller = PIDLongitudinalController(
+ K_P=0.5, K_D=0.05, K_I=0.0, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=2.0, K_D=0.2, K_I=0.0, dt=dt)
+ return lon_controller, lat_controller
+ return super().getTurningControllers(agent)
+
+ def getLaneChangingControllers(self, agent):
+ """Get longitudinal and lateral controllers for lane changing."""
+ if self.client.get_server_version() == "0.10.0":
+ dt = self.timestep
+ if agent.isCar:
+ lon_controller = PIDLongitudinalController(
+ K_P=1.0, K_D=0.2, K_I=1.4, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=0.08, K_D=0.3, K_I=0.0, dt=dt)
+ else:
+ lon_controller = PIDLongitudinalController(
+ K_P=0.5, K_D=0.05, K_I=0.0, dt=dt
+ )
+ lat_controller = PIDLateralController(K_P=0.1, K_D=0.3, K_I=0.0, dt=dt)
+ return lon_controller, lat_controller
+ return super().getLaneChangingControllers(agent)
diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py
index d4d2a23cb..ac29bf253 100644
--- a/tests/simulators/carla/test_actions.py
+++ b/tests/simulators/carla/test_actions.py
@@ -1,3 +1,4 @@
+from importlib.metadata import version
import math
import os
from pathlib import Path
@@ -17,12 +18,18 @@
from tests.utils import compileScenic, sampleScene
+carla_pkg_version = version("carla")
+is_carla_0_10 = carla_pkg_version.startswith("0.10")
+
def checkCarlaPath():
CARLA_ROOT = os.environ.get("CARLA_ROOT")
if not CARLA_ROOT:
pytest.skip("CARLA_ROOT env variable not set.")
- return CARLA_ROOT
+ path = Path(CARLA_ROOT)
+ if not path.exists():
+ pytest.skip("CARLA_ROOT set to nonexistent folder")
+ return path
def isCarlaServerRunning(host="localhost", port=2000):
@@ -40,23 +47,41 @@ def getCarlaSimulator(getAssetPath):
carla_process = None
if not isCarlaServerRunning():
CARLA_ROOT = checkCarlaPath()
+ # decide which startup script to use
+ ue_script = (
+ "CarlaUnreal.sh"
+ if (CARLA_ROOT / "CarlaUnreal.sh").exists()
+ else "CarlaUE4.sh"
+ )
+ # and which binary to kill later
+ exec_name = (
+ "CarlaUnreal-Linux-Shipping"
+ if ue_script == "CarlaUnreal.sh"
+ else "CarlaUE4-Linux-Shipping"
+ )
+
carla_process = subprocess.Popen(
- f"bash {CARLA_ROOT}/CarlaUE4.sh -RenderOffScreen", shell=True
+ f"bash {CARLA_ROOT / ue_script} -RenderOffScreen",
+ shell=True,
)
- for _ in range(180):
+ # CARLA 0.10.0 can take up to 10 minutes to start on the first launch in CI
+ for _ in range(900):
if isCarlaServerRunning():
break
time.sleep(1)
else:
pytest.fail("Unable to connect to CARLA.")
- # Extra 5 seconds to ensure server startup
+ # Extra 10 seconds to ensure server startup
time.sleep(10)
base = getAssetPath("maps/CARLA")
- def _getCarlaSimulator(town):
+ # CARLA 0.10.0 only works with Town10HD_Opt
+ def _getCarlaSimulator(town=None):
+ if town is None:
+ town = "Town10HD_Opt" if is_carla_0_10 else "Town01"
path = os.path.join(base, f"{town}.xodr")
simulator = CarlaSimulator(map_path=path, carla_map=town, timeout=180)
return simulator, town, path
@@ -64,11 +89,11 @@ def _getCarlaSimulator(town):
yield _getCarlaSimulator
if carla_process:
- subprocess.run("killall -9 CarlaUE4-Linux-Shipping", shell=True)
+ subprocess.run(f"killall -9 {exec_name}", shell=True)
def test_throttle(getCarlaSimulator):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
code = f"""
param map = r'{mapPath}'
param carla_map = '{town}'
@@ -80,7 +105,7 @@ def test_throttle(getCarlaSimulator):
while True:
take SetThrottleAction(1)
- ego = new Car at (369, -326), with behavior DriveWithThrottle
+ ego = new Car at (2, -17), with behavior DriveWithThrottle
record ego.speed as CarSpeed
terminate after 5 steps
"""
@@ -92,7 +117,7 @@ def test_throttle(getCarlaSimulator):
def test_brake(getCarlaSimulator):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
code = f"""
param map = r'{mapPath}'
param carla_map = '{town}'
@@ -112,8 +137,8 @@ def test_brake(getCarlaSimulator):
do DriveWithThrottle() for 2 steps
do Brake() for 6 steps
- ego = new Car at (369, -326),
- with blueprint 'vehicle.toyota.prius',
+ ego = new Car at (2, -17),
+ with blueprint 'vehicle.nissan.patrol',
with behavior DriveThenBrake
record final ego.speed as CarSpeed
terminate after 8 steps
@@ -122,11 +147,11 @@ def test_brake(getCarlaSimulator):
scene = sampleScene(scenario)
simulation = simulator.simulate(scene)
finalSpeed = simulation.result.records["CarSpeed"]
- assert finalSpeed == pytest.approx(0.0, abs=1e-1)
+ assert finalSpeed == pytest.approx(0.0, abs=2e-1)
def test_reverse(getCarlaSimulator):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
code = f"""
param map = r'{mapPath}'
param carla_map = '{town}'
@@ -138,7 +163,7 @@ def test_reverse(getCarlaSimulator):
while True:
take SetReverseAction(True), SetThrottleAction(1)
- ego = new Car at (369, -326), with behavior DriveInReverse
+ ego = new Car at (2, -17), with behavior DriveInReverse
record initial ego.heading as Heading
record final ego.velocity as Vel
terminate after 5 steps
@@ -154,7 +179,7 @@ def test_reverse(getCarlaSimulator):
def test_steer(getCarlaSimulator):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
code = f"""
param map = r'{mapPath}'
param carla_map = '{town}'
@@ -167,7 +192,7 @@ def test_steer(getCarlaSimulator):
take SetThrottleAction(0.5), SetSteerAction(1)
# Ego facing west
- ego = new Car at (300, -55), with behavior TurnRight
+ ego = new Car at (2, -17), with behavior TurnRight
record initial ego.heading as InitialHeading
record final ego.heading as FinalHeading
@@ -184,8 +209,12 @@ def test_steer(getCarlaSimulator):
def test_track_waypoints(getCarlaSimulator):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
target_speed = 6.0
+ if is_carla_0_10:
+ waypoints = [(62, 68), (52, 68), (42, 68)]
+ else:
+ waypoints = [(-2, -13), (-2, -23), (-2, -33)]
code = f"""
param map = r'{mapPath}'
@@ -195,7 +224,7 @@ def test_track_waypoints(getCarlaSimulator):
model scenic.simulators.carla.model
# Short straight segment, starting from a known-good spawn point.
- waypoints = [(-2, -13), (-2, -23), (-2, -33)]
+ waypoints = {waypoints}
behavior FollowPath():
while True:
@@ -219,4 +248,11 @@ def test_track_waypoints(getCarlaSimulator):
final_speed = sim.result.records["FinalSpeed"]
assert final_dist < initial_dist
- assert final_speed == pytest.approx(target_speed, abs=2.0)
+
+ # CARLA 0.10 uses different UE5 vehicle physics, so vehicles accelerate more
+ # slowly in this scenario than in CARLA 0.9.x. For 0.10, only require
+ # meaningful forward motion rather than reaching the old cruising-speed band.
+ if is_carla_0_10:
+ assert final_speed > 3.0
+ else:
+ assert final_speed == pytest.approx(target_speed, abs=2.0)
diff --git a/tests/simulators/carla/test_blueprints.py b/tests/simulators/carla/test_blueprints.py
index bd9534e89..4ea805557 100644
--- a/tests/simulators/carla/test_blueprints.py
+++ b/tests/simulators/carla/test_blueprints.py
@@ -10,6 +10,14 @@
from scenic.simulators.carla import blueprints as bp
from tests.utils import compileScenic, sampleScene
+# Known-good spawn points for the CARLA blueprint tests:
+# - CARLA 0.10.0 uses Town10HD_Opt
+# - CARLA 0.9.x uses Town01
+BLUEPRINT_TEST_SPAWNS = {
+ "Town10HD_Opt": (-103, 37.6),
+ "Town01": (369, -326),
+}
+
# Map class name -> ids dict key
CATEGORY_TO_CLASS = {
"carModels": "Car",
@@ -53,13 +61,14 @@
def model_blueprint(simulator, mapPath, town, modelType, modelName):
+ spawn = BLUEPRINT_TEST_SPAWNS[town]
code = f"""
param map = r'{mapPath}'
param carla_map = '{town}'
param time_step = 1.0/10
model scenic.simulators.carla.model
- ego = new {modelType} at (369, -326),
+ ego = new {modelType} at {spawn},
with blueprint '{modelName}',
with regionContainedIn None
terminate after 1 steps
@@ -73,5 +82,5 @@ def model_blueprint(simulator, mapPath, town, modelType, modelName):
@pytest.mark.parametrize("modelType, modelName", PARAMS)
def test_model_blueprints(getCarlaSimulator, modelType, modelName):
- simulator, town, mapPath = getCarlaSimulator("Town01")
+ simulator, town, mapPath = getCarlaSimulator()
model_blueprint(simulator, mapPath, town, modelType, modelName)