Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions .github/workflows/automated-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
- shell: bash
run: |
xhost +local:
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.1
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.2
with:
composefile-path: automated-testing/carla-sim.yml
scenario-folder-path: ${{ matrix.filedir }}
scenario-file-name: ${{ matrix.filename }}
- shell: bash
Expand Down Expand Up @@ -63,10 +62,9 @@ jobs:
- shell: bash
run: |
xhost +local:
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.1
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.2
continue-on-error: true
with:
composefile-path: automated-testing/carla-sim.yml
scenario-folder-path: ${{ matrix.filedir }}
scenario-file-name: ${{ matrix.filename }}
- shell: bash
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Each link below provides a detailed description of a provided use case and instr

| Use Case | Integrated Components | Description |
| ------ | ------ | ------
| [***software-prototyping***](./software-prototyping/README.md) | carla-simulator, carla-ros-bridge, rviz | Transfers simulation data into the ROS ecosystem. |
| [***data-driven-development***](./data-driven-development/README.md) | carla-simulator, carla-ros-bridge, carla-scenario-runner | Automated simulation configuration to capture sensor data at large scale. |
| [***automated-testing***](./automated-testing/README.md) | carla-simulator, carla-scenario-runner | Sequential simulation of multiple scenarios in OpenSCENARIO format with automated evaluation. |
| [***software-prototyping***](./software-prototyping/README.md) | carla-server, carla-ros-bridge, rviz | Transfers simulation data into the ROS ecosystem. |
| [***data-driven-development***](./data-driven-development/README.md) | carla-server, carla-ros-bridge, carla-scenario-runner | Automated simulation configuration to capture sensor data at large scale. |
| [***automated-testing***](./automated-testing/README.md) | carla-server, carla-scenario-runner | Sequential simulation of multiple scenarios in OpenSCENARIO format with automated evaluation. |

## Simulation Architecture

Expand Down Expand Up @@ -134,7 +134,7 @@ To enable scenario-based testing and evaluation, the carla-scenario-runner is us


> [!NOTE]
> For all provided use case examples we use predefined Docker services, listed in [carla-components.yml](./utils/components.yml) and further described in the [carla-components overview](./utils/components.md).
> For all provided use case examples we use predefined Docker services, listed in [carla-services.yml](./utils/carla-essentials/carla-services.yml) and further described in the [carla-components overview](./utils/carla-essentials/README.md).

## Citation
We hope that our simulation framework CARLOS can help your research. If this is the case, please cite it using the following metadata.
Expand Down
2 changes: 1 addition & 1 deletion automated-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The subsequent demonstration showcases *automated testing* and specifically addr
> Make sure that all [system requirements](../utils/requirements.md) are fulfilled.
> Additionally, the CI related part of this demo requires a [self-hosted GitHub Runner](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners) to execute scenarios within a [GitHub workflow](https://docs.github.com/en/actions/using-workflows/about-workflows). The specific requirements for such a runner are listed [below](#self-hosted-github-runner).

This demo aims to automatically evaluate predefined test scenarios. For this purpose, a test catalog can be defined using OpenSCENARIO files as contained in the [scenarios](../utils/scenarios) folder. These scenarios can be simulated and evaluated using the [carla-scenario-runner](https://github.com/ika-rwth-aachen/carla-scenario-runner). Thus, a basic [docker-compose template](../.github/actions/evaluate-scenario/files/template.yml) only includes the `carla-simulator` and a `carla-scenario-runner` Docker service. So, in general, the demo enables the efficient execution of multiple scenario-based tests with CARLA, both in local environments and within an automated GitHub CI process.
This demo aims to automatically evaluate predefined test scenarios. For this purpose, a test catalog can be defined using OpenSCENARIO files as contained in the [scenarios](../utils/scenarios) folder. These scenarios can be simulated and evaluated using the [carla-scenario-runner](https://github.com/ika-rwth-aachen/carla-scenario-runner). Thus, a basic [docker-compose template](../.github/actions/evaluate-scenario/files/template.yml) only includes the `carla-server` and a `carla-scenario-runner` Docker service. So, in general, the demo enables the efficient execution of multiple scenario-based tests with CARLA, both in local environments and within an automated GitHub CI process.

### Manual Testing Pipeline

Expand Down
18 changes: 0 additions & 18 deletions automated-testing/carla-sim.yml

This file was deleted.

14 changes: 8 additions & 6 deletions automated-testing/evaluate-scenarios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

set -e

DEFAULT_SIMULATOR_IMAGE="rwthika/carla-simulator:server"
DEFAULT_SCENARIO_RUNNER_IMAGE="rwthika/carla-scenario-runner:latest"
COMPOSE_TEMPLATE_PATH="./template.yml"

usage() {
echo "Usage: $0 [-o][-p][-n] [COMPOSE_TEMPLATE_PATH] [SCENARIO_FOLDER_PATH]"
echo "COMPOSE_TEMPLATE_PATH : Location of Compose file which can be customized through environment variables"
Expand All @@ -23,16 +27,14 @@ restart-simulator() {
echo "Restarting simulator..."
docker compose -f $COMPOSE_TEMPLATE_PATH kill
docker compose -f $COMPOSE_TEMPLATE_PATH down
docker compose -f $COMPOSE_TEMPLATE_PATH up -d carla-simulator
docker compose -f $COMPOSE_TEMPLATE_PATH up -d carla-server
}

update-simulator() {
echo "Updating simulator..."
docker compose -f $COMPOSE_TEMPLATE_PATH pull
}

COMPOSE_TEMPLATE_PATH="./template.yml"

while getopts "hopn" flag; do
case "$flag" in
h)
Expand All @@ -54,8 +56,8 @@ done
shift $(($OPTIND-1)) # return to usual handling of positional args

# default settings if no external overrides provided
export SIMULATOR_IMAGE=${SIMULATOR_IMAGE:-"rwthika/carla-simulator:server"}
export SCENARIO_RUNNER_IMAGE=${SCENARIO_RUNNER_IMAGE:-"rwthika/carla-scenario-runner:latest"}
export SIMULATOR_IMAGE=${SIMULATOR_IMAGE:-$DEFAULT_SIMULATOR_IMAGE}
export SCENARIO_RUNNER_IMAGE=${SCENARIO_RUNNER_IMAGE:-$DEFAULT_SCENARIO_RUNNER_IMAGE}

export COMPOSE_TEMPLATE_PATH=$(realpath ${1:-$COMPOSE_TEMPLATE_PATH})
export SCENARIO_FOLDER_PATH=$(realpath ${2:-"../utils/scenarios"})
Expand Down Expand Up @@ -93,7 +95,7 @@ fi

xhost +local:
echo "Starting simulator..."
docker compose -f $COMPOSE_TEMPLATE_PATH up -d carla-simulator
docker compose -f $COMPOSE_TEMPLATE_PATH up -d carla-server

for scenario in "${scenarios[@]}"; do
echo "Evaluating $scenario ..."
Expand Down
6 changes: 3 additions & 3 deletions automated-testing/template.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:

carla-simulator:
carla-server:
deploy:
resources:
reservations:
Expand All @@ -18,9 +18,9 @@ services:

carla-scenario-runner:
depends_on:
carla-simulator:
carla-server:
condition: service_healthy
volumes:
- $SCENARIO_FOLDER_PATH:/scenarios
image: $SCENARIO_RUNNER_IMAGE
command: bash -ic "python ./scenario_runner.py --host carla-simulator --openscenario /scenarios/$SCENARIO_FILE_NAME --output"
command: bash -ic "python ./scenario_runner.py --host carla-server --openscenario /scenarios/$SCENARIO_FILE_NAME --output"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ general_settings:
max_simulation_time: 60
max_real_time: 300
simulation_services:
- carla-simulator
- carla-server
- time-health-check
- spawned-vehicle-check
- carla-ros-bridge
Expand Down Expand Up @@ -34,4 +34,4 @@ run_settings:
- "50"
weather:
- ClearSunset
- WetCloudyNoon
- WetCloudyNoon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ general_settings:
max_simulation_time: 60
max_real_time: 300
simulation_services:
- carla-simulator
- carla-server
- time-health-check
- spawned-vehicle-check
- carla-ros-bridge
Expand All @@ -23,4 +23,4 @@ run_settings:
- ../utils/scenarios/town01.xosc
- ../utils/scenarios/town10.xosc
sensors_file:
- ./config/sensors/rgb_segmentation_camera.json
- ./config/sensors/rgb_segmentation_camera.json
48 changes: 21 additions & 27 deletions data-driven-development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ services:

# --- core services ----------------------------------------------------------

carla-simulator:
carla-server:
extends:
file: ../utils/components.yml
service: carla-simulator-offscreen
file: ../utils/carla-essentials/carla-services.yml
service: carla-server-offscreen

carla-ros-bridge:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- *sensors-mount
- ./launch/demo.launch.py:/demo.launch.py
Expand All @@ -27,38 +24,35 @@ services:
# ----------------------------------------------------------------------------
# --- checking services ------------------------------------------------------

spawned-vehicle-check:
time-health-check:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: carla-client
depends_on:
carla-simulator:
spawned-vehicle-check:
condition: service_healthy
volumes:
- ./scripts/time_controller.py:/opt/carla/PythonAPI/time_controller.py
command: bash -ic "python time_controller.py --host carla-server ${max_simulation_time} ${max_real_time}"

spawned-vehicle-check:
extends:
file: ../utils/carla-essentials/carla-services.yml
service: carla-client
volumes:
- ./scripts/spawned_vehicle_check.py:/opt/carla/PythonAPI/spawned_vehicle_check.py
command: sleep infinity
healthcheck:
test: ["CMD-SHELL", "bash -ic \"python spawned_vehicle_check.py --host carla-simulator --role_name_list ${role_names}\""]
test: ["CMD-SHELL", "bash -ic \"python spawned_vehicle_check.py --host carla-server --role_name_list ${role_names}\""]
interval: 1s
start_period: 10s
retries: 3

time-health-check:
extends:
file: ../utils/components.yml
service: carla-client
depends_on:
spawned-vehicle-check:
condition: service_healthy
volumes:
- ./scripts/time_controller.py:/opt/carla/PythonAPI/time_controller.py
command: bash -ic "python time_controller.py --host carla-simulator ${max_simulation_time} ${max_real_time}"

# ----------------------------------------------------------------------------
# --- Option A: apply random permutation setups ------------------------------
carla-simulation-controller:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: carla-client
depends_on:
spawned-vehicle-check:
Expand All @@ -67,25 +61,25 @@ services:
- ./scripts/simulation_controller.py:/opt/carla/PythonAPI/simulation_controller.py
- ./scripts/set_environment.py:/opt/carla/PythonAPI/set_environment.py
- *sensors-mount
command: bash -ic "python -u simulation_controller.py --host carla-simulator ${controller_args}"
command: bash -ic "python -u simulation_controller.py --host carla-server ${controller_args}"

# --- Option B: apply concrete scenario setups -------------------------------
carla-scenario-runner:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: carla-scenario-runner
depends_on:
spawned-vehicle-check:
condition: service_healthy
volumes:
- *scenario-mount
command: bash -ic "python ./scenario_runner.py --host carla-simulator --openscenario /scenarios/${scenario_file} --waitForEgo --output"
command: bash -ic "python ./scenario_runner.py --host carla-server --openscenario /scenarios/${scenario_file} --waitForEgo --output"

# ----------------------------------------------------------------------------
# --- recording services -----------------------------------------------------
rosbag-record:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: ros-monitoring-offscreen
depends_on:
spawned-vehicle-check:
Expand Down
2 changes: 1 addition & 1 deletion data-driven-development/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_launch_description():
# CARLA Args
host_launch_arg = launch.actions.DeclareLaunchArgument(
name='host',
default_value='carla-simulator'
default_value='carla-server'
)

port_launch_arg = launch.actions.DeclareLaunchArgument(
Expand Down
4 changes: 2 additions & 2 deletions data-driven-development/scripts/simulation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def main():
argparser.add_argument(
'--host',
metavar='H',
default='carla-simulator',
help='IP of the host server (default: carla-simulator)')
default='carla-server',
help='IP of the host server (default: carla-server)')
argparser.add_argument(
'--spawn_point',
metavar='S',
Expand Down
4 changes: 2 additions & 2 deletions data-driven-development/scripts/spawned_vehicle_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def main():
argparser.add_argument(
'--host',
metavar='H',
default='carla-simulator',
help='IP of the host server (default: carla-simulator)')
default='carla-server',
help='IP of the host server (default: carla-server)')
argparser.add_argument('--role_name',
metavar='R',
default='ego_vehicle',
Expand Down
4 changes: 2 additions & 2 deletions data-driven-development/scripts/time_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def main():
argparser.add_argument(
'--host',
metavar='H',
default='carla-simulator',
help='IP of the host server (default: carla-simulator)')
default='carla-server',
help='IP of the host server (default: carla-server)')
argparser.add_argument(
'--max_simulation_time',
metavar='T',
Expand Down
6 changes: 3 additions & 3 deletions software-prototyping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Directly start the use case demonstration using the top-level `run-demo.sh` scri
This example demonstrates a basic CARLA simulation in tandem with the widely used Robot Operations System ([ROS](https://www.ros.org/)). We only cover ROS 2 with this demo. In addition to a CARLA simulation core, a ROS bridge enables communication between CARLA and ROS by translating simulation outputs (e.g. sensor data) to ROS topics. In addition, RViz is used as a visualization component.

Specifically, there are three main components used in the `software-prototyping` demo:
- [carla-simulator](https://github.com/ika-rwth-aachen/carla-simulator)
- [carla-server](https://github.com/ika-rwth-aachen/carla-simulator)
- [carla-ros-bridge](https://github.com/ika-rwth-aachen/carla-ros-bridge)
- [ros-monitoring](https://github.com/ika-rwth-aachen/carlos/blob/main/utils/components.md#ros-monitoring)
- [ros-monitoring](https://github.com/ika-rwth-aachen/carlos/blob/main/utils/carla-essentials/README.md#ros-monitoring)
- A containerized image segmentation ROS node that serves as an example on how to attached a custom function to the simulation.

> [!NOTE]
> A detailed description of the individual components can be found in [components guide](../utils/components.md).
> A detailed description of the individual components can be found in [components guide](../utils/carla-essentials/README.md).

### Quick Start
After starting the `software-prototyping` demo, a CARLA GUI opens up where you can look around using <kbd>W</kbd><kbd>A</kbd><kbd>S</kbd><kbd>D</kbd>, holding the left or right mouse button and moving the mouse in the desired direction.
Expand Down
2 changes: 1 addition & 1 deletion software-prototyping/carla-ros-bridge.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def generate_launch_description():
# carla-simualtor args
host_launch_arg = launch.actions.DeclareLaunchArgument(
name='host',
default_value='carla-simulator'
default_value='carla-server'
)

port_launch_arg = launch.actions.DeclareLaunchArgument(
Expand Down
17 changes: 7 additions & 10 deletions software-prototyping/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,34 @@ x-rviz-config-mount: &rviz-config-mount ./config.rviz:/config.rviz

services:

carla-simulator:
carla-server:
extends:
file: ../utils/components.yml
service: carla-simulator
file: ../utils/carla-essentials/carla-services.yml
service: carla-server

carla-ros-bridge:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: carla-ros-bridge
depends_on:
carla-simulator:
condition: service_healthy
volumes:
- *launch-mount
- *sensors-mount
command: bash -ic 'ros2 launch /demo.launch.py'

ros-monitoring:
extends:
file: ../utils/components.yml
file: ../utils/carla-essentials/carla-services.yml
service: ros-monitoring
depends_on:
carla-simulator:
carla-server:
condition: service_healthy
volumes:
- *rviz-config-mount
command: bash -ic 'rviz2 -d /config.rviz --ros-args -p use_sim_time:=true &> /dev/null'

image-segmentation:
depends_on:
carla-simulator:
carla-server:
condition: service_healthy
image: rwthika/carlos-image-segmentation
command: ros2 launch image_segmentation image_segmentation_launch.py image_topic:=/carla/ego_vehicle/rgb_front/image
Expand Down
Loading
Loading