diff --git a/examples/carla/Carla_Challenge/carlaChallenge10.scenic b/examples/carla/Carla_Challenge/carlaChallenge10.scenic index b4bad7355..8a63f5d27 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge10.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge10.scenic @@ -55,6 +55,6 @@ ego = Car at ego_spawn_pt, adversary = Car at adv_spawn_pt, with behavior AdversaryBehavior(adv_trajectory) -require (distance to intersec) in Range(15, 20) +require (distance to intersec) in Range(20, 25) require (distance from adversary to intersec) in Range(15, 20) terminate when (distance to ego_spawn_pt) > 70 diff --git a/examples/carla/Carla_Challenge/carlaChallenge4.scenic b/examples/carla/Carla_Challenge/carlaChallenge4.scenic index 0f641edcf..69cde2479 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge4.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge4.scenic @@ -47,6 +47,6 @@ bicycle = Bicycle at spotBicycle offset by 3.5@0, with behavior BicycleBehavior(BICYCLE_MIN_SPEED, THRESHOLD), with regionContainedIn None -require (distance to intersec) in Range(10, 25) +require (distance to intersec) in Range(10, 15) require (distance from bicycle to intersec) in Range(10, 15) terminate when (distance to spot) > 50 diff --git a/examples/carla/Carla_Challenge/carlaChallenge6.scenic b/examples/carla/Carla_Challenge/carlaChallenge6.scenic index 5c8bb1cdd..17affb94e 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge6.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge6.scenic @@ -6,8 +6,8 @@ traffic """ ## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) -param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town07.xodr') # or other CARLA map that definitely works -param carla_map = 'Town07' +param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works +param carla_map = 'Town01' model scenic.simulators.carla.model ## CONSTANTS @@ -16,7 +16,7 @@ EGO_SPEED = 7 ONCOMING_CAR_SPEED = 10 BLOCKING_CAR_DIST = Range(15, 20) BREAK_INTENSITY = 0.8 -DIST_THRESHOLD = 13 +DIST_THRESHOLD = 15 ## DEFINING BEHAVIORS behavior EgoBehavior(): @@ -69,6 +69,6 @@ blockingCar = Car following roadDirection for BLOCKING_CAR_DIST, ## EXPLICIT HARD CONSTRAINTS require blockingCar can see oncomingCar -require (distance from blockingCar to oncomingCar) < 10 -require (distance from blockingCar to intersection) > 10 +require (distance from blockingCar to oncomingCar) in Range(5, 15) +require (distance from blockingCar to intersection) > 50 require (ego.laneSection.isForward != oncomingCar.laneSection.isForward) \ No newline at end of file diff --git a/examples/carla/Carla_Challenge/carlaChallenge7.scenic b/examples/carla/Carla_Challenge/carlaChallenge7.scenic index 2a2cec8aa..6a959af28 100644 --- a/examples/carla/Carla_Challenge/carlaChallenge7.scenic +++ b/examples/carla/Carla_Challenge/carlaChallenge7.scenic @@ -77,4 +77,4 @@ adversary = Car at adv_spawn_pt, require (distance to intersec) in Range(15, 20) require (distance from adversary to intersec) in Range(10, 15) -terminate when (distance to ego_spawn_pt) > 70 \ No newline at end of file +terminate when (distance to ego_spawn_pt) > 70 diff --git a/examples/carla/manual_control.py b/examples/carla/manual_control.py index 09aa89ced..a852c9e99 100755 --- a/examples/carla/manual_control.py +++ b/examples/carla/manual_control.py @@ -50,6 +50,7 @@ ESC : quit """ + from __future__ import print_function # ============================================================================== @@ -164,7 +165,7 @@ def restart(self): print("Ego vehicle found") self.player = vehicle break - + self.player_name = self.player.type_id # Set up the sensors. @@ -174,7 +175,9 @@ def restart(self): def tick(self, clock): if len(self.world.get_actors().filter(self.player_name)) < 1: - return False + self.player = None + self.destroy() + self.restart() self.hud.tick(self, clock) return True diff --git a/examples/carla/manual_control/carlaChallenge1.scenic b/examples/carla/manual_control/carlaChallenge1.scenic index ab4276740..2c9ff4fce 100644 --- a/examples/carla/manual_control/carlaChallenge1.scenic +++ b/examples/carla/manual_control/carlaChallenge1.scenic @@ -8,6 +8,7 @@ its original lane. ## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works param carla_map = 'Town01' +param render = '0' model scenic.simulators.carla.model ## CONSTANTS diff --git a/examples/carla/manual_control/carlaChallenge3_dynamic.scenic b/examples/carla/manual_control/carlaChallenge3_dynamic.scenic index 4d39b9e14..f2fcec916 100644 --- a/examples/carla/manual_control/carlaChallenge3_dynamic.scenic +++ b/examples/carla/manual_control/carlaChallenge3_dynamic.scenic @@ -8,6 +8,7 @@ emergency brake or an avoidance maneuver. # SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town05.xodr') # or other CARLA map that definitely works param carla_map = 'Town05' +param render = '0' model scenic.simulators.carla.model # CONSTANTS diff --git a/examples/carla/manual_control/carlaChallenge4.scenic b/examples/carla/manual_control/carlaChallenge4.scenic index aa031405c..5635ca9ac 100644 --- a/examples/carla/manual_control/carlaChallenge4.scenic +++ b/examples/carla/manual_control/carlaChallenge4.scenic @@ -8,6 +8,7 @@ emergency brake or an avoidance maneuver. ## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town01.xodr') # or other CARLA map that definitely works param carla_map = 'Town01' +param render = '0' model scenic.simulators.carla.model ## CONSTANTS @@ -26,7 +27,8 @@ startLane = Uniform(*intersec.incomingLanes) maneuver = Uniform(*startLane.maneuvers) ego_trajectory = [maneuver.startLane, maneuver.connectingLane, maneuver.endLane] -ego = Car in maneuver.startLane.centerline, +spot = OrientedPoint in maneuver.startLane.centerline +ego = Car at spot, with blueprint EGO_MODEL, with rolename 'hero' @@ -39,4 +41,4 @@ bicycle = Bicycle at spotBicycle offset by 3.5@0, require (distance to intersec) in Range(10,25) require (distance from bicycle to intersec) in Range(5, 10) -terminate when (distance to spot) > 50 \ No newline at end of file +terminate when (distance to spot) > 50 diff --git a/examples/carla/manual_control/carlaChallenge7.scenic b/examples/carla/manual_control/carlaChallenge7.scenic index 317c5151a..c23ddbe12 100644 --- a/examples/carla/manual_control/carlaChallenge7.scenic +++ b/examples/carla/manual_control/carlaChallenge7.scenic @@ -8,6 +8,7 @@ forcing the ego-vehicle to avoid the collision. ## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town05.xodr') # or other CARLA map that definitely works param carla_map = 'Town05' +param render = '0' model scenic.simulators.carla.model ## CONSTANTS