From 8b516154cbdcf4bd85f82df846b982ff6a9fe7d9 Mon Sep 17 00:00:00 2001 From: Lola Marrero Date: Thu, 30 Apr 2026 12:24:22 -0700 Subject: [PATCH 01/13] support CARLA 0.10.0 --- assets/maps/CARLA/Town10HD_Opt.xodr | 17962 ++++++++++++++++ docs/simulators.rst | 22 +- .../Carla_Challenge/carlaChallenge1.scenic | 6 +- .../Carla_Challenge/carlaChallenge10.scenic | 9 +- .../Carla_Challenge/carlaChallenge2.scenic | 6 +- .../carlaChallenge3_dynamic.scenic | 17 +- .../carlaChallenge3_static.scenic | 6 +- .../Carla_Challenge/carlaChallenge4.scenic | 6 +- .../Carla_Challenge/carlaChallenge5.scenic | 4 +- .../Carla_Challenge/carlaChallenge6.scenic | 4 +- .../Carla_Challenge/carlaChallenge7.scenic | 4 +- .../Carla_Challenge/carlaChallenge8.scenic | 6 +- .../Carla_Challenge/carlaChallenge9.scenic | 4 +- .../bypassing/bypassing_01.scenic | 6 +- .../bypassing/bypassing_02.scenic | 6 +- .../bypassing/bypassing_03.scenic | 6 +- .../bypassing/bypassing_04.scenic | 6 +- .../bypassing/bypassing_05.scenic | 6 +- .../intersection/intersection_01.scenic | 6 +- .../intersection/intersection_02.scenic | 6 +- .../intersection/intersection_03.scenic | 6 +- .../intersection/intersection_04.scenic | 6 +- .../intersection/intersection_05.scenic | 6 +- .../intersection/intersection_06.scenic | 6 +- .../intersection/intersection_07.scenic | 6 +- .../intersection/intersection_08.scenic | 6 +- .../intersection/intersection_09.scenic | 6 +- .../intersection/intersection_10.scenic | 6 +- .../pedestrian/pedestrian_01.scenic | 18 +- .../pedestrian/pedestrian_02.scenic | 13 +- .../pedestrian/pedestrian_03.scenic | 6 +- .../pedestrian/pedestrian_04.scenic | 6 +- .../pedestrian/pedestrian_05.scenic | 6 +- .../OAS_Scenarios/oas_scenario_05.scenic | 4 +- .../OAS_Scenarios/oas_scenario_06.scenic | 4 +- examples/carla/adjacentLanes.scenic | 4 +- examples/carla/adjacentOpposingPair.scenic | 2 +- examples/carla/backgroundActivity.scenic | 6 +- examples/carla/car.scenic | 3 +- .../manual_control/carlaChallenge1.scenic | 6 +- .../carlaChallenge3_dynamic.scenic | 6 +- .../manual_control/carlaChallenge4.scenic | 6 +- .../manual_control/carlaChallenge7.scenic | 4 +- examples/carla/pedestrian.scenic | 4 +- examples/carla/trafficLights.scenic | 6 +- pyproject.toml | 2 +- src/scenic/simulators/carla/model.scenic | 4 +- src/scenic/simulators/carla/simulator.py | 5 +- 48 files changed, 18127 insertions(+), 134 deletions(-) create mode 100644 assets/maps/CARLA/Town10HD_Opt.xodr diff --git a/assets/maps/CARLA/Town10HD_Opt.xodr b/assets/maps/CARLA/Town10HD_Opt.xodr new file mode 100644 index 000000000..0e75263ab --- /dev/null +++ b/assets/maps/CARLA/Town10HD_Opt.xodr @@ -0,0 +1,17962 @@ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/simulators.rst b/docs/simulators.rst index 0887a0cfe..0e8ed4ad0 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, pedestrians 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..04bc8f725 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 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..34f0809b2 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 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..b1a8e903f 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_01.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, 25] param EGO_SPEED = VerifaiRange(7, 10) diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic index 697e302b8..5a794c7f9 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_02.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, 25] param EGO_SPEED = VerifaiRange(7, 10) diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic index 859898bec..423bb067e 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_03.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, 25] param EGO_SPEED = VerifaiRange(7, 10) diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic index 4ef689d10..71a2d3997 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_04.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, 25] param EGO_SPEED = VerifaiRange(7, 10) diff --git a/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic index eff0df4d9..3973c2551 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_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/NHTSA_Scenarios/intersection/intersection_06.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic index 5c74c5f34..e7735348c 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_06.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_07.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic index 22551f68e..468017e86 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_07.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_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..ffb0f0dec 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) @@ -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..6425651b5 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) @@ -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 @@ -87,8 +88,4 @@ adv = new Car left of advSpawnPt by 3, 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..3562b6095 100644 --- a/src/scenic/simulators/carla/simulator.py +++ b/src/scenic/simulators/carla/simulator.py @@ -33,7 +33,7 @@ def __init__( map_path, address="127.0.0.1", port=2000, - timeout=10, + timeout=60, render=True, record="", timestep=0.1, @@ -155,7 +155,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? From b602f502e6577456c18a3ee3547e4da03466da94 Mon Sep 17 00:00:00 2001 From: Lola Marrero Date: Wed, 13 May 2026 22:42:52 +0000 Subject: [PATCH 02/13] update CARLA examples and tests --- assets/maps/CARLA/Town10HD_Opt.net.xml | 1202 +++++++++++++++++ docs/simulators.rst | 2 +- .../Carla_Challenge/carlaChallenge2.scenic | 2 +- .../Carla_Challenge/carlaChallenge8.scenic | 3 +- .../intersection/intersection_01.scenic | 10 +- .../intersection/intersection_02.scenic | 6 +- .../intersection/intersection_03.scenic | 6 +- .../intersection/intersection_04.scenic | 6 +- .../intersection/intersection_05.scenic | 4 +- .../intersection/intersection_06.scenic | 6 +- .../intersection/intersection_07.scenic | 4 +- .../pedestrian/pedestrian_01.scenic | 2 +- .../pedestrian/pedestrian_02.scenic | 4 +- src/scenic/simulators/carla/simulator.py | 56 + tests/simulators/carla/test_actions.py | 63 +- tests/simulators/carla/test_blueprints.py | 4 +- 16 files changed, 1332 insertions(+), 48 deletions(-) create mode 100644 assets/maps/CARLA/Town10HD_Opt.net.xml diff --git a/assets/maps/CARLA/Town10HD_Opt.net.xml b/assets/maps/CARLA/Town10HD_Opt.net.xml new file mode 100644 index 000000000..aa6a5f049 --- /dev/null +++ b/assets/maps/CARLA/Town10HD_Opt.net.xml @@ -0,0 +1,1202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/simulators.rst b/docs/simulators.rst index 0e8ed4ad0..3d5e37a45 100644 --- a/docs/simulators.rst +++ b/docs/simulators.rst @@ -128,7 +128,7 @@ Once CARLA is running, you can run dynamic Scenic scenarios following the instru - 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, pedestrians movement is slower). + - 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/carlaChallenge2.scenic b/examples/carla/Carla_Challenge/carlaChallenge2.scenic index 04bc8f725..21046cb9b 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge2.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge2.scenic @@ -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/carlaChallenge8.scenic b/examples/carla/Carla_Challenge/carlaChallenge8.scenic index 34f0809b2..e084b58f0 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge8.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge8.scenic @@ -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/NHTSA_Scenarios/intersection/intersection_01.scenic b/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic index b1a8e903f..c9ea06b39 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_01.scenic @@ -24,16 +24,16 @@ model scenic.simulators.carla.model 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 5a794c7f9..a83f4a474 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_02.scenic @@ -24,16 +24,16 @@ model scenic.simulators.carla.model 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 423bb067e..1a45a82e0 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_03.scenic @@ -24,16 +24,16 @@ model scenic.simulators.carla.model 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 71a2d3997..a64797df6 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_04.scenic @@ -24,16 +24,16 @@ model scenic.simulators.carla.model 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 3973c2551..0b45b4c16 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_05.scenic @@ -23,7 +23,7 @@ model scenic.simulators.carla.model 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 e7735348c..10c2d2093 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_06.scenic @@ -23,16 +23,16 @@ model scenic.simulators.carla.model 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 468017e86..9f74cb55d 100644 --- a/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic +++ b/examples/carla/NHTSA_Scenarios/intersection/intersection_07.scenic @@ -25,11 +25,11 @@ model scenic.simulators.carla.model 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/pedestrian/pedestrian_01.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic index ffb0f0dec..00a3c9f6c 100644 --- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic +++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_01.scenic @@ -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 diff --git a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic index 6425651b5..377427dc2 100644 --- a/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic +++ b/examples/carla/NHTSA_Scenarios/pedestrian/pedestrian_02.scenic @@ -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 @@ -82,7 +82,7 @@ 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() diff --git a/src/scenic/simulators/carla/simulator.py b/src/scenic/simulators/carla/simulator.py index 3562b6095..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 @@ -367,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..89dc1874e 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,10 +18,13 @@ 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: + CARLA_ROOT = Path(os.environ.get("CARLA_ROOT", "")) + if not CARLA_ROOT.exists(): pytest.skip("CARLA_ROOT env variable not set.") return CARLA_ROOT @@ -40,11 +44,24 @@ 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): + for _ in range(600): if isCarlaServerRunning(): break time.sleep(1) @@ -56,7 +73,10 @@ def getCarlaSimulator(getAssetPath): base = getAssetPath("maps/CARLA") - def _getCarlaSimulator(town): + 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 +84,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 +100,7 @@ def test_throttle(getCarlaSimulator): while True: take SetThrottleAction(1) - ego = new Car at (369, -326), with behavior DriveWithThrottle + ego = new Car at (-3.3, -68), with behavior DriveWithThrottle record ego.speed as CarSpeed terminate after 5 steps """ @@ -92,7 +112,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 +132,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 (-3.3, -68), + with blueprint 'vehicle.nissan.patrol', with behavior DriveThenBrake record final ego.speed as CarSpeed terminate after 8 steps @@ -122,11 +142,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 +158,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 (-3.3, -68), with behavior DriveInReverse record initial ego.heading as Heading record final ego.velocity as Vel terminate after 5 steps @@ -154,7 +174,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 +187,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 (-3.3, -68), with behavior TurnRight record initial ego.heading as InitialHeading record final ego.heading as FinalHeading @@ -184,7 +204,7 @@ def test_steer(getCarlaSimulator): def test_track_waypoints(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town01") + simulator, town, mapPath = getCarlaSimulator() target_speed = 6.0 code = f""" @@ -219,4 +239,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..b6758740a 100644 --- a/tests/simulators/carla/test_blueprints.py +++ b/tests/simulators/carla/test_blueprints.py @@ -59,7 +59,7 @@ def model_blueprint(simulator, mapPath, town, modelType, modelName): param time_step = 1.0/10 model scenic.simulators.carla.model - ego = new {modelType} at (369, -326), + ego = new {modelType} at (-103.2, 37.6), with blueprint '{modelName}', with regionContainedIn None terminate after 1 steps @@ -73,5 +73,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) From d26deeb57e0ab470bfbd81c95a3f0f8b2bfff327 Mon Sep 17 00:00:00 2001 From: lola Date: Thu, 14 May 2026 11:42:07 -0700 Subject: [PATCH 03/13] update run-simulators to work with CARLA 0.10.0 --- .github/workflows/run-simulators.yml | 618 ++++++++++++++++++--------- 1 file changed, 409 insertions(+), 209 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 99f9fd43a..c903b8064 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -1,4 +1,5 @@ name: run_simulators + on: # IMPORTANT: this workflow should only be triggered manually via the Actions # portal of the repo!!! Do not modify this workflow's trigger! @@ -6,217 +7,416 @@ on: permissions: {} +# Ensure only one simulator workflow runs at a time +concurrency: + group: sim + cancel-in-progress: false + +env: + INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} + jobs: - start_ec2_instance: - name: start_ec2_instance - runs-on: ubuntu-latest - concurrency: - group: sim - outputs: - volume_id: ${{ steps.create_volume_step.outputs.volume_id }} - env: - INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} - steps: - - name: Create Volume from Latest Snapshot and Attach to Instance - id: create_volume_step - run: | - # Retrieve the latest snapshot ID - LATEST_SNAPSHOT_ID=$(aws ec2 describe-snapshots --owner-ids self --query 'Snapshots | sort_by(@, &StartTime) | [-1].SnapshotId' --output text) - echo "Checking availability for snapshot: $LATEST_SNAPSHOT_ID" - - # Wait for the snapshot to complete - aws ec2 wait snapshot-completed --snapshot-ids $LATEST_SNAPSHOT_ID - echo "Snapshot is ready." - - # Create a new volume from the latest snapshot - volume_id=$(aws ec2 create-volume --snapshot-id $LATEST_SNAPSHOT_ID --availability-zone us-west-1b --volume-type gp3 --size 400 --throughput 250 --query "VolumeId" --output text) - echo "Created volume with ID: $volume_id" - - # Set volume_id as output - echo "volume_id=$volume_id" >> $GITHUB_OUTPUT - cat $GITHUB_OUTPUT - - # Wait until the volume is available - aws ec2 wait volume-available --volume-ids $volume_id - echo "Volume is now available" - - # Attach the volume to the instance - aws ec2 attach-volume --volume-id $volume_id --instance-id $INSTANCE_ID --device /dev/sda1 - echo "Volume $volume_id attached to instance $INSTANCE_ID as /dev/sda1" - - - name: Start EC2 Instance - run: | - # Get the instance state - instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') - - # If the machine is stopping wait for it to fully stop - while [ "$instance_state" == "stopping" ]; do - echo "Instance is stopping, waiting for it to fully stop..." - sleep 10 - instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') - done + start_ec2_instance: + name: start_ec2_instance + runs-on: ubuntu-latest + permissions: + id-token: write # This is required for OIDC to request the JWT + outputs: + volume_id: ${{ steps.create_volume_step.outputs.volume_id }} + steps: + # Use OIDC to get short-lived AWS credentials instead of storing long-lived AWS keys. + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + + - name: Create Volume from Latest Snapshot and Attach to Instance + id: create_volume_step + run: | + # Retrieve the latest snapshot ID + LATEST_SNAPSHOT_ID=$(aws ec2 describe-snapshots --owner-ids self --query 'Snapshots | sort_by(@, &StartTime) | [-1].SnapshotId' --output text) + echo "Checking availability for snapshot: $LATEST_SNAPSHOT_ID" + # Wait for the snapshot to complete + aws ec2 wait snapshot-completed --snapshot-ids "$LATEST_SNAPSHOT_ID" + echo "Snapshot is ready." + # Create a new volume from the latest snapshot + volume_id=$(aws ec2 create-volume --snapshot-id "$LATEST_SNAPSHOT_ID" --availability-zone us-west-1b --volume-type gp3 --size 400 --throughput 250 --query "VolumeId" --output text) + echo "Created volume with ID: $volume_id" + # Set volume_id as output + echo "volume_id=$volume_id" >> "$GITHUB_OUTPUT" + # Wait until the volume is available + aws ec2 wait volume-available --volume-ids "$volume_id" + echo "Volume is now available" + # Attach the volume to the instance + aws ec2 attach-volume --volume-id "$volume_id" --instance-id "$INSTANCE_ID" --device /dev/sda1 + echo "Volume $volume_id attached to instance $INSTANCE_ID as /dev/sda1" + - name: Start EC2 Instance + run: | + # Get the instance state + instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') + # If the machine is stopping wait for it to fully stop + while [ "$instance_state" = "stopping" ]; do + echo "Instance is stopping, waiting for it to fully stop..." + sleep 10 + instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') + done + # Check if instance state is "stopped" + if [ "$instance_state" = "stopped" ]; then + echo "Instance is stopped, starting it..." + aws ec2 start-instances --instance-ids "$INSTANCE_ID" + elif [ "$instance_state" = "pending" ]; then + echo "Instance startup is pending, continuing..." + elif [ "$instance_state" = "running" ]; then + echo "Instance is already running..." + exit 0 + else + echo "Unknown instance state: $instance_state" + exit 1 + fi + # Wait for instance status checks to pass + echo "Waiting for instance status checks to pass..." + aws ec2 wait instance-status-ok --instance-ids "$INSTANCE_ID" + echo "Instance is now ready for use." + check_simulator_version_updates: + name: check_simulator_version_updates + runs-on: ubuntu-latest + needs: start_ec2_instance + permissions: + id-token: write + steps: + # Use OIDC to get AWS credentials for SSM. + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} - # Check if instance state is "stopped" - if [[ "$instance_state" == "stopped" ]]; then - echo "Instance is stopped, starting it..." - aws ec2 start-instances --instance-ids $INSTANCE_ID - elif [[ "$instance_state" == "pending" ]]; then - echo "Instance startup is pending, continuing..." - elif [[ "$instance_state" == "running" ]]; then - echo "Instance is already running..." - exit 0 - else - echo "Unknown instance state: $instance_state" + - name: Check for Simulator Version Updates + env: + GH_SHA: ${{ github.sha }} + run: | + # Build the remote shell script as a JSON array for AWS-RunShellScript. + # The first remote command is #!/bin/bash so SSM runs the script with Bash. + commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' < private_key && chmod 600 private_key - ssh -o StrictHostKeyChecking=no -o SendEnv=GH_REF -i private_key ${USER_NAME}@${HOSTNAME} ' - cd /home/ubuntu/actions/ && - rm -rf Scenic && - git clone --branch $(basename "$GH_REF") --single-branch https://$GH_ACCESS_TOKEN@github.com/BerkeleyLearnVerify/Scenic.git && - cd Scenic && - python3 -m venv venv && - source venv/bin/activate && - python3 -m pip install -e .[test-full] && - python3 .github/check_latest_simulators.py - ' - - check_nvidia_smi: - name: check_nvidia_smi - runs-on: ubuntu-latest - needs: start_ec2_instance - continue-on-error: true - steps: - - name: Check NVIDIA SMI - env: - PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - HOSTNAME: ${{ secrets.SSH_HOST}} - USER_NAME: ${{ secrets.SSH_USERNAME}} - run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} ' - output=$(nvidia-smi) - echo "$output" - if [ -z "$output" ]; then - echo "NVIDIA Driver is not set" + ;; + Pending|InProgress|Delayed) + sleep 5 + ;; + esac + done + aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'StandardOutputContent' \ + --output text + check_nvidia_smi: + name: check_nvidia_smi + runs-on: ubuntu-latest + needs: start_ec2_instance + continue-on-error: true + permissions: + id-token: write + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + + - name: Check NVIDIA SMI + run: | + commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' <<'EOF' + #!/bin/bash + output=$(nvidia-smi) && + echo "$output" + if [ -z "$output" ]; then + echo "NVIDIA Driver is not set" + exit 1 + fi + EOF + ) + command_id=$(aws ssm send-command \ + --instance-ids "$INSTANCE_ID" \ + --document-name AWS-RunShellScript \ + --parameters "commands=$commands" \ + --query 'Command.CommandId' \ + --output text) + while true; do + status=$(aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'Status' \ + --output text) + case "$status" in + Success) + break + ;; + Failed|Cancelled|TimedOut|Cancelling) + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardOutputContent' --output text + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardErrorContent' --output text exit 1 + ;; + Pending|InProgress|Delayed) + sleep 5 + ;; + esac + done + aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'StandardOutputContent' \ + --output text + - name: NVIDIA Driver is not set + if: ${{ failure() }} + run: | + echo "NVIDIA SMI is not working, please run the steps here on the instance:" + echo "https://scenic-lang.atlassian.net/wiki/spaces/KAN/pages/2785287/Setting+Up+AWS+VM?parentProduct=JSW&initialAllowedFeatures=byline-contributors.byline-extensions.page-comments.delete.page-reactions.inline-comments.non-licensed-share&themeState=dark%253Adark%2520light%253Alight%2520spacing%253Aspacing%2520colorMode%253Alight&locale=en-US#Install-NVIDIA-Drivers" + run_carla_simulators: + name: run_carla_simulators + runs-on: ubuntu-latest + needs: [check_simulator_version_updates, check_nvidia_smi] + permissions: + id-token: write + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + # CARLA tests can exceed the default 1-hour role session. + role-duration-seconds: 10800 # 3 hours + - name: Run CARLA Tests + run: | + # CARLA refuses to start as root. SSM Run Command runs as root by default, + # so run the CARLA test block as the ubuntu user. + commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' <<'EOF' + #!/bin/bash + sudo -u ubuntu -H bash -lc ' + cd /home/ubuntu/actions/Scenic && + source venv/bin/activate && + + # Avoid reusing a stale CARLA server from a previous version. + cleanup_carla() { + killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true + } + trap cleanup_carla EXIT + + failed=0 + carla_roots=($(find /software -maxdepth 1 -type d -name "carla*" | sort -V)) && + for carla_root in "${carla_roots[@]}"; do + carla_version="${carla_root#/software/carla}" + echo "============================= CARLA $carla_version =============================" + export CARLA_ROOT="$carla_root" + + # CARLA 0.10.0 is not available on PyPI, so install the wheel bundled with the local CARLA package. + if [[ "$carla_version" == "0.10.0" ]]; then + wheel="$CARLA_ROOT/PythonAPI/carla/dist/carla-0.10.0-cp310-cp310-linux_x86_64.whl" + python3 -m pip install --force-reinstall "$wheel" + else + python3 -m pip install --force-reinstall "carla==$carla_version" + fi || exit 1 + + if ! pytest tests/simulators/carla; then + failed=1 fi - ' - - name: NVIDIA Driver is not set - if: ${{ failure() }} - run: | - echo "NVIDIA SMI is not working, please run the steps here on the instance:" - echo "https://scenic-lang.atlassian.net/wiki/spaces/KAN/pages/2785287/Setting+Up+AWS+VM?parentProduct=JSW&initialAllowedFeatures=byline-contributors.byline-extensions.page-comments.delete.page-reactions.inline-comments.non-licensed-share&themeState=dark%253Adark%2520light%253Alight%2520spacing%253Aspacing%2520colorMode%253Alight&locale=en-US#Install-NVIDIA-Drivers" - - run_carla_simulators: - name: run_carla_simulators - runs-on: ubuntu-latest - needs: [check_simulator_version_updates, check_nvidia_smi] - steps: - - name: Run CARLA Tests - env: - PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - HOSTNAME: ${{secrets.SSH_HOST}} - USER_NAME: ${{secrets.SSH_USERNAME}} - run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -i private_key ${USER_NAME}@${HOSTNAME} ' - cd /home/ubuntu/actions/Scenic && - source venv/bin/activate && - carla_versions=($(find /software -maxdepth 1 -type d -name 'carla*')) && - for version in "${carla_versions[@]}"; do - echo "============================= CARLA $version =============================" - export CARLA_ROOT="$version" - pytest tests/simulators/carla - done - ' - - run_webots_simulators: - name: run_webots_simulators - runs-on: ubuntu-latest - needs: [check_simulator_version_updates, check_nvidia_smi] - steps: - - name: Run Webots Tests - env: - PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - HOSTNAME: ${{secrets.SSH_HOST}} - USER_NAME: ${{secrets.SSH_USERNAME}} - run: | - echo "$PRIVATE_KEY" > private_key && chmod 600 private_key - ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} ' - Xvfb :99 -screen 0 1024x768x16 & - cd /home/ubuntu/actions/Scenic && - source venv/bin/activate && - webots_versions=($(find /software -maxdepth 1 -type d -name 'webots*')) && - export DISPLAY=:99 && - for version in "${webots_versions[@]}"; do - echo "============================= Webots $version =============================" - export WEBOTS_ROOT="$version" - pytest tests/simulators/webots - done - kill %1 - ' - - stop_ec2_instance: - name: stop_ec2_instance - runs-on: ubuntu-latest - needs: [start_ec2_instance, check_simulator_version_updates, check_nvidia_smi, run_carla_simulators, run_webots_simulators] - if: always() - env: - VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }} - INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} - steps: - - name: Stop EC2 Instance - run: | - # Get the instance state and stop it if running - instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') - if [[ "$instance_state" == "running" ]]; then - echo "Instance is running, stopping it..." - aws ec2 stop-instances --instance-ids $INSTANCE_ID - aws ec2 wait instance-stopped --instance-ids $INSTANCE_ID - echo "Instance has stopped." - elif [[ "$instance_state" == "stopped" ]]; then - echo "Instance is already stopped." - else - echo "Unexpected instance state: $instance_state" - exit 1 - fi - - - name: Detach Volume - run: | - # Detach the volume - aws ec2 detach-volume --volume-id $VOLUME_ID - aws ec2 wait volume-available --volume-ids $VOLUME_ID - echo "Volume $VOLUME_ID detached." - - - name: Delete Volume - run: | - # Delete the volume after snapshot is complete - aws ec2 delete-volume --volume-id $VOLUME_ID - echo "Volume $VOLUME_ID deleted." + + cleanup_carla + done + + exit "$failed" + ' + EOF + ) + # AWS-RunShellScript's executionTimeout defaults to 3600 seconds (1 hour). + # CARLA tests can take longer, so allow this SSM command to run for 3 hours. + command_id=$(aws ssm send-command \ + --instance-ids "$INSTANCE_ID" \ + --document-name AWS-RunShellScript \ + --parameters "commands=$commands,executionTimeout=10800" \ + --query 'Command.CommandId' \ + --output text) + while true; do + status=$(aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'Status' \ + --output text) + case "$status" in + Success) + break + ;; + Failed|Cancelled|TimedOut|Cancelling) + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardOutputContent' --output text + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardErrorContent' --output text + exit 1 + ;; + Pending|InProgress|Delayed) + sleep 10 + ;; + esac + done + aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'StandardOutputContent' \ + --output text + run_webots_simulators: + name: run_webots_simulators + runs-on: ubuntu-latest + needs: [check_simulator_version_updates, check_nvidia_smi] + permissions: + id-token: write + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + + - name: Run Webots Tests + run: | + commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' <<'EOF' + #!/bin/bash + sudo -u ubuntu -H bash -lc ' + Xvfb :99 -screen 0 1024x768x16 & + xvfb_pid=$! + trap "kill $xvfb_pid" EXIT + cd /home/ubuntu/actions/Scenic && + source venv/bin/activate && + webots_versions=($(find /software -maxdepth 1 -type d -name "webots*")) && + export DISPLAY=:99 && + for version in "${webots_versions[@]}"; do + echo "============================= Webots $version =============================" + export WEBOTS_ROOT="$version" + pytest tests/simulators/webots + done + ' + EOF + ) + command_id=$(aws ssm send-command \ + --instance-ids "$INSTANCE_ID" \ + --document-name AWS-RunShellScript \ + --parameters "commands=$commands" \ + --query 'Command.CommandId' \ + --output text) + while true; do + status=$(aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'Status' \ + --output text) + case "$status" in + Success) + break + ;; + Failed|Cancelled|TimedOut|Cancelling) + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardOutputContent' --output text + aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardErrorContent' --output text + exit 1 + ;; + Pending|InProgress|Delayed) + sleep 10 + ;; + esac + done + aws ssm get-command-invocation \ + --command-id "$command_id" \ + --instance-id "$INSTANCE_ID" \ + --query 'StandardOutputContent' \ + --output text + stop_ec2_instance: + name: stop_ec2_instance + runs-on: ubuntu-latest + permissions: + id-token: write + needs: + [ + start_ec2_instance, + check_simulator_version_updates, + check_nvidia_smi, + run_carla_simulators, + run_webots_simulators, + ] + if: always() + env: + VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }} + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 + with: + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} + allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + + - name: Stop EC2 Instance + run: | + # Get the instance state and stop it if running + instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') + if [ "$instance_state" = "running" ]; then + echo "Instance is running, stopping it..." + aws ec2 stop-instances --instance-ids "$INSTANCE_ID" + aws ec2 wait instance-stopped --instance-ids "$INSTANCE_ID" + echo "Instance has stopped." + elif [ "$instance_state" = "stopped" ]; then + echo "Instance is already stopped." + else + echo "Unexpected instance state: $instance_state" + exit 1 + fi + - name: Detach Volume + if: ${{ needs.start_ec2_instance.outputs.volume_id != '' }} + run: | + # Detach the volume + aws ec2 detach-volume --volume-id "$VOLUME_ID" + aws ec2 wait volume-available --volume-ids "$VOLUME_ID" + echo "Volume $VOLUME_ID detached." + - name: Delete Volume + if: ${{ needs.start_ec2_instance.outputs.volume_id != '' }} + run: | + # Delete the volume after snapshot is complete + aws ec2 delete-volume --volume-id "$VOLUME_ID" + echo "Volume $VOLUME_ID deleted." From b6ad7e4dbbf82b9ba83a767accf6f5aaa15c0e71 Mon Sep 17 00:00:00 2001 From: lola Date: Tue, 19 May 2026 17:05:08 -0700 Subject: [PATCH 04/13] update CARLA tests and install versioned wheels --- .github/workflows/run-simulators.yml | 29 ++++------------------- tests/simulators/carla/test_actions.py | 24 +++++++++---------- tests/simulators/carla/test_blueprints.py | 4 ++-- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index c903b8064..e04ebbcd5 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -227,7 +227,7 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} # CARLA tests can exceed the default 1-hour role session. - role-duration-seconds: 10800 # 3 hours + role-duration-seconds: 7200 # 2 hours - name: Run CARLA Tests run: | # CARLA refuses to start as root. SSM Run Command runs as root by default, @@ -237,36 +237,15 @@ jobs: sudo -u ubuntu -H bash -lc ' cd /home/ubuntu/actions/Scenic && source venv/bin/activate && - - # Avoid reusing a stale CARLA server from a previous version. - cleanup_carla() { - killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true - } - trap cleanup_carla EXIT - - failed=0 carla_roots=($(find /software -maxdepth 1 -type d -name "carla*" | sort -V)) && for carla_root in "${carla_roots[@]}"; do carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" - - # CARLA 0.10.0 is not available on PyPI, so install the wheel bundled with the local CARLA package. - if [[ "$carla_version" == "0.10.0" ]]; then - wheel="$CARLA_ROOT/PythonAPI/carla/dist/carla-0.10.0-cp310-cp310-linux_x86_64.whl" - python3 -m pip install --force-reinstall "$wheel" - else - python3 -m pip install --force-reinstall "carla==$carla_version" - fi || exit 1 - - if ! pytest tests/simulators/carla; then - failed=1 - fi - - cleanup_carla + python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl + pytest tests/simulators/carla + sleep 5 done - - exit "$failed" ' EOF ) diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index 89dc1874e..21754f445 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -57,8 +57,11 @@ def getCarlaSimulator(getAssetPath): else "CarlaUE4-Linux-Shipping" ) + # CARLA 0.10.0/UE5 can be slow or fail to start on the first launch in CI. + # Low quality reduces rendering load and has made startup more reliable. carla_process = subprocess.Popen( - f"bash {CARLA_ROOT / ue_script} -RenderOffScreen", shell=True + f"bash {CARLA_ROOT / ue_script} -RenderOffScreen -quality-level=Low", + shell=True, ) for _ in range(600): @@ -68,15 +71,12 @@ def getCarlaSimulator(getAssetPath): 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=None): - if town is None: - town = "Town10HD_Opt" if is_carla_0_10 else "Town01" - + def _getCarlaSimulator(town): path = os.path.join(base, f"{town}.xodr") simulator = CarlaSimulator(map_path=path, carla_map=town, timeout=180) return simulator, town, path @@ -88,7 +88,7 @@ def _getCarlaSimulator(town=None): def test_throttle(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -112,7 +112,7 @@ def test_throttle(getCarlaSimulator): def test_brake(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -146,7 +146,7 @@ def test_brake(getCarlaSimulator): def test_reverse(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -174,7 +174,7 @@ def test_reverse(getCarlaSimulator): def test_steer(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -204,7 +204,7 @@ def test_steer(getCarlaSimulator): def test_track_waypoints(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") target_speed = 6.0 code = f""" @@ -215,7 +215,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 = [(62, 68), (52, 68), (42, 68)] behavior FollowPath(): while True: diff --git a/tests/simulators/carla/test_blueprints.py b/tests/simulators/carla/test_blueprints.py index b6758740a..ab9d70b10 100644 --- a/tests/simulators/carla/test_blueprints.py +++ b/tests/simulators/carla/test_blueprints.py @@ -59,7 +59,7 @@ def model_blueprint(simulator, mapPath, town, modelType, modelName): param time_step = 1.0/10 model scenic.simulators.carla.model - ego = new {modelType} at (-103.2, 37.6), + ego = new {modelType} at (-103.2, 37.6), with blueprint '{modelName}', with regionContainedIn None terminate after 1 steps @@ -73,5 +73,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() + simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") model_blueprint(simulator, mapPath, town, modelType, modelName) From 35bc2c5c9b740755b03164117535d514c29f97ee Mon Sep 17 00:00:00 2001 From: lola Date: Thu, 21 May 2026 12:39:43 -0700 Subject: [PATCH 05/13] retry CARLA 0.10.0 startup --- .github/workflows/run-simulators.yml | 15 +++++++++--- tests/simulators/carla/test_actions.py | 34 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index e04ebbcd5..508291054 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -227,7 +227,8 @@ jobs: aws-region: ${{ secrets.AWS_REGION }} allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} # CARLA tests can exceed the default 1-hour role session. - role-duration-seconds: 7200 # 2 hours + # Keep this longer than the SSM command timeout so we can still fetch logs if SSM times out. + role-duration-seconds: 9000 # 2.5 hours - name: Run CARLA Tests run: | # CARLA refuses to start as root. SSM Run Command runs as root by default, @@ -237,24 +238,30 @@ jobs: sudo -u ubuntu -H bash -lc ' cd /home/ubuntu/actions/Scenic && source venv/bin/activate && + failed=0 && carla_roots=($(find /software -maxdepth 1 -type d -name "carla*" | sort -V)) && for carla_root in "${carla_roots[@]}"; do carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl - pytest tests/simulators/carla + + if ! pytest tests/simulators/carla; then + failed=1 + fi sleep 5 done + + exit "$failed" ' EOF ) # AWS-RunShellScript's executionTimeout defaults to 3600 seconds (1 hour). - # CARLA tests can take longer, so allow this SSM command to run for 3 hours. + # Limit the CARLA SSM command to 2 hours so it ends before the AWS role session expires. command_id=$(aws ssm send-command \ --instance-ids "$INSTANCE_ID" \ --document-name AWS-RunShellScript \ - --parameters "commands=$commands,executionTimeout=10800" \ + --parameters "commands=$commands,executionTimeout=7200" \ --query 'Command.CommandId' \ --output text) while true; do diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index 21754f445..573cfc031 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -57,19 +57,27 @@ def getCarlaSimulator(getAssetPath): else "CarlaUE4-Linux-Shipping" ) - # CARLA 0.10.0/UE5 can be slow or fail to start on the first launch in CI. - # Low quality reduces rendering load and has made startup more reliable. - carla_process = subprocess.Popen( - f"bash {CARLA_ROOT / ue_script} -RenderOffScreen -quality-level=Low", - shell=True, - ) - - for _ in range(600): - if isCarlaServerRunning(): - break - time.sleep(1) - else: - pytest.fail("Unable to connect to CARLA.") + startup_attempts = 2 if is_carla_0_10 else 1 + + # CARLA 0.10.0/UE5 can fail to start on the first try, so allow one retry before giving up. + for attempt in range(startup_attempts): + carla_process = subprocess.Popen( + f"bash {CARLA_ROOT / ue_script} -RenderOffScreen", + shell=True, + ) + + for _ in range(600): + if isCarlaServerRunning(): + break + time.sleep(1) + else: + if attempt + 1 < startup_attempts: + print(f"CARLA failed to start on attempt {attempt + 1}, retrying...") + continue + + pytest.fail("Unable to connect to CARLA.") + + break # Extra 10 seconds to ensure server startup time.sleep(10) From c9dfad9a00e9ba50899451a85676b4a4cb6819e4 Mon Sep 17 00:00:00 2001 From: lola Date: Fri, 22 May 2026 16:14:42 -0700 Subject: [PATCH 06/13] remove CARLA startup retry --- .github/workflows/run-simulators.yml | 10 ++------ tests/simulators/carla/test_actions.py | 33 ++++++++++---------------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 508291054..214af56e7 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -236,23 +236,17 @@ jobs: commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' <<'EOF' #!/bin/bash sudo -u ubuntu -H bash -lc ' + set -e cd /home/ubuntu/actions/Scenic && source venv/bin/activate && - failed=0 && carla_roots=($(find /software -maxdepth 1 -type d -name "carla*" | sort -V)) && for carla_root in "${carla_roots[@]}"; do carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl - - if ! pytest tests/simulators/carla; then - failed=1 - fi - sleep 5 + pytest tests/simulators/carla done - - exit "$failed" ' EOF ) diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index 573cfc031..b5840ace4 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -57,27 +57,18 @@ def getCarlaSimulator(getAssetPath): else "CarlaUE4-Linux-Shipping" ) - startup_attempts = 2 if is_carla_0_10 else 1 - - # CARLA 0.10.0/UE5 can fail to start on the first try, so allow one retry before giving up. - for attempt in range(startup_attempts): - carla_process = subprocess.Popen( - f"bash {CARLA_ROOT / ue_script} -RenderOffScreen", - shell=True, - ) - - for _ in range(600): - if isCarlaServerRunning(): - break - time.sleep(1) - else: - if attempt + 1 < startup_attempts: - print(f"CARLA failed to start on attempt {attempt + 1}, retrying...") - continue - - pytest.fail("Unable to connect to CARLA.") - - break + # CARLA 0.10.0/UE5 can be slow or fail to start on the first launch in CI. + carla_process = subprocess.Popen( + f"bash {CARLA_ROOT / ue_script} -RenderOffScreen", + shell=True, + ) + + for _ in range(600): + if isCarlaServerRunning(): + break + time.sleep(1) + else: + pytest.fail("Unable to connect to CARLA.") # Extra 10 seconds to ensure server startup time.sleep(10) From d1af49eb00fc6811686a6caceedf31d4895505df Mon Sep 17 00:00:00 2001 From: lola Date: Fri, 22 May 2026 17:15:21 -0700 Subject: [PATCH 07/13] Clean up CARLA servers between CI runs in workflow --- .github/workflows/run-simulators.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 214af56e7..8cfd7c3e1 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -241,11 +241,17 @@ jobs: source venv/bin/activate && carla_roots=($(find /software -maxdepth 1 -type d -name "carla*" | sort -V)) && for carla_root in "${carla_roots[@]}"; do + killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true + sleep 5 + carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl pytest tests/simulators/carla + + killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true + sleep 5 done ' EOF From 53e2be91c9af17b41e07ffbbef8d64dd1c1c396d Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 25 May 2026 16:31:33 -0700 Subject: [PATCH 08/13] use PyPI CARLA packages for 0.9.x tests --- .github/workflows/run-simulators.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 8cfd7c3e1..2877bdd77 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -243,15 +243,15 @@ jobs: for carla_root in "${carla_roots[@]}"; do killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true sleep 5 - carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" - python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl + if [[ "$carla_version" == "0.10.0" ]]; then + python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl + else + python3 -m pip install --force-reinstall "carla==$carla_version" + fi pytest tests/simulators/carla - - killall -9 CarlaUE4-Linux-Shipping CarlaUnreal-Linux-Shipping 2>/dev/null || true - sleep 5 done ' EOF From 84eb4a9fe884f42d1b4ae65e23dab2e74447471d Mon Sep 17 00:00:00 2001 From: lola Date: Tue, 26 May 2026 16:40:12 -0700 Subject: [PATCH 09/13] install all CARLA APIs from local wheels in CI --- .github/workflows/run-simulators.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 2877bdd77..03d29cf06 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -246,11 +246,7 @@ jobs: carla_version="${carla_root#/software/carla}" echo "============================= CARLA $carla_version =============================" export CARLA_ROOT="$carla_root" - if [[ "$carla_version" == "0.10.0" ]]; then - python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl - else - python3 -m pip install --force-reinstall "carla==$carla_version" - fi + python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl pytest tests/simulators/carla done ' From 4c34efded6430d565c31335faf47fe0cee1f4e20 Mon Sep 17 00:00:00 2001 From: lola Date: Tue, 26 May 2026 18:08:38 -0700 Subject: [PATCH 10/13] use version-specific CARLA maps in tests --- tests/simulators/carla/test_actions.py | 41 ++++++++++++++++------- tests/simulators/carla/test_blueprints.py | 16 +++++++-- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index b5840ace4..1773cc8dd 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -57,13 +57,13 @@ def getCarlaSimulator(getAssetPath): else "CarlaUE4-Linux-Shipping" ) - # CARLA 0.10.0/UE5 can be slow or fail to start on the first launch in CI. carla_process = subprocess.Popen( f"bash {CARLA_ROOT / ue_script} -RenderOffScreen", shell=True, ) - for _ in range(600): + # 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) @@ -75,7 +75,18 @@ def getCarlaSimulator(getAssetPath): base = getAssetPath("maps/CARLA") - def _getCarlaSimulator(town): + # Use a single default map per CARLA version for the test suite. + # + # In our current CI setup, CARLA 0.10.0 only works reliably with Town10HD_Opt, + # so all CARLA 0.10.0 tests should use that map. + # + # For CARLA 0.9.x, most tests also worked with Town10HD_Opt, but the blueprint + # parameterization test became unstable: most blueprints spawned successfully, + # but CARLA would eventually crash. Switching maps within the same CARLA process + # also caused instability, so we consistently use Town01 for the 0.9.x suite. + 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 @@ -87,7 +98,7 @@ def _getCarlaSimulator(town): def test_throttle(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") + simulator, town, mapPath = getCarlaSimulator() code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -99,7 +110,7 @@ def test_throttle(getCarlaSimulator): while True: take SetThrottleAction(1) - ego = new Car at (-3.3, -68), with behavior DriveWithThrottle + ego = new Car at (2, -17), with behavior DriveWithThrottle record ego.speed as CarSpeed terminate after 5 steps """ @@ -111,7 +122,7 @@ def test_throttle(getCarlaSimulator): def test_brake(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") + simulator, town, mapPath = getCarlaSimulator() code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -131,7 +142,7 @@ def test_brake(getCarlaSimulator): do DriveWithThrottle() for 2 steps do Brake() for 6 steps - ego = new Car at (-3.3, -68), + ego = new Car at (2, -17), with blueprint 'vehicle.nissan.patrol', with behavior DriveThenBrake record final ego.speed as CarSpeed @@ -145,7 +156,7 @@ def test_brake(getCarlaSimulator): def test_reverse(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") + simulator, town, mapPath = getCarlaSimulator() code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -157,7 +168,7 @@ def test_reverse(getCarlaSimulator): while True: take SetReverseAction(True), SetThrottleAction(1) - ego = new Car at (-3.3, -68), 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 @@ -173,7 +184,7 @@ def test_reverse(getCarlaSimulator): def test_steer(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") + simulator, town, mapPath = getCarlaSimulator() code = f""" param map = r'{mapPath}' param carla_map = '{town}' @@ -186,7 +197,7 @@ def test_steer(getCarlaSimulator): take SetThrottleAction(0.5), SetSteerAction(1) # Ego facing west - ego = new Car at (-3.3, -68), with behavior TurnRight + ego = new Car at (2, -17), with behavior TurnRight record initial ego.heading as InitialHeading record final ego.heading as FinalHeading @@ -203,8 +214,12 @@ def test_steer(getCarlaSimulator): def test_track_waypoints(getCarlaSimulator): - simulator, town, mapPath = getCarlaSimulator("Town10HD_Opt") + 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}' @@ -214,7 +229,7 @@ def test_track_waypoints(getCarlaSimulator): model scenic.simulators.carla.model # Short straight segment, starting from a known-good spawn point. - waypoints = [(62, 68), (52, 68), (42, 68)] + waypoints = {waypoints} behavior FollowPath(): while True: diff --git a/tests/simulators/carla/test_blueprints.py b/tests/simulators/carla/test_blueprints.py index ab9d70b10..8e0010cb9 100644 --- a/tests/simulators/carla/test_blueprints.py +++ b/tests/simulators/carla/test_blueprints.py @@ -10,6 +10,17 @@ 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 +# +# These positions are chosen to make blueprint spawning stable across many +# actor types; they are not intended to test road/lane placement. +BLUEPRINT_TEST_SPAWNS = { + "Town10HD_Opt": (-103, 37.6), + "Town01": (2, -17), +} + # Map class name -> ids dict key CATEGORY_TO_CLASS = { "carModels": "Car", @@ -53,13 +64,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 (-103.2, 37.6), + ego = new {modelType} at {spawn}, with blueprint '{modelName}', with regionContainedIn None terminate after 1 steps @@ -73,5 +85,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("Town10HD_Opt") + simulator, town, mapPath = getCarlaSimulator() model_blueprint(simulator, mapPath, town, modelType, modelName) From db49698dc728d3238eb32ec1d62513391da6bd04 Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 1 Jun 2026 15:29:36 -0700 Subject: [PATCH 11/13] switch back to older spawn pos for blueprints test --- tests/simulators/carla/test_actions.py | 10 +--------- tests/simulators/carla/test_blueprints.py | 5 +---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index 1773cc8dd..e58f773e5 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -75,15 +75,7 @@ def getCarlaSimulator(getAssetPath): base = getAssetPath("maps/CARLA") - # Use a single default map per CARLA version for the test suite. - # - # In our current CI setup, CARLA 0.10.0 only works reliably with Town10HD_Opt, - # so all CARLA 0.10.0 tests should use that map. - # - # For CARLA 0.9.x, most tests also worked with Town10HD_Opt, but the blueprint - # parameterization test became unstable: most blueprints spawned successfully, - # but CARLA would eventually crash. Switching maps within the same CARLA process - # also caused instability, so we consistently use Town01 for the 0.9.x suite. + # 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" diff --git a/tests/simulators/carla/test_blueprints.py b/tests/simulators/carla/test_blueprints.py index 8e0010cb9..4ea805557 100644 --- a/tests/simulators/carla/test_blueprints.py +++ b/tests/simulators/carla/test_blueprints.py @@ -13,12 +13,9 @@ # Known-good spawn points for the CARLA blueprint tests: # - CARLA 0.10.0 uses Town10HD_Opt # - CARLA 0.9.x uses Town01 -# -# These positions are chosen to make blueprint spawning stable across many -# actor types; they are not intended to test road/lane placement. BLUEPRINT_TEST_SPAWNS = { "Town10HD_Opt": (-103, 37.6), - "Town01": (2, -17), + "Town01": (369, -326), } # Map class name -> ids dict key From efa891b67654881a5f28363cd27ce5b6b7756678 Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 1 Jun 2026 16:34:06 -0700 Subject: [PATCH 12/13] restore run_simulators workflow from main --- .github/workflows/run-simulators.yml | 590 +++++++++------------------ 1 file changed, 204 insertions(+), 386 deletions(-) diff --git a/.github/workflows/run-simulators.yml b/.github/workflows/run-simulators.yml index 03d29cf06..99f9fd43a 100644 --- a/.github/workflows/run-simulators.yml +++ b/.github/workflows/run-simulators.yml @@ -1,5 +1,4 @@ name: run_simulators - on: # IMPORTANT: this workflow should only be triggered manually via the Actions # portal of the repo!!! Do not modify this workflow's trigger! @@ -7,398 +6,217 @@ on: permissions: {} -# Ensure only one simulator workflow runs at a time -concurrency: - group: sim - cancel-in-progress: false +jobs: + start_ec2_instance: + name: start_ec2_instance + runs-on: ubuntu-latest + concurrency: + group: sim + outputs: + volume_id: ${{ steps.create_volume_step.outputs.volume_id }} + env: + INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} + steps: + - name: Create Volume from Latest Snapshot and Attach to Instance + id: create_volume_step + run: | + # Retrieve the latest snapshot ID + LATEST_SNAPSHOT_ID=$(aws ec2 describe-snapshots --owner-ids self --query 'Snapshots | sort_by(@, &StartTime) | [-1].SnapshotId' --output text) + echo "Checking availability for snapshot: $LATEST_SNAPSHOT_ID" -env: - INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} + # Wait for the snapshot to complete + aws ec2 wait snapshot-completed --snapshot-ids $LATEST_SNAPSHOT_ID + echo "Snapshot is ready." -jobs: - start_ec2_instance: - name: start_ec2_instance - runs-on: ubuntu-latest - permissions: - id-token: write # This is required for OIDC to request the JWT - outputs: - volume_id: ${{ steps.create_volume_step.outputs.volume_id }} - steps: - # Use OIDC to get short-lived AWS credentials instead of storing long-lived AWS keys. - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + # Create a new volume from the latest snapshot + volume_id=$(aws ec2 create-volume --snapshot-id $LATEST_SNAPSHOT_ID --availability-zone us-west-1b --volume-type gp3 --size 400 --throughput 250 --query "VolumeId" --output text) + echo "Created volume with ID: $volume_id" - - name: Create Volume from Latest Snapshot and Attach to Instance - id: create_volume_step - run: | - # Retrieve the latest snapshot ID - LATEST_SNAPSHOT_ID=$(aws ec2 describe-snapshots --owner-ids self --query 'Snapshots | sort_by(@, &StartTime) | [-1].SnapshotId' --output text) - echo "Checking availability for snapshot: $LATEST_SNAPSHOT_ID" - # Wait for the snapshot to complete - aws ec2 wait snapshot-completed --snapshot-ids "$LATEST_SNAPSHOT_ID" - echo "Snapshot is ready." - # Create a new volume from the latest snapshot - volume_id=$(aws ec2 create-volume --snapshot-id "$LATEST_SNAPSHOT_ID" --availability-zone us-west-1b --volume-type gp3 --size 400 --throughput 250 --query "VolumeId" --output text) - echo "Created volume with ID: $volume_id" - # Set volume_id as output - echo "volume_id=$volume_id" >> "$GITHUB_OUTPUT" - # Wait until the volume is available - aws ec2 wait volume-available --volume-ids "$volume_id" - echo "Volume is now available" - # Attach the volume to the instance - aws ec2 attach-volume --volume-id "$volume_id" --instance-id "$INSTANCE_ID" --device /dev/sda1 - echo "Volume $volume_id attached to instance $INSTANCE_ID as /dev/sda1" - - name: Start EC2 Instance - run: | - # Get the instance state - instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') - # If the machine is stopping wait for it to fully stop - while [ "$instance_state" = "stopping" ]; do - echo "Instance is stopping, waiting for it to fully stop..." - sleep 10 - instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') - done - # Check if instance state is "stopped" - if [ "$instance_state" = "stopped" ]; then - echo "Instance is stopped, starting it..." - aws ec2 start-instances --instance-ids "$INSTANCE_ID" - elif [ "$instance_state" = "pending" ]; then - echo "Instance startup is pending, continuing..." - elif [ "$instance_state" = "running" ]; then - echo "Instance is already running..." - exit 0 - else - echo "Unknown instance state: $instance_state" - exit 1 - fi - # Wait for instance status checks to pass - echo "Waiting for instance status checks to pass..." - aws ec2 wait instance-status-ok --instance-ids "$INSTANCE_ID" - echo "Instance is now ready for use." - check_simulator_version_updates: - name: check_simulator_version_updates - runs-on: ubuntu-latest - needs: start_ec2_instance - permissions: - id-token: write - steps: - # Use OIDC to get AWS credentials for SSM. - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + # Set volume_id as output + echo "volume_id=$volume_id" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT - - name: Check for Simulator Version Updates - env: - GH_SHA: ${{ github.sha }} - run: | - # Build the remote shell script as a JSON array for AWS-RunShellScript. - # The first remote command is #!/bin/bash so SSM runs the script with Bash. - commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' </dev/null || true - sleep 5 - carla_version="${carla_root#/software/carla}" - echo "============================= CARLA $carla_version =============================" - export CARLA_ROOT="$carla_root" - python3 -m pip install --force-reinstall "$CARLA_ROOT"/PythonAPI/carla/dist/carla-"$carla_version"-cp310-cp310-*.whl - pytest tests/simulators/carla + # Attach the volume to the instance + aws ec2 attach-volume --volume-id $volume_id --instance-id $INSTANCE_ID --device /dev/sda1 + echo "Volume $volume_id attached to instance $INSTANCE_ID as /dev/sda1" + + - name: Start EC2 Instance + run: | + # Get the instance state + instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') + + # If the machine is stopping wait for it to fully stop + while [ "$instance_state" == "stopping" ]; do + echo "Instance is stopping, waiting for it to fully stop..." + sleep 10 + instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') done - ' - EOF - ) - # AWS-RunShellScript's executionTimeout defaults to 3600 seconds (1 hour). - # Limit the CARLA SSM command to 2 hours so it ends before the AWS role session expires. - command_id=$(aws ssm send-command \ - --instance-ids "$INSTANCE_ID" \ - --document-name AWS-RunShellScript \ - --parameters "commands=$commands,executionTimeout=7200" \ - --query 'Command.CommandId' \ - --output text) - while true; do - status=$(aws ssm get-command-invocation \ - --command-id "$command_id" \ - --instance-id "$INSTANCE_ID" \ - --query 'Status' \ - --output text) - case "$status" in - Success) - break - ;; - Failed|Cancelled|TimedOut|Cancelling) - aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardOutputContent' --output text - aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardErrorContent' --output text + + # Check if instance state is "stopped" + if [[ "$instance_state" == "stopped" ]]; then + echo "Instance is stopped, starting it..." + aws ec2 start-instances --instance-ids $INSTANCE_ID + elif [[ "$instance_state" == "pending" ]]; then + echo "Instance startup is pending, continuing..." + elif [[ "$instance_state" == "running" ]]; then + echo "Instance is already running..." + exit 0 + else + echo "Unknown instance state: $instance_state" exit 1 - ;; - Pending|InProgress|Delayed) - sleep 10 - ;; - esac - done - aws ssm get-command-invocation \ - --command-id "$command_id" \ - --instance-id "$INSTANCE_ID" \ - --query 'StandardOutputContent' \ - --output text - run_webots_simulators: - name: run_webots_simulators - runs-on: ubuntu-latest - needs: [check_simulator_version_updates, check_nvidia_smi] - permissions: - id-token: write - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + fi - - name: Run Webots Tests - run: | - commands=$(jq -Rs -c 'split("\n") | if .[-1] == "" then .[:-1] else . end' <<'EOF' - #!/bin/bash - sudo -u ubuntu -H bash -lc ' - Xvfb :99 -screen 0 1024x768x16 & - xvfb_pid=$! - trap "kill $xvfb_pid" EXIT - cd /home/ubuntu/actions/Scenic && - source venv/bin/activate && - webots_versions=($(find /software -maxdepth 1 -type d -name "webots*")) && - export DISPLAY=:99 && - for version in "${webots_versions[@]}"; do - echo "============================= Webots $version =============================" - export WEBOTS_ROOT="$version" - pytest tests/simulators/webots - done - ' - EOF - ) - command_id=$(aws ssm send-command \ - --instance-ids "$INSTANCE_ID" \ - --document-name AWS-RunShellScript \ - --parameters "commands=$commands" \ - --query 'Command.CommandId' \ - --output text) - while true; do - status=$(aws ssm get-command-invocation \ - --command-id "$command_id" \ - --instance-id "$INSTANCE_ID" \ - --query 'Status' \ - --output text) - case "$status" in - Success) - break - ;; - Failed|Cancelled|TimedOut|Cancelling) - aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardOutputContent' --output text - aws ssm get-command-invocation --command-id "$command_id" --instance-id "$INSTANCE_ID" --query 'StandardErrorContent' --output text + # Wait for instance status checks to pass + echo "Waiting for instance status checks to pass..." + aws ec2 wait instance-status-ok --instance-ids $INSTANCE_ID + echo "Instance is now ready for use." + + + check_simulator_version_updates: + name: check_simulator_version_updates + runs-on: ubuntu-latest + needs: start_ec2_instance + steps: + - name: Check for Simulator Version Updates + env: + PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + HOSTNAME: ${{ secrets.SSH_HOST }} + USER_NAME: ${{ secrets.SSH_USERNAME }} + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + GH_REF: ${{ github.ref }} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + ssh -o StrictHostKeyChecking=no -o SendEnv=GH_REF -i private_key ${USER_NAME}@${HOSTNAME} ' + cd /home/ubuntu/actions/ && + rm -rf Scenic && + git clone --branch $(basename "$GH_REF") --single-branch https://$GH_ACCESS_TOKEN@github.com/BerkeleyLearnVerify/Scenic.git && + cd Scenic && + python3 -m venv venv && + source venv/bin/activate && + python3 -m pip install -e .[test-full] && + python3 .github/check_latest_simulators.py + ' + + check_nvidia_smi: + name: check_nvidia_smi + runs-on: ubuntu-latest + needs: start_ec2_instance + continue-on-error: true + steps: + - name: Check NVIDIA SMI + env: + PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + HOSTNAME: ${{ secrets.SSH_HOST}} + USER_NAME: ${{ secrets.SSH_USERNAME}} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} ' + output=$(nvidia-smi) + echo "$output" + if [ -z "$output" ]; then + echo "NVIDIA Driver is not set" exit 1 - ;; - Pending|InProgress|Delayed) - sleep 10 - ;; - esac - done - aws ssm get-command-invocation \ - --command-id "$command_id" \ - --instance-id "$INSTANCE_ID" \ - --query 'StandardOutputContent' \ - --output text - stop_ec2_instance: - name: stop_ec2_instance - runs-on: ubuntu-latest - permissions: - id-token: write - needs: - [ - start_ec2_instance, - check_simulator_version_updates, - check_nvidia_smi, - run_carla_simulators, - run_webots_simulators, - ] - if: always() - env: - VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }} - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 - with: - role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} - aws-region: ${{ secrets.AWS_REGION }} - allowed-account-ids: ${{ secrets.AWS_ACCOUNT_ID }} + fi + ' + - name: NVIDIA Driver is not set + if: ${{ failure() }} + run: | + echo "NVIDIA SMI is not working, please run the steps here on the instance:" + echo "https://scenic-lang.atlassian.net/wiki/spaces/KAN/pages/2785287/Setting+Up+AWS+VM?parentProduct=JSW&initialAllowedFeatures=byline-contributors.byline-extensions.page-comments.delete.page-reactions.inline-comments.non-licensed-share&themeState=dark%253Adark%2520light%253Alight%2520spacing%253Aspacing%2520colorMode%253Alight&locale=en-US#Install-NVIDIA-Drivers" + + run_carla_simulators: + name: run_carla_simulators + runs-on: ubuntu-latest + needs: [check_simulator_version_updates, check_nvidia_smi] + steps: + - name: Run CARLA Tests + env: + PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + HOSTNAME: ${{secrets.SSH_HOST}} + USER_NAME: ${{secrets.SSH_USERNAME}} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -i private_key ${USER_NAME}@${HOSTNAME} ' + cd /home/ubuntu/actions/Scenic && + source venv/bin/activate && + carla_versions=($(find /software -maxdepth 1 -type d -name 'carla*')) && + for version in "${carla_versions[@]}"; do + echo "============================= CARLA $version =============================" + export CARLA_ROOT="$version" + pytest tests/simulators/carla + done + ' + + run_webots_simulators: + name: run_webots_simulators + runs-on: ubuntu-latest + needs: [check_simulator_version_updates, check_nvidia_smi] + steps: + - name: Run Webots Tests + env: + PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + HOSTNAME: ${{secrets.SSH_HOST}} + USER_NAME: ${{secrets.SSH_USERNAME}} + run: | + echo "$PRIVATE_KEY" > private_key && chmod 600 private_key + ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} ' + Xvfb :99 -screen 0 1024x768x16 & + cd /home/ubuntu/actions/Scenic && + source venv/bin/activate && + webots_versions=($(find /software -maxdepth 1 -type d -name 'webots*')) && + export DISPLAY=:99 && + for version in "${webots_versions[@]}"; do + echo "============================= Webots $version =============================" + export WEBOTS_ROOT="$version" + pytest tests/simulators/webots + done + kill %1 + ' + + stop_ec2_instance: + name: stop_ec2_instance + runs-on: ubuntu-latest + needs: [start_ec2_instance, check_simulator_version_updates, check_nvidia_smi, run_carla_simulators, run_webots_simulators] + if: always() + env: + VOLUME_ID: ${{ needs.start_ec2_instance.outputs.volume_id }} + INSTANCE_ID: ${{ secrets.AWS_EC2_INSTANCE_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} + steps: + - name: Stop EC2 Instance + run: | + # Get the instance state and stop it if running + instance_state=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID | jq -r '.Reservations[].Instances[].State.Name') + if [[ "$instance_state" == "running" ]]; then + echo "Instance is running, stopping it..." + aws ec2 stop-instances --instance-ids $INSTANCE_ID + aws ec2 wait instance-stopped --instance-ids $INSTANCE_ID + echo "Instance has stopped." + elif [[ "$instance_state" == "stopped" ]]; then + echo "Instance is already stopped." + else + echo "Unexpected instance state: $instance_state" + exit 1 + fi + + - name: Detach Volume + run: | + # Detach the volume + aws ec2 detach-volume --volume-id $VOLUME_ID + aws ec2 wait volume-available --volume-ids $VOLUME_ID + echo "Volume $VOLUME_ID detached." - - name: Stop EC2 Instance - run: | - # Get the instance state and stop it if running - instance_state=$(aws ec2 describe-instances --instance-ids "$INSTANCE_ID" | jq -r '.Reservations[].Instances[].State.Name') - if [ "$instance_state" = "running" ]; then - echo "Instance is running, stopping it..." - aws ec2 stop-instances --instance-ids "$INSTANCE_ID" - aws ec2 wait instance-stopped --instance-ids "$INSTANCE_ID" - echo "Instance has stopped." - elif [ "$instance_state" = "stopped" ]; then - echo "Instance is already stopped." - else - echo "Unexpected instance state: $instance_state" - exit 1 - fi - - name: Detach Volume - if: ${{ needs.start_ec2_instance.outputs.volume_id != '' }} - run: | - # Detach the volume - aws ec2 detach-volume --volume-id "$VOLUME_ID" - aws ec2 wait volume-available --volume-ids "$VOLUME_ID" - echo "Volume $VOLUME_ID detached." - - name: Delete Volume - if: ${{ needs.start_ec2_instance.outputs.volume_id != '' }} - run: | - # Delete the volume after snapshot is complete - aws ec2 delete-volume --volume-id "$VOLUME_ID" - echo "Volume $VOLUME_ID deleted." + - name: Delete Volume + run: | + # Delete the volume after snapshot is complete + aws ec2 delete-volume --volume-id $VOLUME_ID + echo "Volume $VOLUME_ID deleted." From 49c3f93dd509f049c219b482d8b60d8131b9cd56 Mon Sep 17 00:00:00 2001 From: Daniel Fremont Date: Wed, 10 Jun 2026 13:14:26 -0700 Subject: [PATCH 13/13] fix handling of unset CARLA_ROOT --- tests/simulators/carla/test_actions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/simulators/carla/test_actions.py b/tests/simulators/carla/test_actions.py index e58f773e5..ac29bf253 100644 --- a/tests/simulators/carla/test_actions.py +++ b/tests/simulators/carla/test_actions.py @@ -23,10 +23,13 @@ def checkCarlaPath(): - CARLA_ROOT = Path(os.environ.get("CARLA_ROOT", "")) - if not CARLA_ROOT.exists(): + 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):