diff --git a/ail_vru_uc1_scenario/cdasim_config/scenario-runner/trb_2024.py b/ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.py similarity index 90% rename from ail_vru_uc1_scenario/cdasim_config/scenario-runner/trb_2024.py rename to ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.py index 918f7415..a8b4f50b 100644 --- a/ail_vru_uc1_scenario/cdasim_config/scenario-runner/trb_2024.py +++ b/ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 Leidos +# Copyright 2024 Leidos # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,10 +37,10 @@ Configurations """ -WALKING_PERSON_SPEED_IN_MS = 1.34 -WALKING_PERSON_TRIGGER_WALKING_DISTANCE_IN_METERS = 20.0 +WALKING_PERSON_SPEED_IN_MS = 1.0 +WALKING_PERSON_TRIGGER_WALKING_DISTANCE_IN_METERS = 11.0 -class Trb2024(BasicScenario): +class VulnerableRoadUserCollision(BasicScenario): def __init__( self, world, @@ -67,8 +67,8 @@ def __init__( # references is in its __init__() function. self.timeout = timeout - super(Trb2024, self).__init__( - "Trb2024", + super(VulnerableRoadUserCollision, self).__init__( + "VulnerableRoadUserCollision", ego_vehicles, config, world, @@ -82,12 +82,11 @@ def __init__( spectator = world.get_spectator() spectator.set_transform( carla.Transform( - carla.Location(266.4068, -160.1683, 16.2939), - carla.Rotation(-34.0360, -126.9920, 0.0), + carla.Location(265.4068, -160.1683, 21.2939), + carla.Rotation(-60.0360, -126.9920, 0.0), ) ) - # self.carma_vehicle = ego_vehicles[0] self.other_actors_dict = {} def _initialize_actors(self, config: ScenarioConfiguration) -> None: @@ -149,13 +148,13 @@ def _create_behavior(self): CarlaDataProvider.register_actor(actor) crossing_person = self.other_actors_dict["crossing_person"] - # start_condition = Idle(5, name="start_condition") + start_condition = Idle(5, name="start_condition") start_condition = InTriggerDistanceToVehicle( crossing_person, carma_vehicle, WALKING_PERSON_TRIGGER_WALKING_DISTANCE_IN_METERS ) walk_across_street = KeepVelocity( - crossing_person, WALKING_PERSON_SPEED_IN_MS, 10.0, name="walk_across_street" + crossing_person, WALKING_PERSON_SPEED_IN_MS, 100.0, name="walk_across_street" ) dao = GlobalRoutePlannerDAO(CarlaDataProvider.get_map(), 2) @@ -164,9 +163,8 @@ def _create_behavior(self): actor_behaviors = py_trees.composites.Parallel(name="actor_behaviors") actor_behaviors.add_child(walk_across_street) - # actor_behaviors.add_child(drive_through_intersection) - end_condition = DriveDistance(carma_vehicle, 10) + end_condition = DriveDistance(carma_vehicle, 100) root = py_trees.composites.Sequence(name="root_sequence") root.add_child(start_condition) diff --git a/ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.xml b/ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.xml new file mode 100644 index 00000000..80921c39 --- /dev/null +++ b/ail_vru_uc1_scenario/cdasim_config/scenario-runner/vru_collision.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/ail_vru_uc1_scenario/docker-compose.yml b/ail_vru_uc1_scenario/docker-compose.yml index 66cb8dbb..db9dda42 100644 --- a/ail_vru_uc1_scenario/docker-compose.yml +++ b/ail_vru_uc1_scenario/docker-compose.yml @@ -399,14 +399,15 @@ services: depends_on: - carma-simulation volumes: - - ./scenario-runner/trb_2024.py:/app/scenario_runner/srunner/scenarios/trb_2024.py + - ./scenario-runner/vru_collision.py:/app/scenario_runner/srunner/scenarios/vru_collision.py + - ./scenario-runner/vru_collision.xml:/app/scenario_runner/srunner/examples/vru_collision.xml - ./carla-recorder/:/app/scenario_runner/metrics/data/ # sleep is for mainly carma-platform's components to # activate and be ready before scenario starts entrypoint: > bash -c "sleep 30 && python3 scenario_runner.py - --scenario Trb2024_1 + --scenario VulnerableRoadUserCollision_LeftTurn --record metrics/data/ --host 172.2.0.2"