diff --git a/.github/workflows/ci-format.yml b/.github/workflows/ci-format.yml index 9eb2f6b..af8422d 100644 --- a/.github/workflows/ci-format.yml +++ b/.github/workflows/ci-format.yml @@ -18,9 +18,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.9.7 - - name: Install system hooks - run: sudo apt-get install clang-format-10 cppcheck - - uses: pre-commit/action@v2.0.3 + python-version: '3.10' + - uses: pre-commit/action@v3.0.0 with: extra_args: --all-files --hook-stage manual diff --git a/.github/workflows/ci-ros-lint.yml b/.github/workflows/ci-ros-lint.yml deleted file mode 100644 index 4d42350..0000000 --- a/.github/workflows/ci-ros-lint.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: ROS2 Lint -on: - pull_request: - -jobs: - ament_lint: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - linter: [cppcheck, copyright, lint_cmake] - steps: - - uses: actions/checkout@v1 - - uses: ros-tooling/setup-ros@v0.2 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: rolling - linter: ${{ matrix.linter }} - package-name: - ur_simulation_ignition - - - ament_lint_100: - name: ament_${{ matrix.linter }} - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - linter: [cpplint] - steps: - - uses: actions/checkout@v1 - - uses: ros-tooling/setup-ros@v0.2 - - uses: ros-tooling/action-ros-lint@v0.1 - with: - distribution: rolling - linter: cpplint - arguments: "--linelength=100 --filter=-whitespace/newline" - package-name: - ur_simulation_ignition diff --git a/.github/workflows/galactic-binary-build.yml b/.github/workflows/galactic-binary-build.yml deleted file mode 100644 index cf04c41..0000000 --- a/.github/workflows/galactic-binary-build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Galactic Binary Build -on: - pull_request: - branches: - - ros2 - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' - -jobs: - galactic_binary: - name: galactic binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: galactic, ROS_REPO: main} - - {ROS_DISTRO: galactic, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: Universal_Robots_ROS2_Ignition_Simulation-not-released.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/galactic-semi-binary-build.yml b/.github/workflows/galactic-semi-binary-build.yml deleted file mode 100644 index 30ca2f3..0000000 --- a/.github/workflows/galactic-semi-binary-build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Galactic Semi-Binary Build -on: - pull_request: - branches: - - ros2 - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' - -jobs: - galactic_semi_binary: - name: galactic semi-binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: galactic, ROS_REPO: main} - - {ROS_DISTRO: galactic, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: Universal_Robots_ROS2_Ignition_Simulation.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/galactic-source-build.yml b/.github/workflows/galactic-source-build.yml deleted file mode 100644 index 9fd56f1..0000000 --- a/.github/workflows/galactic-source-build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Galactic Source Build -on: - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '43 1 * * *' - -jobs: - rolling_source: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - env: - ROS_DISTRO: galactic - steps: - - uses: ros-tooling/setup-ros@v0.2 - with: - required-ros-distributions: ${{ env.ROS_DISTRO }} - - uses: actions/checkout@v2 - - uses: ros-tooling/action-ros-ci@v0.2 - with: - target-ros2-distro: ${{ env.ROS_DISTRO }} - # build all packages listed in the meta package - package-name: - ur_simulation_ignition - - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/Universal_Robots_ROS2_Ignition_Simulation.${{ env.ROS_DISTRO }}.repos - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/.github/workflows/humble-binary-main.yml b/.github/workflows/humble-binary-main.yml new file mode 100644 index 0000000..a82498a --- /dev/null +++ b/.github/workflows/humble-binary-main.yml @@ -0,0 +1,21 @@ +name: Humble Binary Main +on: + workflow_dispatch: + branches: + - humble + pull_request: + branches: + - humble + push: + branches: + - humble + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: humble + ros_repo: main + ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-binary-testing.yml b/.github/workflows/humble-binary-testing.yml new file mode 100644 index 0000000..9b13c39 --- /dev/null +++ b/.github/workflows/humble-binary-testing.yml @@ -0,0 +1,21 @@ +name: Humble Binary Testing +on: + workflow_dispatch: + branches: + - humble + pull_request: + branches: + - humble + push: + branches: + - humble + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: humble + ros_repo: testing + ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-main.yml b/.github/workflows/humble-semi-binary-main.yml new file mode 100644 index 0000000..a83d23f --- /dev/null +++ b/.github/workflows/humble-semi-binary-main.yml @@ -0,0 +1,22 @@ +name: Humble Semi Binary Main +on: + workflow_dispatch: + branches: + - humble + pull_request: + branches: + - humble + push: + branches: + - humble + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: humble + ros_repo: main + ref_for_scheduled_build: humble + upstream_workspace: ur_simulation_gz.humble.repos diff --git a/.github/workflows/humble-semi-binary-testing.yml b/.github/workflows/humble-semi-binary-testing.yml new file mode 100644 index 0000000..8a078f8 --- /dev/null +++ b/.github/workflows/humble-semi-binary-testing.yml @@ -0,0 +1,22 @@ +name: Humble Semi Binary Testing +on: + workflow_dispatch: + branches: + - humble + pull_request: + branches: + - humble + push: + branches: + - humble + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: humble + ros_repo: testing + ref_for_scheduled_build: humble + upstream_workspace: ur_simulation_gz.humble.repos diff --git a/.github/workflows/iron-binary-main.yml b/.github/workflows/iron-binary-main.yml new file mode 100644 index 0000000..40ddb61 --- /dev/null +++ b/.github/workflows/iron-binary-main.yml @@ -0,0 +1,21 @@ +name: Iron Binary Main +on: + workflow_dispatch: + branches: + - iron + pull_request: + branches: + - iron + push: + branches: + - iron + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: iron + ros_repo: main + ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-binary-testing.yml b/.github/workflows/iron-binary-testing.yml new file mode 100644 index 0000000..f790e51 --- /dev/null +++ b/.github/workflows/iron-binary-testing.yml @@ -0,0 +1,21 @@ +name: Iron Binary Testing +on: + workflow_dispatch: + branches: + - iron + pull_request: + branches: + - iron + push: + branches: + - iron + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: iron + ros_repo: testing + ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-semi-binary-main.yml b/.github/workflows/iron-semi-binary-main.yml new file mode 100644 index 0000000..c587f71 --- /dev/null +++ b/.github/workflows/iron-semi-binary-main.yml @@ -0,0 +1,22 @@ +name: Iron Semi Binary Main +on: + workflow_dispatch: + branches: + - iron + pull_request: + branches: + - iron + push: + branches: + - iron + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: iron + ros_repo: main + ref_for_scheduled_build: iron + upstream_workspace: ur_simulation_gz.iron.repos diff --git a/.github/workflows/iron-semi-binary-testing.yml b/.github/workflows/iron-semi-binary-testing.yml new file mode 100644 index 0000000..36429f6 --- /dev/null +++ b/.github/workflows/iron-semi-binary-testing.yml @@ -0,0 +1,22 @@ +name: Iron Semi Binary Testing +on: + workflow_dispatch: + branches: + - iron + pull_request: + branches: + - iron + push: + branches: + - iron + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: iron + ros_repo: testing + ref_for_scheduled_build: iron + upstream_workspace: ur_simulation_gz.iron.repos diff --git a/.github/workflows/reusable_ici.yml b/.github/workflows/reusable_ici.yml new file mode 100644 index 0000000..f056f41 --- /dev/null +++ b/.github/workflows/reusable_ici.yml @@ -0,0 +1,85 @@ +name: Reusable industrial_ci workflow +# original author: Denis Štogl + +on: + workflow_call: + inputs: + ref_for_scheduled_build: + description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' + default: '' + required: false + type: string + upstream_workspace: + description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.' + required: false + type: string + ros_distro: + description: 'ROS_DISTRO variable for industrial_ci' + required: true + type: string + ros_repo: + description: 'ROS_REPO to run for industrial_ci. Possible values: "main", "testing"' + default: 'main' + required: false + type: string + before_install_upstream_dependencies: + description: 'BEFORE_INSTALL_UPSTREAM_DEPENDENCIES variable for industrial_ci' + default: '' + required: false + type: string + ccache_dir: + description: 'Local path to store cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' + default: '.ccache' + required: false + type: string + basedir: + description: 'Local path to workspace base directory to cache (from "github.workspace"). For standard industrial_ci configuration do not have to be changed' + default: '.work' + required: false + type: string + +jobs: + reusable_ici: + name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} ${{ inputs.os_code_name }} + runs-on: ubuntu-latest + env: + CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} + BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }} + CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }} + steps: + - name: Checkout ${{ inputs.ref }} when build is not scheduled + if: ${{ github.event_name != 'schedule' }} + uses: actions/checkout@v4 + - name: Checkout ${{ inputs.ref }} on scheduled build + if: ${{ github.event_name == 'schedule' }} + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref_for_scheduled_build }} + - name: cache target_ws + if: ${{ ! matrix.env.CCOV }} + uses: pat-s/always-upload-cache@v3.0.11 + with: + path: ${{ env.BASEDIR }}/target_ws + key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} + restore-keys: | + target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} + - name: cache ccache + uses: pat-s/always-upload-cache@v3.0.11 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} + ccache-${{ env.CACHE_PREFIX }} + - uses: 'ros-industrial/industrial_ci@master' + env: + UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }} + ROS_DISTRO: ${{ inputs.ros_distro }} + ROS_REPO: ${{ inputs.ros_repo }} + - name: prepare target_ws for cache + if: ${{ always() && ! matrix.env.CCOV }} + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src + du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/rolling-binary-build.yml b/.github/workflows/rolling-binary-build.yml deleted file mode 100644 index 4c7b669..0000000 --- a/.github/workflows/rolling-binary-build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Rolling Binary Build -on: - pull_request: - branches: - - ros2 - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' - -jobs: - rolling_binary: - name: rolling binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: rolling, ROS_REPO: main} - - {ROS_DISTRO: rolling, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: Universal_Robots_ROS2_Ignition_Simulation-not-released.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/rolling-binary-main.yml b/.github/workflows/rolling-binary-main.yml new file mode 100644 index 0000000..9f0daa8 --- /dev/null +++ b/.github/workflows/rolling-binary-main.yml @@ -0,0 +1,22 @@ +name: Rolling Binary Main +on: + workflow_dispatch: + branches: + - ros2 + pull_request: + branches: + - ros2 + push: + branches: + - ros2 + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: rolling + ros_repo: main + ref_for_scheduled_build: ros2 + upstream_workspace: ur_simulation_gz-not-released.rolling.repos diff --git a/.github/workflows/rolling-binary-testing.yml b/.github/workflows/rolling-binary-testing.yml new file mode 100644 index 0000000..1520ffe --- /dev/null +++ b/.github/workflows/rolling-binary-testing.yml @@ -0,0 +1,22 @@ +name: Rolling Binary Testing +on: + workflow_dispatch: + branches: + - ros2 + pull_request: + branches: + - ros2 + push: + branches: + - ros2 + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: rolling + ros_repo: testing + ref_for_scheduled_build: ros2 + upstream_workspace: ur_simulation_gz-not-released.rolling.repos diff --git a/.github/workflows/rolling-semi-binary-build.yml b/.github/workflows/rolling-semi-binary-build.yml deleted file mode 100644 index 42bb686..0000000 --- a/.github/workflows/rolling-semi-binary-build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Rolling Semi-Binary Build -on: - pull_request: - branches: - - ros2 - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '13 4 * * *' - -jobs: - rolling_semi_binary: - name: rolling semi-binary build - runs-on: ubuntu-latest - strategy: - matrix: - env: - - {ROS_DISTRO: rolling, ROS_REPO: main} - - {ROS_DISTRO: rolling, ROS_REPO: testing} - env: - UPSTREAM_WORKSPACE: Universal_Robots_ROS2_Ignition_Simulation.${{ matrix.env.ROS_DISTRO }}.repos - CCACHE_DIR: ${{ github.workspace }}/.ccache - BASEDIR: ${{ github.workspace }}/.work - CACHE_PREFIX: ${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }} - steps: - - uses: actions/checkout@v1 - # The target directory cache doesn't include the source directory because - # that comes from the checkout. See "prepare target_ws for cache" task below - - name: cache target_ws - if: ${{ ! matrix.env.CCOV }} - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.BASEDIR }}/target_ws - key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} - restore-keys: | - target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} - - name: cache ccache - uses: pat-s/always-upload-cache@v2.1.5 - with: - path: ${{ env.CCACHE_DIR }} - key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} - restore-keys: | - ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} - ccache-${{ env.CACHE_PREFIX }} - - uses: 'ros-industrial/industrial_ci@master' - with: - config: ${{toJSON(matrix.env)}} - - name: prepare target_ws for cache - if: ${{ always() && ! matrix.env.CCOV }} - run: | - du -sh ${{ env.BASEDIR }}/target_ws - sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete - sudo rm -rf ${{ env.BASEDIR }}/target_ws/src - du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/rolling-semi-binary-main.yml b/.github/workflows/rolling-semi-binary-main.yml new file mode 100644 index 0000000..f569d97 --- /dev/null +++ b/.github/workflows/rolling-semi-binary-main.yml @@ -0,0 +1,22 @@ +name: Rolling Semi Binary Main +on: + workflow_dispatch: + branches: + - ros2 + pull_request: + branches: + - ros2 + push: + branches: + - ros2 + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: rolling + ros_repo: main + ref_for_scheduled_build: ros2 + upstream_workspace: ur_simulation_gz.rolling.repos diff --git a/.github/workflows/rolling-semi-binary-testing.yml b/.github/workflows/rolling-semi-binary-testing.yml new file mode 100644 index 0000000..739fed4 --- /dev/null +++ b/.github/workflows/rolling-semi-binary-testing.yml @@ -0,0 +1,22 @@ +name: Rolling Semi Binary Testing +on: + workflow_dispatch: + branches: + - ros2 + pull_request: + branches: + - ros2 + push: + branches: + - ros2 + schedule: + - cron: '13 4 * * *' + +jobs: + binary: + uses: ./.github/workflows/reusable_ici.yml + with: + ros_distro: rolling + ros_repo: testing + ref_for_scheduled_build: ros2 + upstream_workspace: ur_simulation_gz.rolling.repos diff --git a/.github/workflows/rolling-source-build.yml b/.github/workflows/rolling-source-build.yml deleted file mode 100644 index 3ced387..0000000 --- a/.github/workflows/rolling-source-build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Rolling Source Build -on: - push: - branches: - - ros2 - schedule: - # Run every morning to detect flakiness and broken dependencies - - cron: '43 1 * * *' - -jobs: - rolling_source: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - env: - ROS_DISTRO: rolling - steps: - - uses: ros-tooling/setup-ros@v0.2 - with: - required-ros-distributions: ${{ env.ROS_DISTRO }} - - uses: actions/checkout@v2 - - uses: ros-tooling/action-ros-ci@v0.2 - with: - target-ros2-distro: ${{ env.ROS_DISTRO }} - # build all packages listed in the meta package - package-name: - ur_simulation_ignition - - vcs-repo-file-url: | - https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos - https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/Universal_Robots_ROS2_Ignition_Simulation.${{ env.ROS_DISTRO }}.repos - colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-${{ matrix.os }} - path: ros_ws/log diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e97698..25f05ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-ast @@ -33,69 +33,23 @@ repos: # Python hooks - repo: https://github.com/asottile/pyupgrade - rev: v2.29.1 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.11.0 hooks: - id: black args: ["--line-length=99"] - # PEP 257 - - repo: https://github.com/FalconSocial/pre-commit-mirrors-pep257 - rev: v0.3.3 - hooks: - - id: pep257 - args: ["--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404"] - - repo: https://github.com/pycqa/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 args: ["--ignore=E501"] - # CPP hooks - - repo: local - hooks: - - id: clang-format - name: clang-format - description: Format files with ClangFormat. - entry: clang-format-10 - language: system - files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$ - args: ['-fallback-style=none', '-i'] - # The same options as in ament_cppcheck are used, but its not working... - #- repo: https://github.com/pocc/pre-commit-hooks - #rev: v1.1.1 - #hooks: - #- id: cppcheck - #args: ['--error-exitcode=1', '-f', '--inline-suppr', '-q', '-rp', '--suppress=internalAstError', '--suppress=unknownMacro', '--verbose'] - - - repo: local - hooks: - - id: ament_cppcheck - name: ament_cppcheck - description: Static code analysis of C/C++ files. - stages: [commit] - entry: ament_cppcheck - language: system - files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ - - # Maybe use https://github.com/cpplint/cpplint instead - - repo: local - hooks: - - id: ament_cpplint - name: ament_cpplint - description: Static code analysis of C/C++ files. - stages: [commit] - entry: ament_cpplint - language: system - files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$ - args: ["--linelength=100", "--filter=-whitespace/newline"] - # Cmake hooks - repo: local hooks: @@ -119,14 +73,14 @@ repos: # Docs - RestructuredText hooks - repo: https://github.com/PyCQA/doc8 - rev: 0.10.1 + rev: v1.1.1 hooks: - id: doc8 args: ['--max-line-length=100', '--ignore=D001'] exclude: CHANGELOG\.rst$ - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-backticks exclude: CHANGELOG\.rst$ @@ -136,7 +90,7 @@ repos: # Spellcheck in comments and docs # skipping of *.svg files is not working... - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.6 hooks: - id: codespell args: ['--write-changes'] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..309be1e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +Any contribution that you make to this repository will +be under the 3-Clause BSD License, as dictated by that +[license](https://opensource.org/licenses/BSD-3-Clause). diff --git a/LICENSE b/LICENSE index 225382c..574ef07 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,25 @@ -BSD 3-Clause License - -Copyright (c) 2021, Universal Robots A/S -All rights reserved. - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 15f4c4b..703d157 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,71 @@ -Universal_Robots_ROS2_Ignition_Simulation +Universal_Robots_ROS2_GZ_Simulation ========================================== -Example files and configurations for Ignition Gazebo simulation of Universal Robots' manipulators. +Example files and configurations for Gazebo simulation of Universal Robots' manipulators. ## Build status - -ROS2 Distro | Branch | Build status | Released packages -:---------: | :----: | :----------: | :---------------: -**Galactic** | [`galactic`](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/tree/galactic) | [![Galactic Binary Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-binary-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-binary-build.yml?branch=ros2)
[![Galactic Semi-Binary Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-semi-binary-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-semi-binary-build.yml?branch=ros2)
[![Galactic Source Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-source-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/galactic-source-build.yml?branch=ros2) | [ur_simulation_ignition](https://index.ros.org/p/ur_simulation_ignition/#galactic) -**Rolling** | [`rolling`](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/tree/rolling) | [![Rolling Binary Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-binary-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-binary-build.yml?branch=ros2)
[![Rolling Semi-Binary Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-semi-binary-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-semi-binary-build.yml?branch=ros2)
[![Rolling Source Build](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-source-build.yml/badge.svg?branch=ros2)](https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation/actions/workflows/rolling-source-build.yml?branch=ros2) | [ur_simulation_ignition](https://index.ros.org/p/ur_simulation_ignition/#rolling) - - -### Explanation of different build types - -**NOTE**: There are three build stages checking current and future compatibility of the package. - -1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that direct local build is possible. - - Uses repos file: `src/Universal_Robots_ROS2_Ignition_Simulation/Universal_Robots_ROS2_Ignition_Simulation-not-released..repos` - -1. Semi-binary builds - against released core ROS packages (main and testing), but the immediate dependencies are pulled from source. - Shows that local build with dependencies is possible and if fails there we can expect that after the next package sync we will not be able to build. - - Uses repos file: `src/Universal_Robots_ROS2_Ignition_Simulation/Universal_Robots_ROS2_Ignition_Simulation.repos` - -1. Source build - also core ROS packages are build from source. It shows potential issues in the mid future. - - -# Using the repository + + + + + + + + + + + + + + + + + + + +
HumbleIronRolling
Branchhumbleironros2
Build status + + Humble Binary Main +
+
+ + Iron Binary Main +
+
+ + Rolling Binary Main +
+
+ +A more [detailed build status](ci_status.md) shows the state of all CI workflows inside this repo. +Please note that the detailed view is intended for developers, while the one here should give end +users an overview of the current released state. + + +## Using the repository Skip any of below steps is not applicable. ### Setup ROS Workspace 1. Create a colcon workspace: ``` - export COLCON_WS=~/workspace/ros_ws_foxy + export COLCON_WS=~/workspaces/ur_gz mkdir -p $COLCON_WS/src ``` - > **NOTE:** Feel free to change `~/workspace/ros_ws_foxy` to whatever absolute path you want. + > **NOTE:** Feel free to change `~/workspaces/ur_gz` to whatever absolute path you want. > **NOTE:** Over time you will probably have multiple ROS workspaces, so it makes sense to them all in a subfolder. - Also, it is good practice to put the ROS version in the name of the workspace, for different tests you could just add a suffix to the base name `ros_ws_foxy`. + Also, it is good practice to put the ROS version in the name of the workspace, for different tests you could just add a suffix to the base name `ur_gz`. 1. Download the required repositories and install package dependencies: - **NOTE**: Current version is tested with Ignition version 5 ("edifice"). To get everything working properly set `IGNITION_VERSION` environment variable: - ``` - export IGNITION_VERSION=edifice - ``` - Then proceed with: ``` cd $COLCON_WS - git clone git@github.com:UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation.git src/Universal_Robots_ROS2_Ignition_Simulation - vcs import src --input src/Universal_Robots_ROS2_Ignition_Simulation/Universal_Robots_ROS2_Ignition_Simulation..repos - rosdep install --ignore-src --from-paths src -y -r # install also is there are unreleased packages - cd .. + git clone -b ros2 https://github.com/UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation.git src/ur_simulation_gz + rosdep update && rosdep install --ignore-src --from-paths src -y ``` @@ -63,20 +74,26 @@ Skip any of below steps is not applicable. To configure and build workspace execute following commands: ``` cd $COLCON_WS - colcon build --symlink-install --mixin rel-with-deb-info compile-commands ccache + colcon build --symlink-install ``` ## Running Executable +First, source your workspace + +``` +source $COLCON_WS/install/setup.bash +``` + ``` -ros2 launch ur_simulation_ignition ur_sim_control.launch.py +ros2 launch ur_simulation_gz ur_sim_control.launch.py ``` -Move robot using test script from `ur_bringup` package: +Move robot using test script from `ur_robot_driver` package (if you've installed that one): ``` -ros2 launch ur_bringup test_joint_trajectory_controller.launch.py +ros2 launch ur_robot_driver test_joint_trajectory_controller.launch.py ``` Example using MoveIt with simulated robot: ``` -ros2 launch ur_simulation_ignition ur_sim_moveit.launch.py +ros2 launch ur_simulation_gz ur_sim_moveit.launch.py ``` diff --git a/Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos b/Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos deleted file mode 100644 index 1e2d710..0000000 --- a/Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos +++ /dev/null @@ -1,28 +0,0 @@ -repositories: - - ign_ros2_control: - type: git - url: https://github.com/ignitionrobotics/ign_ros2_control.git - version: main - - ros2_control_demos: - type: git - url: https://github.com/ros-controls/ros2_control_demos.git - version: master - - Universal_Robots_Client_Library: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_Client_Library.git - version: master - Universal_Robots_ROS2_Description: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git - version: ros2 - Universal_Robots_ROS2_Driver: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git - version: remove-description-package - ur_msgs: - type: git - url: https://github.com/destogl/ur_msgs.git - version: ros2 diff --git a/Universal_Robots_ROS2_Ignition_Simulation-not-released.rolling.repos b/Universal_Robots_ROS2_Ignition_Simulation-not-released.rolling.repos deleted file mode 100644 index b552d72..0000000 --- a/Universal_Robots_ROS2_Ignition_Simulation-not-released.rolling.repos +++ /dev/null @@ -1,27 +0,0 @@ -repositories: - ign_ros2_control: - type: git - url: https://github.com/ignitionrobotics/ign_ros2_control.git - version: main - - ros2_control_demos: - type: git - url: https://github.com/ros-controls/ros2_control_demos.git - version: master - - Universal_Robots_Client_Library: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_Client_Library.git - version: master - Universal_Robots_ROS2_Description: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git - version: ros2 - Universal_Robots_ROS2_Driver: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git - version: remove-description-package - ur_msgs: - type: git - url: https://github.com/destogl/ur_msgs.git - version: ros2 diff --git a/Universal_Robots_ROS2_Ignition_Simulation.galactic.repos b/Universal_Robots_ROS2_Ignition_Simulation.galactic.repos deleted file mode 100644 index c87c1e9..0000000 --- a/Universal_Robots_ROS2_Ignition_Simulation.galactic.repos +++ /dev/null @@ -1,47 +0,0 @@ -repositories: - - ign_ros2_control: - type: git - url: https://github.com/ignitionrobotics/ign_ros2_control.git - version: main - ros_ign: - type: git - url: https://github.com/ignitionrobotics/ros_ign.git - version: ros2 - - moveit2: - type: git - url: https://github.com/destogl/moveit2.git - version: fix-controller-check-for-simulation - #url: https://github.com/ros-planning/moveit2.git - #version: main - - ros2_control: - type: git - url: https://github.com/ros-controls/ros2_control.git - version: galactic - ros2_control_demos: - type: git - url: https://github.com/ros-controls/ros2_control_demos.git - version: master - ros2_controllers: - type: git - url: https://github.com/ros-controls/ros2_controllers.git - version: master - - Universal_Robots_Client_Library: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_Client_Library.git - version: master - Universal_Robots_ROS2_Description: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git - version: simulation - Universal_Robots_ROS2_Driver: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git - version: remove-description-package - ur_msgs: - type: git - url: https://github.com/destogl/ur_msgs.git - version: ros2 diff --git a/ci_status.md b/ci_status.md new file mode 100644 index 0000000..5317c90 --- /dev/null +++ b/ci_status.md @@ -0,0 +1,88 @@ +## Build Status + +This page gives a detailed overview of the build status of this repository. Please note that due to +upstream changes some pipelines might turn red temporarily which can be expected behavior. + + + + + + + + + + + + + + + + + + + + +
HumbleIronRolling
Branchros2ros2ros2
Repo builds + + Humble Binary Main +
+ + Humble Binary Testing +
+ + Humble Semi-Binary Main +
+ + Humble Semi-Binary Testing + +
+ + Iron Binary Main +
+ + Iron Binary Testing +
+ + Iron Semi-Binary Main +
+ + Iron Semi-Binary Testing + +
+ + Rolling Binary Main +
+ + Rolling Binary Testing +
+ + Rolling Semi-Binary Main +
+ + Rolling Semi-Binary Testing + +
+ +## Explanation of different build types + +**NOTE**: There are three build stages checking current and future compatibility of the package. + +1. Binary builds - against released packages (main and testing) in ROS distributions. Shows that + direct local build is possible and integration tests work against the released state. + +1. Semi-binary builds - against released core ROS packages (main and testing), but the immediate dependencies are pulled from source. + Shows that local build with dependencies is possible and if this fails we can expect that after the next package sync we will not be able to build. + + Uses repos file: `ur_simulation_gz..repos` diff --git a/ur_simulation_gz-not-released.rolling.repos b/ur_simulation_gz-not-released.rolling.repos new file mode 100644 index 0000000..9ec6deb --- /dev/null +++ b/ur_simulation_gz-not-released.rolling.repos @@ -0,0 +1,5 @@ +repositories: + gz_ros2_control: + type: git + url: https://github.com/ros-controls/gz_ros2_control.git + version: master diff --git a/ur_simulation_gz.humble.repos b/ur_simulation_gz.humble.repos new file mode 100644 index 0000000..7b8f109 --- /dev/null +++ b/ur_simulation_gz.humble.repos @@ -0,0 +1,25 @@ +repositories: + gz_ros2_control: + type: git + url: https://github.com/ros-controls/gz_ros2_control.git + version: humble + ros_gz: + type: git + url: https://github.com/gazebosim/ros_gz + version: humble + moveit2: + type: git + url: https://github.com/ros-planning/moveit2.git + version: humble + ros2_control: + type: git + url: https://github.com/ros-controls/ros2_control.git + version: humble + ros2_controllers: + type: git + url: https://github.com/ros-controls/ros2_controllers.git + version: humble + Universal_Robots_ROS2_Description: + type: git + url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git + version: humble diff --git a/ur_simulation_gz.iron.repos b/ur_simulation_gz.iron.repos new file mode 100644 index 0000000..0f89292 --- /dev/null +++ b/ur_simulation_gz.iron.repos @@ -0,0 +1,25 @@ +repositories: + gz_ros2_control: + type: git + url: https://github.com/ignitionrobotics/gz_ros2_control.git + version: master + ros_gz: + type: git + url: https://github.com/gazebosim/ros_gz + version: iron + moveit2: + type: git + url: https://github.com/ros-planning/moveit2.git + version: iron + ros2_control: + type: git + url: https://github.com/ros-controls/ros2_control.git + version: iron + ros2_controllers: + type: git + url: https://github.com/ros-controls/ros2_controllers.git + version: iron + Universal_Robots_ROS2_Description: + type: git + url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git + version: iron diff --git a/Universal_Robots_ROS2_Ignition_Simulation.rolling.repos b/ur_simulation_gz.rolling.repos similarity index 52% rename from Universal_Robots_ROS2_Ignition_Simulation.rolling.repos rename to ur_simulation_gz.rolling.repos index 3b7152b..8d2f3af 100644 --- a/Universal_Robots_ROS2_Ignition_Simulation.rolling.repos +++ b/ur_simulation_gz.rolling.repos @@ -1,21 +1,20 @@ repositories: - - ign_ros2_control: + gz_ros2_control: type: git - url: https://github.com/ignitionrobotics/ign_ros2_control.git - version: main + url: https://github.com/ros-controls/gz_ros2_control.git + version: master ros_ign: type: git url: https://github.com/ignitionrobotics/ros_ign.git version: ros2 - moveit2: type: git - url: https://github.com/destogl/moveit2.git - version: fix-controller-check-for-simulation - #url: https://github.com/ros-planning/moveit2.git - #version: main - + url: https://github.com/ros-planning/moveit2.git + version: main + moveit_msgs: + type: git + url: https://github.com/ros-planning/moveit_msgs.git + version: ros2 ros2_control: type: git url: https://github.com/ros-controls/ros2_control.git @@ -28,20 +27,7 @@ repositories: type: git url: https://github.com/ros-controls/ros2_controllers.git version: master - - Universal_Robots_Client_Library: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_Client_Library.git - version: master Universal_Robots_ROS2_Description: type: git url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Description.git - version: simulation - Universal_Robots_ROS2_Driver: - type: git - url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git - version: remove-description-package - ur_msgs: - type: git - url: https://github.com/destogl/ur_msgs.git - version: ros2 + version: rolling diff --git a/ur_simulation_gz/CMakeLists.txt b/ur_simulation_gz/CMakeLists.txt new file mode 100644 index 0000000..48d5f6c --- /dev/null +++ b/ur_simulation_gz/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.5) +project(ur_simulation_gz) + +find_package(ament_cmake REQUIRED) + +install(DIRECTORY config launch urdf + DESTINATION share/${PROJECT_NAME} +) + +if(BUILD_TESTING) + find_package(ament_cmake_pytest REQUIRED) + + ament_add_pytest_test(description test/test_description.py) +endif() + +ament_package() diff --git a/ur_simulation_ignition/config/ur_controllers.yaml b/ur_simulation_gz/config/ur_controllers.yaml similarity index 100% rename from ur_simulation_ignition/config/ur_controllers.yaml rename to ur_simulation_gz/config/ur_controllers.yaml diff --git a/ur_simulation_ignition/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py similarity index 86% rename from ur_simulation_ignition/launch/ur_sim_control.launch.py rename to ur_simulation_gz/launch/ur_sim_control.launch.py index 97301d4..8adb070 100644 --- a/ur_simulation_ignition/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -38,13 +38,18 @@ from launch.conditions import IfCondition, UnlessCondition from launch.event_handlers import OnProcessExit from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution +from launch.substitutions import ( + Command, + FindExecutable, + LaunchConfiguration, + PathJoinSubstitution, + IfElseSubstitution, +) from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare def launch_setup(context, *args, **kwargs): - # Initialize Arguments ur_type = LaunchConfiguration("ur_type") safety_limits = LaunchConfiguration("safety_limits") @@ -53,19 +58,18 @@ def launch_setup(context, *args, **kwargs): # General arguments runtime_config_package = LaunchConfiguration("runtime_config_package") controllers_file = LaunchConfiguration("controllers_file") - description_package = LaunchConfiguration("description_package") - description_file = LaunchConfiguration("description_file") prefix = LaunchConfiguration("prefix") activate_joint_controller = LaunchConfiguration("activate_joint_controller") initial_joint_controller = LaunchConfiguration("initial_joint_controller") launch_rviz = LaunchConfiguration("launch_rviz") + gazebo_gui = LaunchConfiguration("gazebo_gui") initial_joint_controllers = PathJoinSubstitution( [FindPackageShare(runtime_config_package), "config", controllers_file] ) rviz_config_file = PathJoinSubstitution( - [FindPackageShare(description_package), "rviz", "view_robot.rviz"] + [FindPackageShare("ur_description"), "rviz", "view_robot.rviz"] ) robot_description_content = Command( @@ -73,7 +77,7 @@ def launch_setup(context, *args, **kwargs): PathJoinSubstitution([FindExecutable(name="xacro")]), " ", PathJoinSubstitution( - [FindPackageShare(description_package), "urdf", description_file] + [FindPackageShare("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro"] ), " ", "safety_limits:=", @@ -94,8 +98,6 @@ def launch_setup(context, *args, **kwargs): "prefix:=", prefix, " ", - "sim_ignition:=true", - " ", "simulation_controllers:=", initial_joint_controllers, ] @@ -147,9 +149,9 @@ def launch_setup(context, *args, **kwargs): condition=UnlessCondition(activate_joint_controller), ) - # Ignition nodes - ignition_spawn_entity = Node( - package="ros_ign_gazebo", + # GZ nodes + gz_spawn_entity = Node( + package="ros_gz_sim", executable="create", output="screen", arguments=[ @@ -162,11 +164,15 @@ def launch_setup(context, *args, **kwargs): ], ) - ignition_launch_description = IncludeLaunchDescription( + gz_launch_description = IncludeLaunchDescription( PythonLaunchDescriptionSource( - [FindPackageShare("ros_ign_gazebo"), "/launch/ign_gazebo.launch.py"] + [FindPackageShare("ros_gz_sim"), "/launch/gz_sim.launch.py"] ), - launch_arguments={"ign_args": " -r -v 3 empty.sdf"}.items(), + launch_arguments={ + "gz_args": IfElseSubstitution( + gazebo_gui, if_value=" -r -v 4 empty.sdf", else_value=" -s -r -v 4 empty.sdf" + ) + }.items(), ) nodes_to_start = [ @@ -175,8 +181,8 @@ def launch_setup(context, *args, **kwargs): delay_rviz_after_joint_state_broadcaster_spawner, initial_joint_controller_spawner_stopped, initial_joint_controller_spawner_started, - ignition_spawn_entity, - ignition_launch_description, + gz_spawn_entity, + gz_launch_description, ] return nodes_to_start @@ -189,7 +195,7 @@ def generate_launch_description(): DeclareLaunchArgument( "ur_type", description="Type/series of used UR robot.", - choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"], + choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e", "ur20", "ur30"], default_value="ur5e", ) ) @@ -218,7 +224,7 @@ def generate_launch_description(): declared_arguments.append( DeclareLaunchArgument( "runtime_config_package", - default_value="ur_simulation_ignition", + default_value="ur_simulation_gz", description='Package with the controller\'s configuration in "config" folder. \ Usually the argument is not set, it enables use of a custom setup.', ) @@ -230,21 +236,6 @@ def generate_launch_description(): description="YAML file with the controllers configuration.", ) ) - declared_arguments.append( - DeclareLaunchArgument( - "description_package", - default_value="ur_description", - description="Description package with robot URDF/XACRO files. Usually the argument \ - is not set, it enables use of a custom description.", - ) - ) - declared_arguments.append( - DeclareLaunchArgument( - "description_file", - default_value="ur.urdf.xacro", - description="URDF/XACRO description file with the robot.", - ) - ) declared_arguments.append( DeclareLaunchArgument( "prefix", @@ -271,5 +262,10 @@ def generate_launch_description(): declared_arguments.append( DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?") ) + declared_arguments.append( + DeclareLaunchArgument( + "gazebo_gui", default_value="true", description="Start gazebo with GUI?" + ) + ) return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)]) diff --git a/ur_simulation_ignition/launch/ur_sim_moveit.launch.py b/ur_simulation_gz/launch/ur_sim_moveit.launch.py similarity index 97% rename from ur_simulation_ignition/launch/ur_sim_moveit.launch.py rename to ur_simulation_gz/launch/ur_sim_moveit.launch.py index 7ac0d27..e2989b3 100644 --- a/ur_simulation_ignition/launch/ur_sim_moveit.launch.py +++ b/ur_simulation_gz/launch/ur_sim_moveit.launch.py @@ -36,7 +36,6 @@ def launch_setup(context, *args, **kwargs): - # Initialize Arguments ur_type = LaunchConfiguration("ur_type") safety_limits = LaunchConfiguration("safety_limits") @@ -51,7 +50,7 @@ def launch_setup(context, *args, **kwargs): ur_control_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( - [FindPackageShare("ur_simulation_ignition"), "/launch", "/ur_sim_control.launch.py"] + [FindPackageShare("ur_simulation_gz"), "/launch", "/ur_sim_control.launch.py"] ), launch_arguments={ "ur_type": ur_type, @@ -97,7 +96,7 @@ def generate_launch_description(): DeclareLaunchArgument( "ur_type", description="Type/series of used UR robot.", - choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"], + choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e", "ur20", "ur30"], default_value="ur5e", ) ) @@ -112,7 +111,7 @@ def generate_launch_description(): declared_arguments.append( DeclareLaunchArgument( "runtime_config_package", - default_value="ur_simulation_ignition", + default_value="ur_simulation_gz", description='Package with the controller\'s configuration in "config" folder. \ Usually the argument is not set, it enables use of a custom setup.', ) diff --git a/ur_simulation_ignition/package.xml b/ur_simulation_gz/package.xml similarity index 70% rename from ur_simulation_ignition/package.xml rename to ur_simulation_gz/package.xml index 228e326..45a37df 100644 --- a/ur_simulation_ignition/package.xml +++ b/ur_simulation_gz/package.xml @@ -1,13 +1,14 @@ - ur_simulation_ignition + ur_simulation_gz 0.0.0 - Example and configuration files for Gazebo Ignition simulation of UR manipulators. + Example and configuration files for Gazebo simulation of UR manipulators. Lovro Ivanov + Denis Stogl - Denis Stogl + Felix Exner BSD-3-Clause @@ -16,7 +17,8 @@ ament_cmake - ign_ros2_control + ros_gz_sim + gz_ros2_control joint_state_publisher launch launch_ros @@ -26,6 +28,8 @@ urdf xacro + ament_cmake_pytest + ament_cmake diff --git a/ur_simulation_gz/test/test_description.py b/ur_simulation_gz/test/test_description.py new file mode 100644 index 0000000..291a505 --- /dev/null +++ b/ur_simulation_gz/test/test_description.py @@ -0,0 +1,118 @@ +# Copyright (c) 2023 FZI Forschungszentrum Informatik +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of the {copyright_holder} nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# Author: Lukas Sackewitz + +import os +import shutil +import subprocess +import tempfile +import pytest + +from ament_index_python.packages import get_package_share_directory + + +@pytest.mark.parametrize( + "ur_type", ["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e", "ur20", "ur30"] +) +@pytest.mark.parametrize("prefix", ["", "my_ur_"]) +def test_ur_urdf_xacro(ur_type, prefix): + # Initialize Arguments + safety_limits = "true" + safety_pos_margin = "0.15" + safety_k_position = "20" + # General Arguments + description_package = "ur_description" + + joint_limit_params = os.path.join( + get_package_share_directory(description_package), "config", ur_type, "joint_limits.yaml" + ) + kinematics_params = os.path.join( + get_package_share_directory(description_package), + "config", + ur_type, + "default_kinematics.yaml", + ) + physical_params = os.path.join( + get_package_share_directory(description_package), + "config", + ur_type, + "physical_parameters.yaml", + ) + visual_params = os.path.join( + get_package_share_directory(description_package), + "config", + ur_type, + "visual_parameters.yaml", + ) + + description_file_path = os.path.join( + get_package_share_directory("ur_simulation_gz"), "urdf", "ur_gz.urdf.xacro" + ) + + (_, tmp_urdf_output_file) = tempfile.mkstemp(suffix=".urdf") + + # Compose `xacro` and `check_urdf` command + xacro_command = ( + f"{shutil.which('xacro')}" + f" {description_file_path}" + f" joint_limit_params:={joint_limit_params}" + f" kinematics_params:={kinematics_params}" + f" physical_params:={physical_params}" + f" visual_params:={visual_params}" + f" safety_limits:={safety_limits}" + f" safety_pos_margin:={safety_pos_margin}" + f" safety_k_position:={safety_k_position}" + f" name:={ur_type}" + f" prefix:={prefix}" + f" > {tmp_urdf_output_file}" + ) + check_urdf_command = f"{shutil.which('check_urdf')} {tmp_urdf_output_file}" + + # Try to call processes but finally remove the temp file + try: + xacro_process = subprocess.run( + xacro_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True + ) + + assert xacro_process.returncode == 0, " --- XACRO command failed ---" + + check_urdf_process = subprocess.run( + check_urdf_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True + ) + + assert ( + check_urdf_process.returncode == 0 + ), "\n --- URDF check failed! --- \nYour xacro does not unfold into a proper urdf robot description. Please check your xacro file." + + finally: + os.remove(tmp_urdf_output_file) + + +if __name__ == "__main__": + test_ur_urdf_xacro() diff --git a/ur_simulation_gz/urdf/ur_gz.ros2_control.xacro b/ur_simulation_gz/urdf/ur_gz.ros2_control.xacro new file mode 100644 index 0000000..31c3012 --- /dev/null +++ b/ur_simulation_gz/urdf/ur_gz.ros2_control.xacro @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + gz_ros2_control/GazeboSimSystem + + + + + + diff --git a/ur_simulation_gz/urdf/ur_gz.urdf.xacro b/ur_simulation_gz/urdf/ur_gz.urdf.xacro new file mode 100644 index 0000000..59a9587 --- /dev/null +++ b/ur_simulation_gz/urdf/ur_gz.urdf.xacro @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(arg simulation_controllers) + + + + + + diff --git a/ur_simulation_ignition/CMakeLists.txt b/ur_simulation_ignition/CMakeLists.txt deleted file mode 100644 index 5badc1c..0000000 --- a/ur_simulation_ignition/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(ur_simulation_ignition) - -find_package(ament_cmake REQUIRED) - -install(DIRECTORY config launch - DESTINATION share/${PROJECT_NAME} -) - -ament_package()