From 758c8258d8fb011194771f133c8f2640724a80c6 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:33:59 +0200 Subject: [PATCH 1/6] Bump docker image build action and add handling branch name arg --- .github/workflows/ros-docker-image.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 2d5b4cd..73f9329 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -4,6 +4,9 @@ name: Build/Publish ROS Docker Image on: workflow_dispatch: inputs: + panther_codebase_version: + description: Version of the panther_ros to be used in the docker image (branch/tag/commit). + required: true build_type: description: Is it a "development" or a "stable" release? required: true @@ -48,13 +51,14 @@ jobs: uses: actions/checkout@v2 - name: Build Docker Image - uses: husarion-ci/ros-docker-img-action@v0.5 + uses: husarion-ci/ros-docker-img-action@v0.6 with: dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} main_branch_name: ros2 dockerfile: ${{ matrix.dockerfile }} repo_name: ${{ matrix.repo_name }} + branch_name: ${{ inputs.panther_codebase_version }} build_type: ${{ inputs.build_type }} ros_distro: ${{ matrix.ros_distro }} platforms: ${{ matrix.platforms }} From c0614f0565090949ff8f09c017b55aaae4f80590 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:35:58 +0200 Subject: [PATCH 2/6] Add type and default value --- .github/workflows/ros-docker-image.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 73f9329..92f1711 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -7,6 +7,8 @@ on: panther_codebase_version: description: Version of the panther_ros to be used in the docker image (branch/tag/commit). required: true + type: string + default: ros2-devel build_type: description: Is it a "development" or a "stable" release? required: true From 5030f07d6cd79c0cfeba594099811219724ad55e Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 11:42:48 +0200 Subject: [PATCH 3/6] Parametrize branch name in Dockerfiles --- Dockerfile.hardware | 3 ++- Dockerfile.simulation | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index a16c142..13b05e5 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -1,5 +1,6 @@ ARG ROS_DISTRO=humble ARG BUILD_TEST=OFF +ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core @@ -13,7 +14,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 995fe8b..63eab42 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -1,5 +1,6 @@ ARG ROS_DISTRO=humble ARG BUILD_TEST=OFF +ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core @@ -13,7 +14,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ${BRANCH_NAME} https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_${HUSARION_ROS_BUILD_TYPE}.repos && \ cp -r src/ros2_controllers/diff_drive_controller src && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && \ From 98cffa282ad36f45221212a9730e12fdde9ffe7c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Wed, 11 Sep 2024 12:21:10 +0200 Subject: [PATCH 4/6] Change dockerfile args scope --- Dockerfile.hardware | 5 +++-- Dockerfile.simulation | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile.hardware b/Dockerfile.hardware index 13b05e5..198b39f 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -1,9 +1,10 @@ ARG ROS_DISTRO=humble -ARG BUILD_TEST=OFF -ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core +ARG BRANCH_NAME=ros2-devel +ARG BUILD_TEST=OFF + ENV HUSARION_ROS_BUILD_TYPE=hardware STOPSIGNAL SIGINT diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 63eab42..222c5cc 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -1,9 +1,10 @@ ARG ROS_DISTRO=humble -ARG BUILD_TEST=OFF -ARG BRANCH_NAME=ros2-devel FROM husarnet/ros:${ROS_DISTRO}-ros-core +ARG BRANCH_NAME=ros2-devel +ARG BUILD_TEST=OFF + ENV HUSARION_ROS_BUILD_TYPE=simulation STOPSIGNAL SIGINT From f1d20143a1bb8d89770765629de5ee43ce54f55c Mon Sep 17 00:00:00 2001 From: rafal-gorecki <126687345+rafal-gorecki@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:33:40 +0200 Subject: [PATCH 5/6] Use newer version with updated ROBOT_NAMESPACE (#87) * Use newer version with updated ROBOT_NAMESPACE * Sim update * Update compose.minimal-setup.yaml * Add ROBOT_MODEL env --- .coderabbit.yaml | 9 +++++---- .github/workflows/protect-default-branch.yaml | 5 +++-- .github/workflows/release-repository.yaml | 15 +++++++++------ README.md | 4 +++- demo/compose.minimal-setup.yaml | 8 ++++---- demo/compose.simulation.yaml | 3 +-- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 51c85f2..8c9c45d 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -1,8 +1,9 @@ +--- # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json -language: "en-US" +language: en-US early_access: false reviews: - profile: "chill" + profile: chill request_changes_workflow: false high_level_summary: true poem: false @@ -12,6 +13,6 @@ reviews: enabled: true drafts: false base_branches: - - "ros2-devel" + - ros2-devel chat: - auto_reply: true \ No newline at end of file + auto_reply: true diff --git a/.github/workflows/protect-default-branch.yaml b/.github/workflows/protect-default-branch.yaml index 61f85f4..678daeb 100644 --- a/.github/workflows/protect-default-branch.yaml +++ b/.github/workflows/protect-default-branch.yaml @@ -1,8 +1,9 @@ +--- name: Validate PR head branch on: pull_request: branches: - - "ros2" + - ros2 jobs: check-head-branch: @@ -20,4 +21,4 @@ jobs: else echo "PRs must come from branches containing 'hotfix' phrase or matching X.X.X-YYYYMMDD pattern." exit 1 - fi \ No newline at end of file + fi diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 2e7e4e2..c742d18 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -11,8 +11,7 @@ on: description: New version (used for tag). required: true release_name: - description: - Name of the release to be created. Version in the first place is recommended (e.g. + description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). required: true automatic_mode: @@ -61,18 +60,21 @@ jobs: --body "This PR incorporates release updates." - name: Merge PR to main branch - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && github.event.inputs.release_candidate != env.MAIN_BRANCH && env.DIFF == 'true' }} + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && github.event.inputs.release_candidate + != env.MAIN_BRANCH && env.DIFF == 'true' }} run: | gh pr merge ${{ github.event.inputs.release_candidate }} \ --merge --delete-branch - name: Delete branch - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && github.event.inputs.release_candidate != env.MAIN_BRANCH && env.DIFF == 'false' }} + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && github.event.inputs.release_candidate + != env.MAIN_BRANCH && env.DIFF == 'false' }} run: | git push origin --delete ${{ github.event.inputs.release_candidate }} - name: Create prerelease - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == true}} + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) + == true}} run: | gh release create ${{ github.event.inputs.version }} \ --target ${{ env.MAIN_BRANCH }} \ @@ -81,7 +83,8 @@ jobs: --prerelease - name: Create release - if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == false}} + if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) + == false}} run: | gh release create ${{ github.event.inputs.version }} \ --target ${{ env.MAIN_BRANCH }} \ diff --git a/README.md b/README.md index 9ba248d..6019186 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,6 @@ docker compose -f compose.simulation.yaml up ``` > [!NOTE] -> If you have an NVIDIA GPU, it is worth changing the compose configuration from cpu-config to gpu-config. For this purpose, it is necessary to install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). With NVIDIA Container Toolkit installed, modify following Docker compose file by replacing `*cpu-config` with `*gpu-config`: [compose.simulation.yaml](./demo/compose.simulation.yaml). +> +> 1. You can change robot model and namespace by editing the launch command in `compose.simulation.yaml`. +> 2. If you have an NVIDIA GPU, it is worth changing the compose configuration from `cpu-config` to `gpu-config`. For this purpose, it is necessary to install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html). With NVIDIA Container Toolkit installed, modify following Docker compose file by replacing `*cpu-config` with `*gpu-config`: [compose.simulation.yaml](./demo/compose.simulation.yaml). diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 8e13949..3576675 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -4,7 +4,8 @@ x-common-config: &common-config restart: always environment: - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # Default FastDDS do not work - - ROBOT_NAMESPACE=panther + - ROBOT_MODEL=${ROBOT_MODEL:-panther} + - ROBOT_NAMESPACE=${ROBOT_MODEL:-panther} - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} services: panther_ros: @@ -37,7 +38,7 @@ services: ros2 launch panther_bringup bringup.launch.py gamepad_controller: - image: husarion/joy2twist:humble-1.0.0-20240725-stable + image: husarion/joy2twist:humble-1.0.0-20241003-stable container_name: gamepad_controller <<: *common-config devices: @@ -46,5 +47,4 @@ services: - 'c 13:0 rmw' # gamepad stop_signal: SIGINT command: > - bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_panther.yaml namespace:=panther" - + bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_ugv.yaml" diff --git a/demo/compose.simulation.yaml b/demo/compose.simulation.yaml index d39dc8f..c24c55e 100644 --- a/demo/compose.simulation.yaml +++ b/demo/compose.simulation.yaml @@ -19,5 +19,4 @@ services: volumes: - /tmp/.X11-unix:/tmp/.X11-unix:rw command: > - ros2 launch panther_gazebo simulation.launch.py namespace:=panther - + ros2 launch panther_gazebo simulation.launch.py robot_model:=panther namespace:=panther From 88fe702ffe14694fe4dcef5e8a60c4d48eff4c87 Mon Sep 17 00:00:00 2001 From: action-bot Date: Mon, 25 Nov 2024 13:24:27 +0000 Subject: [PATCH 6/6] Update docker image tag --- demo/compose.minimal-setup.yaml | 3 ++- demo/compose.simulation.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/demo/compose.minimal-setup.yaml b/demo/compose.minimal-setup.yaml index 3576675..aa4dea9 100644 --- a/demo/compose.minimal-setup.yaml +++ b/demo/compose.minimal-setup.yaml @@ -9,7 +9,7 @@ x-common-config: &common-config - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} services: panther_ros: - image: husarion/panther:humble-2.1.1-20240828 + image: husarion/panther:humble-2.1.2-20241125 container_name: panther_ros <<: *common-config devices: @@ -48,3 +48,4 @@ services: stop_signal: SIGINT command: > bash -c "ros2 launch joy2twist gamepad_controller.launch.py joy2twist_params_file:=$(ros2 pkg prefix joy2twist)/share/joy2twist/config/joy2twist_ugv.yaml" + diff --git a/demo/compose.simulation.yaml b/demo/compose.simulation.yaml index c24c55e..8f49dbb 100644 --- a/demo/compose.simulation.yaml +++ b/demo/compose.simulation.yaml @@ -11,7 +11,7 @@ x-gpu-config: &gpu-config env_file: .env.gpu services: panther_gazebo: - image: husarion/panther-gazebo:humble-2.1.1-20240828 + image: husarion/panther-gazebo:humble-2.1.2-20241125 container_name: panther_gazebo <<: - *common-config @@ -20,3 +20,4 @@ services: - /tmp/.X11-unix:/tmp/.X11-unix:rw command: > ros2 launch panther_gazebo simulation.launch.py robot_model:=panther namespace:=panther +