-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6884200
commit 2616d21
Showing
16 changed files
with
179 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<scenarios> | ||
<scenario name="ControlLoss_1" type="ControlLoss" town="Town01"> | ||
<ego_vehicle x="392.5" y="195" z="0.5" yaw="90" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_2" type="ControlLoss" town="Town01"> | ||
<ego_vehicle x="-2.0" y="160" z="0.5" yaw="90" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_3" type="ControlLoss" town="Town01"> | ||
<ego_vehicle x="168.9" y="59.8" z="0.5" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_4" type="ControlLoss" town="Town02"> | ||
<ego_vehicle x="27" y="110" z="0.22" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_5" type="ControlLoss" town="Town02"> | ||
<ego_vehicle x="54.8" y="307.2" z="0.22" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_6" type="ControlLoss" town="Town02"> | ||
<ego_vehicle x="57.4" y="191.7" z="0.5" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_7" type="ControlLoss" town="Town03"> | ||
<ego_vehicle x="15" y="207.5" z="2" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_8" type="ControlLoss" town="Town03"> | ||
<ego_vehicle x="-74" y="-12" z="0.1" yaw="270" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_9" type="ControlLoss" town="Town03"> | ||
<ego_vehicle x="-85.1" y="-87.4" z="0.3" yaw="89" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_10" type="ControlLoss" town="Town04"> | ||
<ego_vehicle x="218.4" y="193" z="0" yaw="338" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_11" type="ControlLoss" town="Town04"> | ||
<ego_vehicle x="-40.4" y="-229.5" z="0" yaw="131" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_12" type="ControlLoss" town="Town04"> | ||
<ego_vehicle x="-45" y="37.2" z="11" yaw="0" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_13" type="ControlLoss" town="Town05"> | ||
<ego_vehicle x="90.9" y="-66" z="0" yaw="67" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_14" type="ControlLoss" town="Town05"> | ||
<ego_vehicle x="-54.7" y="110.9" z="0.1" yaw="90" model="vehicle.lincoln.mkz_2017" /> | ||
</scenario> | ||
<scenario name="ControlLoss_15" type="ControlLoss" town="Town05"> | ||
<ego_vehicle x="119.1" y="-142.7" z="0.1" yaw="-170" model="vehicle.lincoln.mkz_2017" /> | ||
<scenario name="ControlLoss_1" type="ControlLoss" town="Town10HD_Opt"> | ||
<ego_vehicle x="-17" y="140" z="0.5" yaw="0" model="vehicle.lincoln.mkz" /> | ||
</scenario> | ||
</scenarios> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,47 @@ | ||
""" Scenario Description | ||
Traffic Scenario 04. | ||
Obstacle avoidance without prior action. | ||
The ego-vehicle encounters an obstacle / unexpected entity on the road and must perform an | ||
emergency brake or an avoidance maneuver. | ||
""" | ||
|
||
## SET MAP AND MODEL (i.e. definitions of all referenceable vehicle types, road library, etc) | ||
param map = localPath('assets/Town10HD_Opt.xodr') | ||
param carla_map = 'Town10HD_Opt' | ||
model srunner.scenic.models.model | ||
|
||
## CONSTANTS | ||
EGO_MODEL = "vehicle.lincoln.mkz" | ||
BICYCLE_MIN_SPEED = 1.5 | ||
THRESHOLD = 18 | ||
PEDESTRIAN_MIN_SPEED = 15 | ||
THRESHOLD = 25 | ||
BRAKE_ACTION = 1.0 | ||
SAFETY_DISTANCE = 10 | ||
SAFETY_DISTANCE = 25 | ||
|
||
## DEFINING BEHAVIORS | ||
behavior EgoBehavior(trajectory): | ||
try: | ||
do FollowTrajectoryBehavior(trajectory = trajectory) | ||
do FollowTrajectoryBehavior(target_speed=7, trajectory=trajectory) | ||
terminate | ||
|
||
interrupt when withinDistanceToObjsInLane(self, SAFETY_DISTANCE): | ||
take SetBrakeAction(BRAKE_ACTION) | ||
|
||
behavior BicycleBehavior(speed=3, threshold=15): | ||
behavior PedestrianBehavior(speed=1, threshold=15): | ||
do CrossingBehavior(ego, speed, threshold) | ||
|
||
## DEFINING SPATIAL RELATIONS | ||
# make sure to put '*' to uniformly randomly select from all elements of the list | ||
intersec = Uniform(*network.intersections) | ||
startLane = Uniform(*intersec.incomingLanes) | ||
maneuver = Uniform(*startLane.maneuvers) | ||
ego_trajectory = [maneuver.startLane, maneuver.connectingLane, maneuver.endLane] | ||
|
||
# Get the ego manuever | ||
maneuvers = filter(lambda i: i.type != ManeuverType.STRAIGHT, startLane.maneuvers) | ||
maneuver = Uniform(*maneuvers) | ||
trajectory = [maneuver.startLane, maneuver.connectingLane, maneuver.endLane] | ||
|
||
spot = new OrientedPoint in maneuver.startLane.centerline | ||
ego = new Car at spot, | ||
with blueprint EGO_MODEL, | ||
with behavior EgoBehavior(trajectory = ego_trajectory) | ||
with behavior EgoBehavior(trajectory=trajectory) | ||
|
||
spotBicycle = new OrientedPoint in maneuver.endLane.centerline, | ||
spotPedestrian = new OrientedPoint in maneuver.endLane.centerline, | ||
facing roadDirection | ||
bicycle = new Bicycle at spotBicycle offset by 3.5@0, | ||
with heading 90 deg relative to spotBicycle.heading, | ||
with behavior BicycleBehavior(BICYCLE_MIN_SPEED, THRESHOLD), | ||
Pedestrian = new Pedestrian at spotPedestrian offset by 3.5@0, | ||
with heading 90 deg relative to spotPedestrian.heading, | ||
with behavior PedestrianBehavior(PEDESTRIAN_MIN_SPEED, THRESHOLD), | ||
with regionContainedIn None | ||
|
||
require (maneuver.endLane.sections[0]._slowerLane is None) | ||
require 10 <= (distance to intersec) <= 15 | ||
require 10 <= (distance from bicycle to intersec) <= 15 | ||
terminate when (distance to spot) > 50 | ||
require 10 <= (distance from Pedestrian to intersec) <= 20 | ||
terminate when (distance to intersec) >= 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.