From 1af9791b23ec463265fa512331f4e4458b431590 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Tue, 7 May 2024 08:06:31 +0900 Subject: [PATCH 01/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AB=E5=90=91=E3=81=91=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E6=BA=96=E5=82=99=E3=82=92=E5=B0=91=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index d4f1514bc..b6d636d06 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -46,6 +46,18 @@ jobs: cd ~/ibis_ws vcs import src < src/crane/dependency.repos + - name: Download logger for scenario test + run: | + curl -L https://github.com/RoboCup-SSL/ssl-go-tools/releases/download/v1.5.2/ssl-log-recorder_v1.5.2_linux_amd64 -o ssl-log-recorder + chmod +x ssl-log-recorder + + - name: docker compose pull + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + docker-compose pull -f docker/docker-compose.yaml + shell: bash + - name: Resolve rosdep run: | cd ~/ibis_ws @@ -82,3 +94,5 @@ jobs: cd ~/ibis_ws colcon test-result --verbose shell: bash + + - name: From 3e4f5b00fdb9dc9e07e4807e427d37a3404ef7eb Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Tue, 7 May 2024 08:20:07 +0900 Subject: [PATCH 02/55] =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=83=9F=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index b6d636d06..c735ca1c4 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: pull_request: paths: - - .github/workflows/build-test.yml + - .github/workflows/build_test.yaml - "**/**.cpp" - "**/**.h" - "**/**.hpp" From 750e101113d1a89bd6e20a1476f0f15b4456aa30 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Tue, 7 May 2024 08:26:24 +0900 Subject: [PATCH 03/55] =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index c735ca1c4..21d19f2cb 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -94,5 +94,3 @@ jobs: cd ~/ibis_ws colcon test-result --verbose shell: bash - - - name: From 03058c6c794a9c20e591b4622aef3d48956aa890 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Tue, 7 May 2024 08:29:44 +0900 Subject: [PATCH 04/55] =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 21d19f2cb..e8fa56af3 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -46,6 +46,11 @@ jobs: cd ~/ibis_ws vcs import src < src/crane/dependency.repos + - name: Install other dependencies + run: | + sudo apt-get update + sudo apt-get install -y curl docker-compose + - name: Download logger for scenario test run: | curl -L https://github.com/RoboCup-SSL/ssl-go-tools/releases/download/v1.5.2/ssl-log-recorder_v1.5.2_linux_amd64 -o ssl-log-recorder @@ -53,8 +58,6 @@ jobs: - name: docker compose pull run: | - sudo apt-get update - sudo apt-get install -y docker-compose docker-compose pull -f docker/docker-compose.yaml shell: bash From 1edc418ee9db789cb03d5ce0616e0acf095cc64d Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 20:24:27 +0900 Subject: [PATCH 05/55] =?UTF-8?q?docker/build-push-action=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index 4bc009e54..8c6b9abad 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -25,7 +25,7 @@ jobs: - name: Build image if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: docker/base/Dockerfile @@ -50,7 +50,7 @@ jobs: - name: Build image if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: docker/ccache/Dockerfile @@ -75,7 +75,7 @@ jobs: - name: Build image if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: docker/prebuilt/Dockerfile From b2c187d8afce5c1e77404c37df86fb7a5da57b2f Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 20:28:24 +0900 Subject: [PATCH 06/55] =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E3=81=AE=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index 8c6b9abad..27e1d52dd 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -31,6 +31,8 @@ jobs: file: docker/base/Dockerfile push: true tags: ghcr.io/${{ github.repository }}:base + cache-from: type=gha + cache-to: type=gha,mode=max build_ccache: name: build ccache image @@ -56,6 +58,8 @@ jobs: file: docker/ccache/Dockerfile push: true tags: ghcr.io/${{ github.repository }}:ccache + cache-from: type=gha + cache-to: type=gha,mode=max build_prebuilt: name: build prebuilt image @@ -81,3 +85,5 @@ jobs: file: docker/prebuilt/Dockerfile push: true tags: ghcr.io/${{ github.repository }}:prebuilt + cache-from: type=gha + cache-to: type=gha,mode=max From adca7b4b68b28ddd76e9f6356f3775068fed952e Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 20:28:57 +0900 Subject: [PATCH 07/55] =?UTF-8?q?=E4=B8=80=E6=99=82=E7=9A=84=E3=81=ABPullR?= =?UTF-8?q?equest=E3=82=92=E3=83=88=E3=83=AA=E3=82=AC=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index 27e1d52dd..85f2a9414 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -5,6 +5,7 @@ on: branches: - develop workflow_dispatch: + pull_request: jobs: build_base: From 499e4b50075bcf098dac12ba328b33af69a753ac Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 20:33:03 +0900 Subject: [PATCH 08/55] =?UTF-8?q?docker/setup-buildx-action=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_build.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index 85f2a9414..0c5c49567 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -17,6 +17,9 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -44,6 +47,9 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -71,6 +77,9 @@ jobs: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: From 0f891f541921ccce68946c44be93389d2447208c Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 20:41:45 +0900 Subject: [PATCH 09/55] =?UTF-8?q?=E7=A9=BA=E3=82=B3=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=83=88w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From aeb9853f9bc35c36c24851808f4fa5e526e0fdfa Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 21:34:39 +0900 Subject: [PATCH 10/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8=E3=81=AEworkflow=20(?= =?UTF-8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88=E3=81=9A=E3=82=A4=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=93=E3=83=AB=E3=83=89=E3=81=A0=E3=81=91?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 46 ++++++++++++++++++++++++++++ docker/scenario/Dockerfile | 17 ++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/scenario_test.yaml create mode 100644 docker/scenario/Dockerfile diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml new file mode 100644 index 000000000..43e93cba0 --- /dev/null +++ b/.github/workflows/scenario_test.yaml @@ -0,0 +1,46 @@ +name: build test + +on: + workflow_dispatch: + pull_request: + merge_group: + +jobs: + job: + name: build image for scenario test + runs-on: >- + ${{ + (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) + && fromJSON('[ "self-hosted"]') + || fromJSON('[ "ubuntu-latest" ]') + }} + env: + DEBIAN_FRONTEND: noninteractive + strategy: + fail-fast: false + matrix: + rosdistro: [humble] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build image + uses: docker/build-push-action@v5 + with: + context: . + file: docker/scenario/Dockerfile + push: true + tags: ghcr.io/${{ github.repository }}:scenario-${{ github.sha }} + cache-from: type=gha diff --git a/docker/scenario/Dockerfile b/docker/scenario/Dockerfile new file mode 100644 index 000000000..3ee5578f4 --- /dev/null +++ b/docker/scenario/Dockerfile @@ -0,0 +1,17 @@ +FROM ghcr.io/ibis-ssl/crane:prebuilt + +ENV ROS_OVERLAY /root/ibis_ws +WORKDIR $ROS_OVERLAY/src +SHELL ["/bin/bash", "-c"] + +COPY . crane + +RUN vcs import . < crane/dependency_${ROS_DISTRO}.repos + +RUN rosdep update && \ + rosdep install -iy --from-paths . && \ + rm -rf /var/lib/apt/lists/ + +RUN cd .. && \ + source /opt/ros/humble/setup.bash && \ + colcon build --symlink-install --cmake-args '-DCMAKE_BUILD_TYPE=Release' From 2140601a83170defd6b0f0e28ef9ad738e166653 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 21:39:20 +0900 Subject: [PATCH 11/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E3=81=AE=E3=82=BB=E3=83=83=E3=83=88=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 44 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 43e93cba0..f328460b4 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -1,12 +1,15 @@ -name: build test +name: scenario test on: workflow_dispatch: pull_request: merge_group: +env: + PYTHON_VERSION: '3.10' + jobs: - job: + create_scenario_test_image: name: build image for scenario test runs-on: >- ${{ @@ -44,3 +47,40 @@ jobs: push: true tags: ghcr.io/${{ github.repository }}:scenario-${{ github.sha }} cache-from: type=gha + + setup_scenario_test_library: + runs-on: >- + ${{ + (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) + && fromJSON('[ "self-hosted"]') + || fromJSON('[ "ubuntu-latest" ]') + }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Setup virtual environment + run: | + python -m venv env + source env/bin/activate + + - name: Cache virtual environment + uses: actions/cache@v4 + with: + path: env + key: ${{ runner.os }}-env-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-env- + + - name: Install robocup_scenario_test library + run: | + source env/bin/activate + python -m pip install --upgrade pip + sudo apt update + sudo apt install -y protobuf-compiler + pip install -v git+https://github.com/SSL-Roots/robocup_scenario_test + pip install pytest From 3d450284a73928d7a3aa90319b21a8d653cff486 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 21:54:21 +0900 Subject: [PATCH 12/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88Job=E3=81=AE=E5=86=92=E9=A0=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index f328460b4..607903f20 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -84,3 +84,36 @@ jobs: sudo apt install -y protobuf-compiler pip install -v git+https://github.com/SSL-Roots/robocup_scenario_test pip install pytest + + scenario_test: + needs: [create_scenario_test_image, setup_scenario_test_library] + strategy: + fail-fast: false + matrix: + env: + - {TEST: "test.py"} + + runs-on: >- + ${{ + (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) + && fromJSON('[ "self-hosted"]') + || fromJSON('[ "ubuntu-latest" ]') + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Cache virtual environment + uses: actions/cache@v4 + with: + path: env + key: ${{ runner.os }}-env-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-env- + + - name: Setup virtual environment + run: | + python -m venv env + source env/bin/activate + python -m pip list From 3092e84cdf5b0c46260ead60a0115dbb635d18a2 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 21:54:42 +0900 Subject: [PATCH 13/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E3=81=AE=E3=82=BB=E3=83=83=E3=83=88=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97=E5=A4=B1=E6=95=97=E3=81=AE=E4=BF=AE=E6=AD=A3=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 607903f20..d02f6337b 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -57,6 +57,9 @@ jobs: }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 @@ -117,3 +120,24 @@ jobs: python -m venv env source env/bin/activate python -m pip list + + - name: Start Docker Compose services + run: | + docker compose -f docker/scenario/docker-compose.yaml up -d + env: + CONSAI_TAG: ${{ env.CONSAI_TAG }} + CONSAI_YELLOW: ${{ matrix.env.CONSAI_YELLOW }} + CONSAI_INVERT: ${{ matrix.env.CONSAI_INVERT }} + + - name: Wait for crane to start + timeout-minutes: 5 + run: | + CHECK_INTERVAL=5 + + until docker top crane 2>/dev/null | grep -q game.py + do + echo "Waiting for crane to start..." + sleep $CHECK_INTERVAL + done + + echo "game.py started!" From b569e5aaa8a456e0396cd3ff2434859c16bd71a6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 12:55:19 +0000 Subject: [PATCH 14/55] style(pre-commit): autofix --- .github/workflows/scenario_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index d02f6337b..8de9634c4 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -133,11 +133,11 @@ jobs: timeout-minutes: 5 run: | CHECK_INTERVAL=5 - + until docker top crane 2>/dev/null | grep -q game.py do echo "Waiting for crane to start..." sleep $CHECK_INTERVAL done - + echo "game.py started!" From dee784e79ea7841c84947f6394b5ed98e072438a Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 22:47:16 +0900 Subject: [PATCH 15/55] =?UTF-8?q?launch=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=A7=E3=82=AA=E3=83=AA=E3=82=B8=E3=83=8A=E3=83=AB?= =?UTF-8?q?=E3=81=AEgrsim=E4=BD=BF=E7=94=A8=E3=83=A2=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crane_bringup/launch/crane.launch.xml | 33 +++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/crane_bringup/launch/crane.launch.xml b/crane_bringup/launch/crane.launch.xml index 83fc394ef..cd0da3c33 100644 --- a/crane_bringup/launch/crane.launch.xml +++ b/crane_bringup/launch/crane.launch.xml @@ -7,6 +7,7 @@ + @@ -32,13 +33,6 @@ - - - - - - - @@ -54,14 +48,25 @@ + + + + + + + + + + + + + - - + + - - - - + + @@ -101,7 +106,7 @@ - + From 733a6895358a635097939e7f552db037dc8652cd Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:04:14 +0900 Subject: [PATCH 16/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8docker-compose=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 5 ++--- docker/scenario/docker-compose.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 docker/scenario/docker-compose.yaml diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 8de9634c4..344082b75 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -101,6 +101,7 @@ jobs: (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) && fromJSON('[ "self-hosted"]') || fromJSON('[ "ubuntu-latest" ]') + }} steps: - name: Set up Python uses: actions/setup-python@v5 @@ -125,9 +126,7 @@ jobs: run: | docker compose -f docker/scenario/docker-compose.yaml up -d env: - CONSAI_TAG: ${{ env.CONSAI_TAG }} - CONSAI_YELLOW: ${{ matrix.env.CONSAI_YELLOW }} - CONSAI_INVERT: ${{ matrix.env.CONSAI_INVERT }} + CRANE_TAG: scenario-${{ github.sha }} - name: Wait for crane to start timeout-minutes: 5 diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml new file mode 100644 index 000000000..26199774c --- /dev/null +++ b/docker/scenario/docker-compose.yaml @@ -0,0 +1,26 @@ +version: "3.1" + +services: + grsim: + image: ghcr.io/ssl-roots/docker_images/grsim:main + container_name: grsim + network_mode: host + command: | + ./grSim --headless -platform offscreen + tty: true + stdin_open: true + restart: "no" + + crane: + image: ghcr.io/ibis-ssl/crane:${crane_TAG} + container_name: crane + network_mode: host + command: | + bash -c " + source install/setup.bash && + ros2 launch crane_bringup crane.launch.xml sim:=true + " + tty: true + stdin_open: true + restart: "no" + From 07dc48ac012a10ea038b452f8256f29341c8da4c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 14:05:34 +0000 Subject: [PATCH 17/55] style(pre-commit): autofix --- docker/scenario/docker-compose.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index 26199774c..12b9addea 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -23,4 +23,3 @@ services: tty: true stdin_open: true restart: "no" - From 276d34241c3cadc29e326fa3aa1f9b47a27dc5c0 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:09:13 +0900 Subject: [PATCH 18/55] =?UTF-8?q?=E7=A9=BA=E3=82=B3=E3=83=9F=E3=83=83?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From f60ad1affa15fc50b1198cab240ee92755131a0b Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:26:11 +0900 Subject: [PATCH 19/55] =?UTF-8?q?runner=E3=81=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 344082b75..3b35db592 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -49,12 +49,7 @@ jobs: cache-from: type=gha setup_scenario_test_library: - runs-on: >- - ${{ - (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) - && fromJSON('[ "self-hosted"]') - || fromJSON('[ "ubuntu-latest" ]') - }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: From e4e99bef6ce5947361bb9bdfb7bfb41fcbcfd970 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:26:23 +0900 Subject: [PATCH 20/55] =?UTF-8?q?=E3=81=A1=E3=81=87=EF=BD=83=E3=81=93?= =?UTF-8?q?=E3=81=86=EF=BD=94wasure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 3b35db592..187600c39 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -98,6 +98,11 @@ jobs: || fromJSON('[ "ubuntu-latest" ]') }} steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python uses: actions/setup-python@v5 with: From e5209ed0ccd12937a8ccf3356263ec4913131221 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:42:06 +0900 Subject: [PATCH 21/55] =?UTF-8?q?docker-compose.yaml=E5=86=85=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/scenario/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index 12b9addea..fed87447d 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -12,7 +12,7 @@ services: restart: "no" crane: - image: ghcr.io/ibis-ssl/crane:${crane_TAG} + image: ghcr.io/ibis-ssl/crane:${CRANE_TAG} container_name: crane network_mode: host command: | From 6c4b5ad491f6a3530b77b33e2ae7a2c184e016cf Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:42:22 +0900 Subject: [PATCH 22/55] =?UTF-8?q?=E3=82=B7=E3=83=8A=E3=83=AA=E3=82=AA?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=BE=8C=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 187600c39..fe9deb0ac 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -140,3 +140,38 @@ jobs: done echo "game.py started!" + + - name: Download logger + run: | + curl -L https://github.com/RoboCup-SSL/ssl-go-tools/releases/download/v1.5.2/ssl-log-recorder_v1.5.2_linux_amd64 -o ssl-log-recorder + chmod +x ssl-log-recorder + + - name: Run pytest + run: | + source env/bin/activate + pytest ${{ matrix.env.TEST_NAME }} --vision_port=10020 --logging --log_recorder=./ssl-log-recorder + echo "LOG_EXISTS=$(ls *.log.gz 2> /dev/null)" >> $GITHUB_ENV + + - name: Get and print logs + if: always() + run: docker compose -f .docker/consai-grsim-compose.yml logs --tail 100 + + - name: Clean up Docker Compose services + if: always() + run: docker compose -f .docker/consai-grsim-compose.yml down + + - name: Upload artifacts + id: upload-artifact + if: env.LOG_EXISTS != '' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.env.TEST_NAME}}-failure-logs + path: '*.log.gz' + + - name: Comment PR with Artifact URL + if: env.LOG_EXISTS != '' + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + Failure logs: ${{ steps.upload-artifact.outputs.artifact-url }} From 97daae5ca4da255a8b0c6335efd6053cb65e46cf Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:43:30 +0900 Subject: [PATCH 23/55] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B7?= =?UTF-8?q?=E3=83=8A=E3=83=AA=E3=82=AA=E3=82=921=E3=81=A4=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 +- scenario_test/test.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scenario_test/test.py diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index fe9deb0ac..f202b5dcb 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -89,7 +89,7 @@ jobs: fail-fast: false matrix: env: - - {TEST: "test.py"} + - {TEST: "scenario_test/test.py"} runs-on: >- ${{ diff --git a/scenario_test/test.py b/scenario_test/test.py new file mode 100644 index 000000000..4dfe8829f --- /dev/null +++ b/scenario_test/test.py @@ -0,0 +1,14 @@ +from rcst.communication import Communication +from rcst import calc +from rcst.ball import Ball +from rcst.robot import RobotDict + +def test(rcst_comm: Communication): + rcst_comm.send_empty_world() + rcst_comm.send_ball(0, 0) + for i in range(11): + rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, 0) + rcst_comm.change_referee_command('STOP', 3.0) + rcst_comm.observer.reset() + success = True + assert True From 5e5d06d9ddee07ebedc1720beed7d4765703fa64 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 14:43:50 +0000 Subject: [PATCH 24/55] style(pre-commit): autofix --- scenario_test/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index 4dfe8829f..7e16a649c 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -3,12 +3,13 @@ from rcst.ball import Ball from rcst.robot import RobotDict + def test(rcst_comm: Communication): rcst_comm.send_empty_world() rcst_comm.send_ball(0, 0) for i in range(11): rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, 0) - rcst_comm.change_referee_command('STOP', 3.0) + rcst_comm.change_referee_command("STOP", 3.0) rcst_comm.observer.reset() success = True assert True From 0d9f432cf17bfe653acc44df0d1747c0c20b3d62 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 31 May 2024 23:46:12 +0900 Subject: [PATCH 25/55] =?UTF-8?q?rcst=E3=82=92=E8=BE=9E=E6=9B=B8=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/custom_dict.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/custom_dict.json b/.github/workflows/custom_dict.json index 7eec110d6..2f29d3f9d 100644 --- a/.github/workflows/custom_dict.json +++ b/.github/workflows/custom_dict.json @@ -105,6 +105,7 @@ "MPPI", "Kwargs", "voicevox", - "FREEKICK" + "FREEKICK", + "rcst" ] } From 1f5033a701baf6a2751be4abb23b932bbaad58f7 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:08:37 +0900 Subject: [PATCH 26/55] =?UTF-8?q?=E6=96=B0=E3=83=81=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/custom_dict.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/custom_dict.json b/.github/workflows/custom_dict.json index 2f29d3f9d..2df6ef022 100644 --- a/.github/workflows/custom_dict.json +++ b/.github/workflows/custom_dict.json @@ -79,6 +79,9 @@ "ZJUNlict", "luhbots", "nAMeC", + "TRAPS", + "Shinobi", + "reRo", "roboticserlangen", "tigersmannheim", "simulatorcli", From b68ce3aae5de66734608f7c495f5ddaef9df0f3b Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:08:56 +0900 Subject: [PATCH 27/55] =?UTF-8?q?=E8=B5=B7=E5=8B=95=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index f202b5dcb..ad9e54c94 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -133,13 +133,13 @@ jobs: run: | CHECK_INTERVAL=5 - until docker top crane 2>/dev/null | grep -q game.py + until docker top crane 2>/dev/null | grep -q vision_node do echo "Waiting for crane to start..." sleep $CHECK_INTERVAL done - echo "game.py started!" + echo "crane started!" - name: Download logger run: | From a5a5c5ceb8202788f8f4f1784c885a2506c37775 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:26:27 +0900 Subject: [PATCH 28/55] =?UTF-8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88?= =?UTF-8?q?=E3=81=9A20=E7=A7=92=E5=9B=BA=E5=AE=9A=E5=BE=85=E6=A9=9F?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index ad9e54c94..3f38c5a24 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -131,15 +131,7 @@ jobs: - name: Wait for crane to start timeout-minutes: 5 run: | - CHECK_INTERVAL=5 - - until docker top crane 2>/dev/null | grep -q vision_node - do - echo "Waiting for crane to start..." - sleep $CHECK_INTERVAL - done - - echo "crane started!" + sleep 20 - name: Download logger run: | From 8c769f28c25f44272ce334f9a83a4af4f074c8ea Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:32:27 +0900 Subject: [PATCH 29/55] =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=88=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/scenario/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index fed87447d..cb2955b06 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -18,7 +18,7 @@ services: command: | bash -c " source install/setup.bash && - ros2 launch crane_bringup crane.launch.xml sim:=true + ros2 launch crane_bringup crane.launch.xml sim:=true grsim:=true vision_port:=10020 referee_port:=10003 " tty: true stdin_open: true From af41e6cdae6d088f19b847d8a14bf45d00038a37 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:37:40 +0900 Subject: [PATCH 30/55] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E7=94=A8=E3=81=AE=E3=82=A4=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92=E4=B8=80=E6=97=A6base=E3=81=AB=E5=B7=AE?= =?UTF-8?q?=E3=81=97=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 98d1aa737..fede1f448 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -15,7 +15,7 @@ jobs: || fromJSON('[ "ubuntu-latest" ]') }} timeout-minutes: 30 - container: ghcr.io/ibis-ssl/crane:prebuilt + container: ghcr.io/ibis-ssl/crane:base env: DEBIAN_FRONTEND: noninteractive strategy: From e2f4933c19b699e224f63d1ae208e17bf0a51778 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:39:00 +0900 Subject: [PATCH 31/55] =?UTF-8?q?self=20hosted=20runner=E3=81=A7=E5=8B=95?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E3=82=82=E3=81=AE=E3=81=AFubuntu-la?= =?UTF-8?q?test=E3=81=AB=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 3f38c5a24..60c2f323e 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -11,12 +11,7 @@ env: jobs: create_scenario_test_image: name: build image for scenario test - runs-on: >- - ${{ - (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) - && fromJSON('[ "self-hosted"]') - || fromJSON('[ "ubuntu-latest" ]') - }} + runs-on: ubuntu-latest env: DEBIAN_FRONTEND: noninteractive strategy: @@ -91,12 +86,7 @@ jobs: env: - {TEST: "scenario_test/test.py"} - runs-on: >- - ${{ - (contains(github.event.pull_request.labels.*.name, 'SelfHostedRunner')) - && fromJSON('[ "self-hosted"]') - || fromJSON('[ "ubuntu-latest" ]') - }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: From d52aaa969bfbfe1e38b3b3a0199894f298c5ede3 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 00:46:54 +0900 Subject: [PATCH 32/55] =?UTF-8?q?=E3=83=91=E3=82=B9=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 60c2f323e..90d3aa7b5 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -136,11 +136,11 @@ jobs: - name: Get and print logs if: always() - run: docker compose -f .docker/consai-grsim-compose.yml logs --tail 100 + run: docker compose -f docker/scenario/docker-compose.yaml logs --tail 100 - name: Clean up Docker Compose services if: always() - run: docker compose -f .docker/consai-grsim-compose.yml down + run: docker compose -f docker/scenario/docker-compose.yaml down - name: Upload artifacts id: upload-artifact From 5f788cc2a4c30f6380e6d74332da40eb95906248 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:02:30 +0900 Subject: [PATCH 33/55] =?UTF-8?q?=E3=81=86=E3=81=8A=E3=81=8A=E3=81=8A?= =?UTF-8?q?=E3=81=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 90d3aa7b5..0fe0166fc 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -79,7 +79,7 @@ jobs: pip install pytest scenario_test: - needs: [create_scenario_test_image, setup_scenario_test_library] +# needs: [create_scenario_test_image, setup_scenario_test_library] strategy: fail-fast: false matrix: @@ -116,7 +116,8 @@ jobs: run: | docker compose -f docker/scenario/docker-compose.yaml up -d env: - CRANE_TAG: scenario-${{ github.sha }} + CRANE_TAG: scenario-55e43d0987fe4b2038cd0141253dbf1cb53b5956 +# CRANE_TAG: scenario-${{ github.sha }} - name: Wait for crane to start timeout-minutes: 5 @@ -131,7 +132,7 @@ jobs: - name: Run pytest run: | source env/bin/activate - pytest ${{ matrix.env.TEST_NAME }} --vision_port=10020 --logging --log_recorder=./ssl-log-recorder + pytest ${{ matrix.env.TEST }} --vision_port=10020 --logging --log_recorder=./ssl-log-recorder echo "LOG_EXISTS=$(ls *.log.gz 2> /dev/null)" >> $GITHUB_ENV - name: Get and print logs From dbe8586ee70427f85ca92211643d473a6ab8eeba Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:09:24 +0900 Subject: [PATCH 34/55] =?UTF-8?q?=E3=82=8F=E3=81=96=E3=81=A8=E5=A4=B1?= =?UTF-8?q?=E6=95=97=E3=81=95=E3=81=9B=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 4 ++-- scenario_test/test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 0fe0166fc..1b65b9236 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -116,7 +116,7 @@ jobs: run: | docker compose -f docker/scenario/docker-compose.yaml up -d env: - CRANE_TAG: scenario-55e43d0987fe4b2038cd0141253dbf1cb53b5956 + CRANE_TAG: scenario-55e43d0987fe4b2038cd0141253dbf1cb53b5956 # CRANE_TAG: scenario-${{ github.sha }} - name: Wait for crane to start @@ -148,7 +148,7 @@ jobs: if: env.LOG_EXISTS != '' uses: actions/upload-artifact@v4 with: - name: ${{ matrix.env.TEST_NAME}}-failure-logs + name: ${{ matrix.env.TEST}}-failure-logs path: '*.log.gz' - name: Comment PR with Artifact URL diff --git a/scenario_test/test.py b/scenario_test/test.py index 7e16a649c..78b4b73fe 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -12,4 +12,4 @@ def test(rcst_comm: Communication): rcst_comm.change_referee_command("STOP", 3.0) rcst_comm.observer.reset() success = True - assert True + assert False From 07387b2573aac2aa38c7a2b574c9615978fc24ae Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:14:12 +0900 Subject: [PATCH 35/55] =?UTF-8?q?=E3=81=A1=E3=82=83=E3=82=93=E3=81=A8?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index 78b4b73fe..9949f5cc6 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -1,3 +1,4 @@ +import time from rcst.communication import Communication from rcst import calc from rcst.ball import Ball @@ -12,4 +13,10 @@ def test(rcst_comm: Communication): rcst_comm.change_referee_command("STOP", 3.0) rcst_comm.observer.reset() success = True - assert False + rcst_comm.send_ball(0, 0, 5.0, 0.0) # Move the ball + for _ in range(5): + if rcst_comm.observer.robot_speed().some_blue_robots_over(1.5): + success = False + break + time.sleep(1) + assert success is True From d019ba32a07ba996eb9fe81a320aee24c9e9ca36 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:23:35 +0900 Subject: [PATCH 36/55] =?UTF-8?q?launch=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=ABGUI=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88?= =?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crane_bringup/launch/crane.launch.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crane_bringup/launch/crane.launch.xml b/crane_bringup/launch/crane.launch.xml index cd0da3c33..973b1bd5a 100644 --- a/crane_bringup/launch/crane.launch.xml +++ b/crane_bringup/launch/crane.launch.xml @@ -10,6 +10,7 @@ + @@ -109,5 +110,7 @@ - + + + From 8cd40b9ae74d2f499814ad6046c1d19282ade816 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:24:03 +0900 Subject: [PATCH 37/55] =?UTF-8?q?=E7=AB=8B=E3=81=A1=E4=B8=8A=E3=81=92?= =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/scenario/docker-compose.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index cb2955b06..59a5f21f9 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -1,5 +1,4 @@ version: "3.1" - services: grsim: image: ghcr.io/ssl-roots/docker_images/grsim:main @@ -17,8 +16,8 @@ services: network_mode: host command: | bash -c " - source install/setup.bash && - ros2 launch crane_bringup crane.launch.xml sim:=true grsim:=true vision_port:=10020 referee_port:=10003 + source ../install/setup.bash && + ros2 launch crane_bringup crane.launch.xml sim:=true gui:=false original_grsim:=true vision_port:=10020 referee_port:=10003 " tty: true stdin_open: true From 6c8629b7948c222da6e97e2a65905d2e4f15f329 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:54:06 +0900 Subject: [PATCH 38/55] =?UTF-8?q?launch=E3=81=A7=E5=96=8B=E3=82=8B?= =?UTF-8?q?=E3=81=8B=E3=81=A9=E3=81=86=E3=81=8B=E3=82=92=E5=88=87=E3=82=8A?= =?UTF-8?q?=E6=9B=BF=E3=81=88=E3=82=89=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crane_bringup/launch/crane.launch.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crane_bringup/launch/crane.launch.xml b/crane_bringup/launch/crane.launch.xml index 973b1bd5a..a44fc6255 100644 --- a/crane_bringup/launch/crane.launch.xml +++ b/crane_bringup/launch/crane.launch.xml @@ -11,6 +11,7 @@ + @@ -101,7 +102,9 @@ - + + + From 1a657a8229272cdd66e776df8021597a4702f185 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:54:29 +0900 Subject: [PATCH 39/55] =?UTF-8?q?=E5=BE=85=E3=81=A1=E6=99=82=E9=96=93?= =?UTF-8?q?=E3=82=92=E7=9F=AD=E7=B8=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 1b65b9236..3f714dde1 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -122,7 +122,7 @@ jobs: - name: Wait for crane to start timeout-minutes: 5 run: | - sleep 20 + sleep 5 - name: Download logger run: | From 0e385a1b2912a0ca4426acc46c456eab2b98babb Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:54:47 +0900 Subject: [PATCH 40/55] =?UTF-8?q?=E8=87=AA=E5=89=8D=E3=81=AEgrSim=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/scenario/docker-compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index 59a5f21f9..8ffea1409 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -1,11 +1,11 @@ version: "3.1" services: grsim: - image: ghcr.io/ssl-roots/docker_images/grsim:main + image: ghcr.io/ibis-ssl/grsim:cutomized container_name: grsim network_mode: host command: | - ./grSim --headless -platform offscreen + grSim --headless -platform offscreen tty: true stdin_open: true restart: "no" @@ -17,7 +17,7 @@ services: command: | bash -c " source ../install/setup.bash && - ros2 launch crane_bringup crane.launch.xml sim:=true gui:=false original_grsim:=true vision_port:=10020 referee_port:=10003 + ros2 launch crane_bringup crane.launch.xml sim:=true gui:=false speak:=false original_grsim:=true vision_port:=10020 referee_port:=10003 " tty: true stdin_open: true From b45e81628f7f1516312dbc2f48b7624664a700be Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:57:55 +0900 Subject: [PATCH 41/55] =?UTF-8?q?=E5=8B=95=E3=81=84=E3=81=9F=E3=82=89?= =?UTF-8?q?=E5=A4=B1=E6=95=97=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index 9949f5cc6..e62aab92d 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -15,7 +15,7 @@ def test(rcst_comm: Communication): success = True rcst_comm.send_ball(0, 0, 5.0, 0.0) # Move the ball for _ in range(5): - if rcst_comm.observer.robot_speed().some_blue_robots_over(1.5): + if rcst_comm.observer.robot_speed().some_blue_robots_over(0.0): success = False break time.sleep(1) From 04ab07c4ead18fd46b258c7545b5f48ce10001a3 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 01:58:19 +0900 Subject: [PATCH 42/55] =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=81=AF=E5=85=A8?= =?UTF-8?q?=E3=81=A6=E5=87=BA=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 3f714dde1..39b83da00 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -137,7 +137,7 @@ jobs: - name: Get and print logs if: always() - run: docker compose -f docker/scenario/docker-compose.yaml logs --tail 100 + run: docker compose -f docker/scenario/docker-compose.yaml logs - name: Clean up Docker Compose services if: always() From e757d1c0f654d95b643c484864d46fca8c4592f8 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:01:20 +0900 Subject: [PATCH 43/55] =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=82=92=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=83=87=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 39b83da00..9bb6f2fb9 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -116,7 +116,7 @@ jobs: run: | docker compose -f docker/scenario/docker-compose.yaml up -d env: - CRANE_TAG: scenario-55e43d0987fe4b2038cd0141253dbf1cb53b5956 + CRANE_TAG: scenario-6c4428c6efa64da3bfcfa5abd753fb31b6331f7b # CRANE_TAG: scenario-${{ github.sha }} - name: Wait for crane to start From 142158c5bcc69bbb21feae367208d2fa1c808301 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:06:22 +0900 Subject: [PATCH 44/55] =?UTF-8?q?=E3=81=84=E3=81=A4=E3=81=A7=E3=82=82?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=92=E3=82=A2=E3=83=83=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 9bb6f2fb9..082c2a105 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -145,14 +145,14 @@ jobs: - name: Upload artifacts id: upload-artifact - if: env.LOG_EXISTS != '' +# if: env.LOG_EXISTS != '' uses: actions/upload-artifact@v4 with: name: ${{ matrix.env.TEST}}-failure-logs path: '*.log.gz' - name: Comment PR with Artifact URL - if: env.LOG_EXISTS != '' +# if: env.LOG_EXISTS != '' uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} From df66ae9e4a0b3eb68e2dc1798ed52e901958291c Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:07:21 +0900 Subject: [PATCH 45/55] =?UTF-8?q?=E3=81=84=E3=81=A4=E3=81=A7=E3=82=82?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=92=E3=82=A2=E3=83=83=E3=83=97=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 082c2a105..b32e605c4 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -145,6 +145,7 @@ jobs: - name: Upload artifacts id: upload-artifact + if: always() # if: env.LOG_EXISTS != '' uses: actions/upload-artifact@v4 with: @@ -152,6 +153,7 @@ jobs: path: '*.log.gz' - name: Comment PR with Artifact URL + if: always() # if: env.LOG_EXISTS != '' uses: peter-evans/create-or-update-comment@v4 with: From f22c5fc07c35e52b479aa99f0a62cfee74291689 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:09:31 +0900 Subject: [PATCH 46/55] =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=AEtypo=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/scenario/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/scenario/docker-compose.yaml b/docker/scenario/docker-compose.yaml index 8ffea1409..f9e85acbe 100644 --- a/docker/scenario/docker-compose.yaml +++ b/docker/scenario/docker-compose.yaml @@ -1,7 +1,7 @@ version: "3.1" services: grsim: - image: ghcr.io/ibis-ssl/grsim:cutomized + image: ghcr.io/ibis-ssl/grsim:customized container_name: grsim network_mode: host command: | From d2e5e81e2636f826d9cd191a02206841a870de80 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:13:08 +0900 Subject: [PATCH 47/55] =?UTF-8?q?TEST=E5=A4=89=E6=95=B0=E3=81=AB=E3=82=B9?= =?UTF-8?q?=E3=83=A9=E3=83=83=E3=82=B7=E3=83=A5=E3=82=84=E3=82=BB=E3=83=9F?= =?UTF-8?q?=E3=82=B3=E3=83=AD=E3=83=B3=E3=81=8C=E5=85=A5=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index b32e605c4..ecc750d9f 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -84,7 +84,7 @@ jobs: fail-fast: false matrix: env: - - {TEST: "scenario_test/test.py"} + - {TEST: "test"} runs-on: ubuntu-latest steps: @@ -132,7 +132,7 @@ jobs: - name: Run pytest run: | source env/bin/activate - pytest ${{ matrix.env.TEST }} --vision_port=10020 --logging --log_recorder=./ssl-log-recorder + pytest scenario_test/${{ matrix.env.TEST }}.py --vision_port=10020 --logging --log_recorder=./ssl-log-recorder echo "LOG_EXISTS=$(ls *.log.gz 2> /dev/null)" >> $GITHUB_ENV - name: Get and print logs From 7574db280ee585d802dca540b7a57e81d084059a Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:24:22 +0900 Subject: [PATCH 48/55] =?UTF-8?q?FORCE=5FSTART=E3=81=99=E3=82=8B=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scenario_test/test.py b/scenario_test/test.py index e62aab92d..a08956a6b 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -20,3 +20,19 @@ def test(rcst_comm: Communication): break time.sleep(1) assert success is True + + +def force_start_test(rcst_comm: Communication): + rcst_comm.send_empty_world() + rcst_comm.send_ball(0, 0) + for i in range(11): + rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, 0) + rcst_comm.change_referee_command("FORCE_START", 3.0) + rcst_comm.observer.reset() + success = True + rcst_comm.send_ball(0, 0, 5.0, 0.0) # Move the ball + for _ in range(5): + if rcst_comm.observer.robot_speed().some_blue_robots_over(0.0): + success = False + time.sleep(1) + assert success is True From 2f680b0f708277679a01ba0205830a36e3d49c90 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:35:53 +0900 Subject: [PATCH 49/55] =?UTF-8?q?STOP=E3=81=99=E3=82=8B=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/test.py | 59 ++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index a08956a6b..a9247b0f4 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -1,3 +1,4 @@ +import math import time from rcst.communication import Communication from rcst import calc @@ -5,34 +6,56 @@ from rcst.robot import RobotDict -def test(rcst_comm: Communication): +def test_robot_speed(rcst_comm: Communication): rcst_comm.send_empty_world() - rcst_comm.send_ball(0, 0) + ball_x = 1.0 + rcst_comm.send_ball(ball_x, 0) for i in range(11): - rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, 0) - rcst_comm.change_referee_command("STOP", 3.0) + rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) + + rcst_comm.change_referee_command('STOP', 3.0) + rcst_comm.observer.reset() success = True - rcst_comm.send_ball(0, 0, 5.0, 0.0) # Move the ball + rcst_comm.send_ball(ball_x, 0, 5.0, 0.0) # Move the ball for _ in range(5): - if rcst_comm.observer.robot_speed().some_blue_robots_over(0.0): + if rcst_comm.observer.robot_speed().some_blue_robots_over(1.5): success = False break time.sleep(1) assert success is True -def force_start_test(rcst_comm: Communication): +def test_avoid_ball(rcst_comm: Communication): rcst_comm.send_empty_world() - rcst_comm.send_ball(0, 0) for i in range(11): - rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, 0) - rcst_comm.change_referee_command("FORCE_START", 3.0) - rcst_comm.observer.reset() - success = True - rcst_comm.send_ball(0, 0, 5.0, 0.0) # Move the ball - for _ in range(5): - if rcst_comm.observer.robot_speed().some_blue_robots_over(0.0): - success = False - time.sleep(1) - assert success is True + rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) + + def blue_robot_did_not_avoid_ball( + ball: Ball, blue_robots: RobotDict, yellow_robots: RobotDict) -> bool: + for robot in blue_robots.values(): + if calc.distance_robot_and_ball(robot, ball) < 0.4: + return True + return False + + rcst_comm.observer.customized().register_sticky_true_callback( + "blue_robot_did_not_avoid_ball", blue_robot_did_not_avoid_ball) + + rcst_comm.change_referee_command('STOP', 1.0) + + def check(x: float, y: float, vx: float = 0.0, vy: float = 0.0): + rcst_comm.send_ball(x, y, vx, vy) + time.sleep(2) + rcst_comm.observer.reset() + + success = True + for _ in range(5): + if rcst_comm.observer.customized().get_result("blue_robot_did_not_avoid_ball"): + success = False + break + time.sleep(1) + assert success is True + + check(0, 0) + check(-3.5, 0) + check(-3.5, 0, vx=2.0) From d3a9d60a7c995390d35a345c7b713d7c17fddd99 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 17:36:21 +0000 Subject: [PATCH 50/55] style(pre-commit): autofix --- scenario_test/test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index a9247b0f4..2643640e8 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -13,7 +13,7 @@ def test_robot_speed(rcst_comm: Communication): for i in range(11): rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) - rcst_comm.change_referee_command('STOP', 3.0) + rcst_comm.change_referee_command("STOP", 3.0) rcst_comm.observer.reset() success = True @@ -32,16 +32,18 @@ def test_avoid_ball(rcst_comm: Communication): rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) def blue_robot_did_not_avoid_ball( - ball: Ball, blue_robots: RobotDict, yellow_robots: RobotDict) -> bool: + ball: Ball, blue_robots: RobotDict, yellow_robots: RobotDict + ) -> bool: for robot in blue_robots.values(): if calc.distance_robot_and_ball(robot, ball) < 0.4: return True return False rcst_comm.observer.customized().register_sticky_true_callback( - "blue_robot_did_not_avoid_ball", blue_robot_did_not_avoid_ball) + "blue_robot_did_not_avoid_ball", blue_robot_did_not_avoid_ball + ) - rcst_comm.change_referee_command('STOP', 1.0) + rcst_comm.change_referee_command("STOP", 1.0) def check(x: float, y: float, vx: float = 0.0, vy: float = 0.0): rcst_comm.send_ball(x, y, vx, vy) From e1c49892be10d27a28fa644cd21d1e170ec5d703 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:41:10 +0900 Subject: [PATCH 51/55] =?UTF-8?q?=E3=82=8F=E3=81=96=E3=81=A8=E5=A4=B1?= =?UTF-8?q?=E6=95=97=E3=81=97=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenario_test/test.py b/scenario_test/test.py index a9247b0f4..f736ec805 100644 --- a/scenario_test/test.py +++ b/scenario_test/test.py @@ -23,7 +23,7 @@ def test_robot_speed(rcst_comm: Communication): success = False break time.sleep(1) - assert success is True + assert False is True def test_avoid_ball(rcst_comm: Communication): @@ -54,7 +54,7 @@ def check(x: float, y: float, vx: float = 0.0, vy: float = 0.0): success = False break time.sleep(1) - assert success is True + assert False is True check(0, 0) check(-3.5, 0) From 22ae6752eac0029f2106289cadfc4d78228505f4 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 02:50:06 +0900 Subject: [PATCH 52/55] =?UTF-8?q?pre-commit=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index ecc750d9f..2453f7718 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -84,7 +84,7 @@ jobs: fail-fast: false matrix: env: - - {TEST: "test"} + - TEST: "test" runs-on: ubuntu-latest steps: From 4dc76d9f099b59960cd66ebdf10cfc7891c5e4bf Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 03:25:18 +0900 Subject: [PATCH 53/55] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E5=88=86=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenario_test/{test.py => STOP_AVOID_BALL.py} | 30 ++++--------------- scenario_test/STOP_ROBOT_SPEED.py | 28 +++++++++++++++++ 2 files changed, 33 insertions(+), 25 deletions(-) rename scenario_test/{test.py => STOP_AVOID_BALL.py} (51%) create mode 100644 scenario_test/STOP_ROBOT_SPEED.py diff --git a/scenario_test/test.py b/scenario_test/STOP_AVOID_BALL.py similarity index 51% rename from scenario_test/test.py rename to scenario_test/STOP_AVOID_BALL.py index 8dc72403a..c4993e789 100644 --- a/scenario_test/test.py +++ b/scenario_test/STOP_AVOID_BALL.py @@ -6,41 +6,21 @@ from rcst.robot import RobotDict -def test_robot_speed(rcst_comm: Communication): - rcst_comm.send_empty_world() - ball_x = 1.0 - rcst_comm.send_ball(ball_x, 0) - for i in range(11): - rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) - - rcst_comm.change_referee_command("STOP", 3.0) - - rcst_comm.observer.reset() - success = True - rcst_comm.send_ball(ball_x, 0, 5.0, 0.0) # Move the ball - for _ in range(5): - if rcst_comm.observer.robot_speed().some_blue_robots_over(1.5): - success = False - break - time.sleep(1) - assert False is True - - def test_avoid_ball(rcst_comm: Communication): rcst_comm.send_empty_world() for i in range(11): - rcst_comm.send_blue_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) + rcst_comm.send_yellow_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) - def blue_robot_did_not_avoid_ball( + def yellow_robot_did_not_avoid_ball( ball: Ball, blue_robots: RobotDict, yellow_robots: RobotDict ) -> bool: - for robot in blue_robots.values(): + for robot in yellow_robots.values(): if calc.distance_robot_and_ball(robot, ball) < 0.4: return True return False rcst_comm.observer.customized().register_sticky_true_callback( - "blue_robot_did_not_avoid_ball", blue_robot_did_not_avoid_ball + "yellow_robot_did_not_avoid_ball", yellow_robot_did_not_avoid_ball ) rcst_comm.change_referee_command("STOP", 1.0) @@ -52,7 +32,7 @@ def check(x: float, y: float, vx: float = 0.0, vy: float = 0.0): success = True for _ in range(5): - if rcst_comm.observer.customized().get_result("blue_robot_did_not_avoid_ball"): + if rcst_comm.observer.customized().get_result("yellow_robot_did_not_avoid_ball"): success = False break time.sleep(1) diff --git a/scenario_test/STOP_ROBOT_SPEED.py b/scenario_test/STOP_ROBOT_SPEED.py new file mode 100644 index 000000000..5098063d9 --- /dev/null +++ b/scenario_test/STOP_ROBOT_SPEED.py @@ -0,0 +1,28 @@ +import math +import time +from rcst.communication import Communication +from rcst import calc +from rcst.ball import Ball +from rcst.robot import RobotDict + + +def test_robot_speed(rcst_comm: Communication): + rcst_comm.send_empty_world() + ball_x = 1.0 + rcst_comm.send_ball(ball_x, 0) + for i in range(11): + rcst_comm.send_yellow_robot(i, -1.0, 3.0 - i * 0.5, math.radians(0)) + + # rcst_comm.change_referee_command("HALT", 3.0) + + rcst_comm.change_referee_command("STOP", 3.0) + + rcst_comm.observer.reset() + success = True + rcst_comm.send_ball(ball_x, 0, 5.0, 0.0) # Move the ball + for _ in range(10): + if rcst_comm.observer.robot_speed().some_yellow_robots_over(1.5): + success = False + break + time.sleep(1) + assert success is True From ce303ea8f8ba8821a0722d5c9b6fdbc63af903c1 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 03:25:46 +0900 Subject: [PATCH 54/55] =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scenario_test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scenario_test.yaml b/.github/workflows/scenario_test.yaml index 2453f7718..af5735bd8 100644 --- a/.github/workflows/scenario_test.yaml +++ b/.github/workflows/scenario_test.yaml @@ -79,12 +79,13 @@ jobs: pip install pytest scenario_test: -# needs: [create_scenario_test_image, setup_scenario_test_library] + needs: [create_scenario_test_image, setup_scenario_test_library] strategy: fail-fast: false matrix: env: - - TEST: "test" + - TEST: STOP_AVOID_BALL + - TEST: STOP_ROBOT_SPEED runs-on: ubuntu-latest steps: @@ -116,8 +117,7 @@ jobs: run: | docker compose -f docker/scenario/docker-compose.yaml up -d env: - CRANE_TAG: scenario-6c4428c6efa64da3bfcfa5abd753fb31b6331f7b -# CRANE_TAG: scenario-${{ github.sha }} + CRANE_TAG: scenario-${{ github.sha }} - name: Wait for crane to start timeout-minutes: 5 From 6219f920eee1eaec841f5b21390fcbf7cb064461 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Sat, 1 Jun 2024 03:32:16 +0900 Subject: [PATCH 55/55] =?UTF-8?q?=E3=83=88=E3=83=AA=E3=82=AC=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=85=83=E3=81=AB=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml index 0c5c49567..be25795d7 100644 --- a/.github/workflows/docker_build.yaml +++ b/.github/workflows/docker_build.yaml @@ -5,8 +5,6 @@ on: branches: - develop workflow_dispatch: - pull_request: - jobs: build_base: name: build base image