Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.9.15 merge #1032

Merged
merged 91 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
c64b186
New parsing (#858)
glopezdiest Feb 16, 2022
cf48714
Improve actor flow scenarios (#859)
glopezdiest Feb 16, 2022
a51e9c8
Changes in Actor Flow, implementation of Accident and Construction, c…
jackbart94 Mar 1, 2022
d61329d
Changed ActorFlow to use the TrafficManager
glopezdiest Mar 9, 2022
5c2f349
Routes can now have scenario specific criterias
glopezdiest Mar 11, 2022
2c87574
Scenarios are now route specific
glopezdiest Mar 14, 2022
723878f
Added urban bicycle flow prototype
glopezdiest Mar 16, 2022
1fb6b99
Added CHANGELOG (#870)
glopezdiest Mar 16, 2022
b82a681
Added VehicleOpensDoor scenario
glopezdiest Mar 18, 2022
e86b492
Minor changes
Mar 23, 2022
38cec5a
Fixed bug with new JucntionScenarioManager (#873)
glopezdiest Mar 23, 2022
3f63408
Added dynamic weathers to routes
glopezdiest Mar 25, 2022
92ec277
Improved traffic event handling (#877)
glopezdiest Apr 7, 2022
b784326
Added HighwayExit scenario
TayYim Apr 21, 2022
b424bea
Added minimum speed criteria
glopezdiest Apr 25, 2022
e42c950
Pretty code
Apr 25, 2022
1d6138b
New Parking Exit scenario
TayYim Apr 27, 2022
5835f09
General improvements (#884)
glopezdiest May 2, 2022
d467860
Improve bycicle flow scenario
glopezdiest May 4, 2022
8b223b6
Changed BA 'RemoveLane' for 'SwitchLane'
TayYim May 6, 2022
da308d8
New LB2.0 scenario improvements
glopezdiest May 9, 2022
7a4f9a8
Refined BA's target speed
glopezdiest May 10, 2022
dc6367a
Added HighwayCutIn scenario
glopezdiest May 10, 2022
f8c79fa
Added Idle (#898)
glopezdiest May 20, 2022
69c2ef7
Added ParkingCutIn scenario
glopezdiest May 23, 2022
a40f593
New MergerIntoSlowTraffic scenario
13370724230 May 25, 2022
26f6f7c
Improve night mode (#902)
glopezdiest May 27, 2022
6211150
Add yield to emergency vehicle scenario
TayYim Jun 2, 2022
492ac3b
Add new scenario PedestrianCrossing
TayYim Jun 15, 2022
5b4fb77
New Blocked intersection scenario
TayYim Jun 17, 2022
14ae69e
Added InvadingTurn scenario
TayYim Jun 30, 2022
441033a
Added Static cut in scenario
May-fang Jul 4, 2022
9a7b909
Added BicycleAtSideLane scenario
threewater-wang Jul 4, 2022
84a8c52
Improved route's timeout
glopezdiest Jul 4, 2022
716195e
Leaderboard 2.0 scenario improvements
glopezdiest Jul 4, 2022
21be2d5
Fixed several merge errors
glopezdiest Jul 5, 2022
098a00c
New scenario improvements
glopezdiest Jul 7, 2022
f2cfed2
Removed debug messages
Jul 7, 2022
850eed8
Added scenario timeouts
glopezdiest Jul 12, 2022
93ec2dc
Added frame to traffic events
joel-mb Jul 12, 2022
4fd3009
Added realtime to OutsideRouteLanesTest
glopezdiest Jul 14, 2022
aab83e1
More Leaderboard 2.0 scenario improvements
glopezdiest Jul 26, 2022
05ef0d7
Route obstacles + parked vehicle destruction
Jul 30, 2022
7ccbe74
Scenarios no longer spawn old vehicles
Aug 1, 2022
d63f73d
Added variable flow to route obstacles
Aug 3, 2022
ce3ae65
Added VehicleTurningRotue variations
Aug 8, 2022
da0da43
Added noise to control loss
Aug 12, 2022
d8a251d
Route improvements
Aug 17, 2022
4e93320
MinSpeed criteria checkpoints + Pedestrian patch
Aug 19, 2022
ee68a08
Fix bug PedestrianCrossing
Aug 19, 2022
b90c3d9
Fixed bug pedestrians and parked vehicles (#933)
joel-mb Sep 4, 2022
dbf92a1
Removed old test routes
Sep 15, 2022
13cf802
Fixed bug with YieldtoEV criteria
Sep 16, 2022
e1f82c5
Minor parameter changes
Sep 19, 2022
d706535
Improved scenarios
Oct 11, 2022
5b3c267
Added hand brake to BlockedIntersection
Oct 11, 2022
155c416
Revereted some of the constructions changes
Oct 13, 2022
30d2e2c
Some parameter changes
Oct 14, 2022
5cbc9b6
Removed unused code
Oct 14, 2022
27070a4
Prettyfied some criteria
Oct 17, 2022
cf8590e
Fixed units bug
Oct 17, 2022
97c7908
Parameter change
Oct 18, 2022
65384e8
Changed opposite flow parameters
Oct 18, 2022
e719626
Minor robustness changes
Oct 19, 2022
2f5dd36
Removed police car from several scenarios
Oct 27, 2022
292b717
Updated highway cut in parameters
Oct 28, 2022
7b5894c
Final parameter changes + some minor BA changes
Nov 4, 2022
1cff6c2
Added vehicle opens door stop
Feb 22, 2023
e7b120f
Fixed VehicleOpensDoor
Mar 3, 2023
343559b
Added ActroFlow patch
Mar 28, 2023
9f9e0cc
Minor sensor destruction change
Mar 31, 2023
d1fe95e
Changes numpy version to match CARLA's
Apr 12, 2023
ce20af7
Minor fix
Apr 18, 2023
b58d582
Added tm ports to BA
Apr 19, 2023
e1690b5
Added the port to all set autopilots
Apr 19, 2023
9c83ff4
Minor improvement to result writer and debug
Apr 21, 2023
ddc57c6
Added missing sensor destruction
Apr 21, 2023
c01e405
Added spawn transforms to CDP actors
May 18, 2023
b940d55
Added ratio to min speed
Jun 13, 2023
75bfc05
fix duplicate env initialization during runtime
TayYim May 15, 2023
eef90d3
check location in DriveDistance
TayYim May 18, 2023
2a30a1a
add is_runtime_init_mode process
TayYim Jun 21, 2023
4f8a4bf
fix weather
TayYim Jun 27, 2023
8b0d4f5
Added ScenariOTrigger blackboard
Jun 27, 2023
ff085e5
removed whitespaces
glopezdiest Jun 27, 2023
7e2dc40
Added a lock at CDP
Jun 30, 2023
df869fb
Added Leaderboard 2.0 changelog
Jul 18, 2023
0e99deb
Added Leaderboard 2.0 routes
Jul 18, 2023
d19056b
Fixed bug with MinimumSpeedRouteTest
Sep 7, 2023
c3a29e3
Merge branch 'leaderboard-2.0'
Nov 16, 2023
c39aa59
Added Release 0.9.15
Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 88 additions & 5 deletions Docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Table of Contents
* [Latest Changes](#latest-changes)
* [CARLA ScenarioRunner 0.9.15](#carla-scenariorunner-0915)
* [CARLA ScenarioRunner 0.9.13](#carla-scenariorunner-0913)
* [CARLA ScenarioRunner 0.9.12](#carla-scenariorunner-0912)
* [CARLA ScenarioRunner 0.9.11](#carla-scenariorunner-0911)
Expand All @@ -12,18 +12,100 @@
* [CARLA ScenarioRunner 0.9.5](#carla-scenariorunner-095)
* [CARLA ScenarioRunner 0.9.2](#carla-scenariorunner-092)

## Latest changes
## CARLA ScenarioRunner 0.9.15
### :rocket: New Features
* Minor improvements to some example scenarios. These include FollowLeadingVehicle, VehicleTurning, DynamicObjectCrossing and SignalizedJunctionRightTurn and RunningRedLight. Their behaviors are now more smooth, robust and some outdated mechanics have been removed
* SignalizedJunctionLeftTurn has been remade. It now has an actor flow on which the ego has to merge into, instead of a single vehicle.
* The BackgroundActivity has been readded to the routes, which the objective of creating the sensation of traffic around the ego
* Add waypoint reached threshold so that the precision of the actor reaching to waypoints can be adjusted based on object types.
* OpenSCENARIO support:
- Added both init and story support for `EntityAction`
- Added story support for `TrafficSignalControllerAction`
- Added both init and story support for `LateralDistanceAction`
- Added support for `TrafficSignalControllerCondition`
* Supported OpenSCENARIO 2.0 standard.
* New scenarios:
- InvadingTurn: vehicles at the opposite direction lane partially invade the ego's one, forcing it to leave space for them,moving slightly off-center.
- EnterActorFlow: the ego has to enter a highway lane filled with incoming traffic
- MergerIntoslowtraffic. variation of `EnterActorFlow` but with slow traffic.
- InterurbanActorFlow and InterurbanAdvancedActorFlow: actor flow scenarios for the new interurban intersections with dedicated lanes present at Town12 and Town13.
- Accident: the ego is met with an accident, forcing it to lane change to avoid it.
- AccidentTwoWays: same as `Accident` but having to invade an opposite direction lane.
- ParkedObstacle: similar to `Accident` but with a parked obstacle instead.
- ParkedObstacleTwoWays: same as `ParkedObstacle` but having to invade an opposite direction lane.
- HazardAtSideLane: similar to `Accident` but with a moving group of bicycles in the rightmost park of the lane
- HazardAtSideLaneTwoWays: same as `HazardAtSideLane` but having to invade an opposite direction lane.
- ConstructionObstacleTwoWays: same as `ConstructionObstacle` but having to invade an opposite direction lane.
- VehicleOpensDoorTwoWays: similar to `Accident` but this time the blockage is cause by a vehicle opening its door.
- StaticCutIn: the ego is meant with an adversary that exits a stopped lane, cutting in front of the ego.
- ParkingCutIn: similar to `StaticCutIn` but the adversary starts at a parking lane.
- HighwayCutIn: the ego is met with a vehicle that tries to enter the highway by cutting in front of it.
- ParkingExit: Only usable at the beginning of the routes, makes the ego start at a parking lane.
- HardBreakRoute: uses the BackgroundActivity to make all vehicles in front of the ego hard break.
- YieldToEmergencyVehicle: the ego finds an emergency vehicle behind, having to lane chane to give way.
- VehicleTurningRoutePedestrian: variation of `VehicleTurningRoute` but with a pedestrian crossing instead of a bycicle.
- BlockedIntersection: with low visibility, the ego performs a turn only to find out that the end is blocked by another vehicle.
- CrossingBicycleFlow: the ego has to do a turn at an intersection but it has to cross a bycicle lane full of traffic.
- PedestrianCrossing: a group of pedestrians crossing a crosswalk. Easier version of `DynamicObjectCrossing` with no occluder.
- ParkingCrossingPedestrian: variation of `DynamicObjectCrossing`, but using a parked vehicle as the occluder.
- OppositeVehicleTakingPriority: variation of `OppositeVehicleRunningRedLight` but without traffic lights.
- NonSignalizedJunctionLeftTurn: variation of `SignalizedJunctionLeftTurn` but without traffic lights.
- NonSignalizedJunctionRightTurn: variation of `SignalizedJunctionRightTurn` but without traffic lights.
- PriorityAtJunction: utility scenario during routes to add a green traffic light at the next intersection.
- NoSignalJunctionCrossingRoute: Does nothing but wait for the ego to exit an intersection.
* Improvements to old scenarios:
- ControlLoss: Added actual noise to the ego's control (currently only during routes).
- All VehicleTurning variations: more robustness and better synchronization.
- OppositeVehicleRunningRedLight: Improvement synchronization and the opposite vehicle's behavior.
- SignalizedJunctionLeftTurn: it is now an actor flow that ego has to cross.
- SignalizedJunctionRightTurn. it is now an actor flow that the ego has to merge into.
- Renamed `ConstructionSetupCrossing` to `ConstructionObstacle`, and prepared it for routes.
* Improvements to the CarlaDataProvider:
- Added a lock when checking the dictionaries to avoid issues in multithreading
- Added the `transform` argument to all register function to avoid returning None during the first frame
- Added the `get_global_route_planner` and `get_all_actors` to avoid repeating these costly calls more than necessary
- Added `set_runtime_init_mode` and `is_runtime_init_mode`, used by the Leaderboard to initialize scenarios during the simulation
- At the `create_blueprint` function, replaced the `safe` argument with the `attribute_filter`, for a more generic parsing of any of the blueprint attributes.
- Removed the `CarlaDataProvider.get_ego_vehicle_route()` and `CarlaDataProvider.set_ego_vehicle_route()` functions as this is now information available to all scenarios.
* Improvements to the routes:
- Scenarios are no longer position based, but instead part of a route's xml.
- Routes now also include the criteria of its scenarios.
- `waypoint` have been renamed to `position` and are part of the `waypoints` category.
- More than one `weather` are allowed, creating a dynamic one based on the ego vehicle's completed percentage of the route.
- Changed the timeout to also be dependent on the distance driven by the ego vehicle.
- Added the `RouteLightsBehavior` to control of all scene and vehicle lights during runtime
- Added a new criteria for routes, `CheckMinSpeed`, that checks the ego's speed and compares it with the rest of the traffic
- Separated the route argument into two, `route` for the file path, and `route-id`, for the name of route. the functionality remains unchanged.
- Simplified the overall parsing.
* The BackgroundActivity part of the routes has been completely remade, with the objective of creating the sensation of traffic around the ego will increasing the performance
* Added a Backgroundmanager to interact with the new BackgroundActivity, to allow it to adapt to incoming scenarios
* Added new atomic behaviors:
- SyncArrivalWithAgent
- CutIn
- AddNoiseToRouteEgo
- ConstantVelocityAgentBehavior
- AdaptiveConstantVelocityAgentBehavior
- WaitForever
- BatchActorTransformSetter
- OppositeActorFlow
- InvadingActorFlow
- BicycleFlow
- OpenVehicleDoor
- SwitchWrongDirectionTest
- SwitchMinSpeedCriteria
- WalkerFlow
- AIWalkerBehavior
- ScenarioTimeout
- MovePedestrianWithEgo
* Improved the Criterion class for a more comprehensive base criteria and easier use in the `results_writer` class.
* Added new atomic criteria:
- MinimumSpeedRouteTest
- YieldToEmergencyVehicleTest
- ScenarioTimeoutTest
* Added new atomic trigger conditions
- WaitUntilInFrontPosition
* Merged the `Scenario` class into the `BasicScenario` one.
* Scenarios can now have parameters as part of the their xml definition, which is saved as a dictionary at `config.other_parameters`
* Simplified and improved how routes are parsed.
* Added the `wait-for-repetitions` argument at the manual control for a smoother transition between scenarios / repetitions
* Updated numpy's version to avoid issues with newer version of Python 3

### :bug: Bug Fixes
* Fixed bug at OtherLeadingVehicle scenario causing the vehicles to move faster than intended
Expand Down Expand Up @@ -459,3 +541,4 @@
- WaitForTrafficLightState: wait for the traffic light to have a given state
- SyncArrival: sync the arrival of two vehicles to a given target
- AddNoiseToVehicle: Add noise to steer as well as throttle of the vehicle
- CutInWithStaticVehicle:Based on the code of ParkingCutIn,realized the cutin function of a static vehicle on the highway
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ branch contains the latest fixes and features, and may be required to use the la

It is important to also consider the release version that has to match the CARLA version.

* [Version 0.9.15](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.15) and the 0.9.15 Branch: Compatible with [CARLA 0.9.15](https://github.com/carla-simulator/carla/releases/tag/0.9.15)
* [Version 0.9.13](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.13) and the 0.9.13 Branch: Compatible with [CARLA 0.9.13](https://github.com/carla-simulator/carla/releases/tag/0.9.13)
* [Version 0.9.12](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.12) and the 0.9.12 Branch: Compatible with [CARLA 0.9.12](https://github.com/carla-simulator/carla/releases/tag/0.9.12)
* [Version 0.9.11](https://github.com/carla-simulator/scenario_runner/releases/tag/v0.9.11) and the 0.9.11 Branch: Compatible with [CARLA 0.9.11](https://github.com/carla-simulator/carla/releases/tag/0.9.11)
Expand Down
31 changes: 13 additions & 18 deletions manual_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
from pygame.locals import K_F1
from pygame.locals import KMOD_CTRL
from pygame.locals import KMOD_SHIFT
from pygame.locals import K_BACKSPACE
from pygame.locals import K_TAB
from pygame.locals import K_SPACE
from pygame.locals import K_UP
Expand Down Expand Up @@ -114,8 +113,6 @@ def get_actor_display_name(actor, truncate=250):

class World(object):

restarted = False

def __init__(self, carla_world, hud, args):
self.world = carla_world
try:
Expand All @@ -140,10 +137,6 @@ def __init__(self, carla_world, hud, args):

def restart(self, args):

if self.restarted:
return
self.restarted = True

self.player_max_speed = 1.589
self.player_max_speed_fast = 3.713

Expand All @@ -161,7 +154,7 @@ def restart(self, args):
print("Ego vehicle found")
self.player = vehicle
break

self.player_name = self.player.type_id

# Set up the sensors.
Expand All @@ -177,9 +170,14 @@ def restart(self, args):

self.world.wait_for_tick()

def tick(self, clock):
def tick(self, clock, wait_for_repetitions):
if len(self.world.get_actors().filter(self.player_name)) < 1:
return False
if not wait_for_repetitions:
return False
else:
self.player = None
self.destroy()
self.restart()

self.hud.tick(self, clock)
return True
Expand Down Expand Up @@ -232,13 +230,6 @@ def parse_events(self, client, world, clock):
elif event.type == pygame.KEYUP:
if self._is_quit_shortcut(event.key):
return True
elif event.key == K_BACKSPACE:
if self._autopilot_enabled:
world.player.set_autopilot(False)
world.restart()
world.player.set_autopilot(True)
else:
world.restart()
elif event.key == K_F1:
world.hud.toggle_info()
elif event.key == K_TAB:
Expand Down Expand Up @@ -917,7 +908,7 @@ def game_loop(args):
clock.tick_busy_loop(60)
if controller.parse_events(client, world, clock):
return
if not world.tick(clock):
if not world.tick(clock, args.wait_for_repetitions):
return
world.render(display)
pygame.display.flip()
Expand Down Expand Up @@ -978,6 +969,10 @@ def main():
'--keep_ego_vehicle',
action='store_true',
help='do not destroy ego vehicle on exit')
argparser.add_argument(
'--wait-for-repetitions',
action='store_true',
help='Avoids stopping the manual control when the scenario ends.')
args = argparser.parse_args()

args.width, args.height = [int(x) for x in args.res.split('x')]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
py-trees==0.8.3
numpy==1.18.4; python_version >= '3.0'
networkx==2.2
Shapely==1.7.1
psutil
xmlschema==1.0.18
ephem
tabulate
opencv-python==4.2.0.32
numpy
matplotlib
six
simple-watchdog-timer
Expand Down
35 changes: 15 additions & 20 deletions scenario_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def __init__(self, args):
self.client = carla.Client(args.host, int(args.port))
self.client.set_timeout(self.client_timeout)
dist = pkg_resources.get_distribution("carla")
if LooseVersion(dist.version) < LooseVersion('0.9.12'):
raise ImportError("CARLA version 0.9.12 or newer required. CARLA version found: {}".format(dist))
if LooseVersion(dist.version) < LooseVersion('0.9.15'):
raise ImportError("CARLA version 0.9.15 or newer required. CARLA version found: {}".format(dist))

# Load agent if requested via command line args
# If something goes wrong an exception will be thrown by importlib (ok here)
Expand Down Expand Up @@ -236,7 +236,10 @@ def _prepare_ego_vehicles(self, ego_vehicles):

for i, _ in enumerate(self.ego_vehicles):
self.ego_vehicles[i].set_transform(ego_vehicles[i].transform)
CarlaDataProvider.register_actor(self.ego_vehicles[i])
self.ego_vehicles[i].set_target_velocity(carla.Vector3D())
self.ego_vehicles[i].set_target_angular_velocity(carla.Vector3D())
self.ego_vehicles[i].apply_control(carla.VehicleControl())
CarlaDataProvider.register_actor(self.ego_vehicles[i], ego_vehicles[i].transform)

# sync state
if CarlaDataProvider.is_sync_mode():
Expand Down Expand Up @@ -401,11 +404,11 @@ def _load_and_run_scenario(self, config):
timeout=100000)
else:
scenario_class = self._get_scenario_class_or_fail(config.type)
scenario = scenario_class(self.world,
self.ego_vehicles,
config,
self._args.randomize,
self._args.debug)
scenario = scenario_class(world=self.world,
ego_vehicles=self.ego_vehicles,
config=config,
randomize=self._args.randomize,
debug_mode=self._args.debug)
except Exception as exception: # pylint: disable=broad-except
print("The scenario cannot be loaded")
traceback.print_exc()
Expand Down Expand Up @@ -471,15 +474,8 @@ def _run_route(self):
"""
result = False

if self._args.route:
routes = self._args.route[0]
scenario_file = self._args.route[1]
single_route = None
if len(self._args.route) > 2:
single_route = self._args.route[2]

# retrieve routes
route_configurations = RouteParser.parse_routes_file(routes, scenario_file, single_route)
route_configurations = RouteParser.parse_routes_file(self._args.route, self._args.route_id)

for config in route_configurations:
for _ in range(self._args.repetitions):
Expand Down Expand Up @@ -576,11 +572,10 @@ def main():
parser.add_argument('--openscenario', help='Provide an OpenSCENARIO definition')
parser.add_argument('--openscenarioparams', help='Overwrited for OpenSCENARIO ParameterDeclaration')
parser.add_argument('--openscenario2', help='Provide an openscenario2 definition')
parser.add_argument('--route', help='Run a route as a scenario', type=str)
parser.add_argument('--route-id', help='Run a specific route inside that \'route\' file', default='', type=str)
parser.add_argument(
'--route', help='Run a route as a scenario (input: (route_file,scenario_file,[route id]))', nargs='+', type=str)

parser.add_argument(
'--agent', help="Agent used to execute the scenario. Currently only compatible with route-based scenarios.")
'--agent', help="Agent used to execute the route. Not compatible with non-route-based scenarios.")
parser.add_argument('--agentConfig', type=str, help="Path to Agent's configuration file", default="")

parser.add_argument('--output', action="store_true", help='Provide results on stdout')
Expand Down
Loading
Loading