From c90a7fdb1360497b96995ca0f9b0e4ea08c4c64d Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Mon, 10 Feb 2025 14:15:42 +0300 Subject: [PATCH] refine Signed-off-by: Oguz Ozturk --- .../docker-build-and-push-tools/action.yaml | 28 ----------------- docker/tools/README.md | 30 +++++++++++++++++++ .../Dockerfile.scenario-simulator | 4 +-- docker/tools/scenario-simulator/entrypoint.sh | 2 +- 4 files changed, 33 insertions(+), 31 deletions(-) create mode 100644 docker/tools/README.md diff --git a/.github/actions/docker-build-and-push-tools/action.yaml b/.github/actions/docker-build-and-push-tools/action.yaml index beae5f1f06..5b9f4d10a8 100644 --- a/.github/actions/docker-build-and-push-tools/action.yaml +++ b/.github/actions/docker-build-and-push-tools/action.yaml @@ -31,34 +31,6 @@ runs: - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Restore ccache - uses: actions/cache/restore@v4 - with: - path: | - root-ccache - key: ccache-${{ inputs.platform }}-${{ hashFiles('src/**/*.cpp') }} - restore-keys: | - ccache-${{ inputs.platform }}- - - - name: Restore apt-get - uses: actions/cache/restore@v4 - with: - path: | - var-cache-apt - key: apt-get-${{ inputs.platform }}-${{ hashFiles('src/**/package.xml') }} - restore-keys: | - apt-get-${{ inputs.platform }}- - - - name: Inject cache into docker - uses: reproducible-containers/buildkit-cache-dance@v3.1.2 - with: - cache-map: | - { - "root-ccache": "/root/.ccache", - "var-cache-apt": "/var/cache/apt" - } - skip-extraction: true - - name: Get current date id: date run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT diff --git a/docker/tools/README.md b/docker/tools/README.md new file mode 100644 index 0000000000..4b42d675a1 --- /dev/null +++ b/docker/tools/README.md @@ -0,0 +1,30 @@ +# Open AD Kit Tools + +This directory offers tools for [Open AD Kit](https://autoware.org/open-ad-kit/) containers to make deployment and simulation easier. + +- `scenario-simulator`: a container that can visualize the Autoware and scenario simulation on RViz. + +## Scenario Simulator + +### Run + +```bash +docker run --rm --name openadkit-scenario-simulator ghcr.io/autowarefoundation/autoware-tools:scenario-simulator +``` + +### Settings + +The following environment variables can be configured for the scenario simulator container: + +| Variable | Default Value | Possible Values | Description | +|----------|--------------|-----------------|-------------| +| `SCENARIO` | [`scenario_test_runner/scenario/sample.yaml`](https://github.com/tier4/scenario_simulator_v2/blob/master/test_runner/scenario_test_runner/scenario/sample.yaml) | Any valid path | The full path to the scenario file inside the container | +| `ARCHITECTURE_TYPE` | `awf/universe/20240605` | Any valid architecture type | The architecture type to use for the scenario simulation | +| `SENSOR_MODEL` | `sample_sensor_kit` | Any valid sensor model | The sensor model to use for the scenario simulation | +| `VEHICLE_MODEL` | `sample_vehicle` | Any valid vehicle model | The vehicle model to use for the scenario simulation | +| `INITIALIZE_DURATION` | `90` | Any positive integer | The duration to initialize the scenario simulation | +| `GLOBAL_FRAME_RATE` | `30` | Any positive integer | The frame rate of the scenario simulation | +| `GLOBAL_TIMEOUT` | `120` | Any positive integer | The timeout of the scenario simulation | +| `OUTPUT_DIRECTORY` | `/autoware/scenario-sim/output` | Any valid path | The directory to save the simulation results | +| `USE_SIM_TIME` | `false` | `true`, `false` | Whether to use simulation time instead of system time | +| `RECORD` | `false` | `true`, `false` | Whether to record the scenario simulation rosbag | diff --git a/docker/tools/scenario-simulator/Dockerfile.scenario-simulator b/docker/tools/scenario-simulator/Dockerfile.scenario-simulator index 850164fe77..2ec90c48a0 100644 --- a/docker/tools/scenario-simulator/Dockerfile.scenario-simulator +++ b/docker/tools/scenario-simulator/Dockerfile.scenario-simulator @@ -29,12 +29,12 @@ RUN --mount=type=ssh \ && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Extract rosdep dependencies for simulator -RUN /autoware/resolve_rosdep_keys.sh /autoware/src/simulator ${ROS_DISTRO} \ +RUN /autoware/resolve_rosdep_keys.sh /autoware/src/simulator ${ROS_DISTRO} --dependency-types=exec \ > /rosdep-simulator-depend-packages.txt \ && cat /rosdep-simulator-depend-packages.txt ### Scenario Simulator -FROM ghcr.io/autowarefoundation/autoware:universe-visualization AS scenario-simulator +FROM ghcr.io/autowarefoundation/autoware:core AS scenario-simulator SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG LIB_DIR diff --git a/docker/tools/scenario-simulator/entrypoint.sh b/docker/tools/scenario-simulator/entrypoint.sh index 9db590fa00..969783ff94 100644 --- a/docker/tools/scenario-simulator/entrypoint.sh +++ b/docker/tools/scenario-simulator/entrypoint.sh @@ -10,7 +10,7 @@ run_scenario_simulator() { SENSOR_MODEL=${SENSOR_MODEL:-sample_sensor_kit} VEHICLE_MODEL=${VEHICLE_MODEL:-sample_vehicle} INITIALIZE_DURATION=${INITIALIZE_DURATION:-90} - GLOBAL_FRAME_RATE=${GLOBAL_FRAME_RATE:-20} + GLOBAL_FRAME_RATE=${GLOBAL_FRAME_RATE:-30} OUTPUT_DIRECTORY=${OUTPUT_DIRECTORY:-/autoware/scenario-sim/output} SCENARIO=${SCENARIO:-$(ros2 pkg prefix --share scenario_test_runner)/scenario/sample.yaml} GLOBAL_TIMEOUT=${GLOBAL_TIMEOUT:-120}