From 0cb4c47d37dbda465af149c835c9cb81d68d87a3 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 20 Nov 2023 07:33:40 +0000 Subject: [PATCH 01/12] Renamed ignition to gz --- README.md | 45 +++++------------- ...tion_Simulation-not-released.rolling.repos | 27 ----------- ...ts_ROS2_Ignition_Simulation.galactic.repos | 47 ------------------- ...ots_ROS2_Ignition_Simulation.rolling.repos | 47 ------------------- ...ic.repos => ur_simulation_gz.rolling.repos | 29 ++++++------ .../CMakeLists.txt | 2 +- .../config/ur_controllers.yaml | 0 .../launch/ur_sim_control.launch.py | 18 +++---- .../launch/ur_sim_moveit.launch.py | 4 +- .../package.xml | 6 +-- 10 files changed, 42 insertions(+), 183 deletions(-) delete mode 100644 Universal_Robots_ROS2_Ignition_Simulation-not-released.rolling.repos delete mode 100644 Universal_Robots_ROS2_Ignition_Simulation.galactic.repos delete mode 100644 Universal_Robots_ROS2_Ignition_Simulation.rolling.repos rename Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos => ur_simulation_gz.rolling.repos (56%) rename {ur_simulation_ignition => ur_simulation_gz}/CMakeLists.txt (83%) rename {ur_simulation_ignition => ur_simulation_gz}/config/ur_controllers.yaml (100%) rename {ur_simulation_ignition => ur_simulation_gz}/launch/ur_sim_control.launch.py (95%) rename {ur_simulation_ignition => ur_simulation_gz}/launch/ur_sim_moveit.launch.py (97%) rename {ur_simulation_ignition => ur_simulation_gz}/package.xml (83%) diff --git a/README.md b/README.md index 15f4c4b..a7de439 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -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 @@ -11,22 +11,6 @@ ROS2 Distro | Branch | Build status | Released packages **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 Skip any of below steps is not applicable. @@ -34,26 +18,21 @@ Skip any of below steps is not applicable. 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 + git clone git@github.com:UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation.git src/ur_simulation_gz + vcs import src --input src/Universal_Robots_ROS2_Ignition_Simulation/ur_simulation_gz..repos + rosdep install --ignore-src --from-paths src -y cd .. ``` @@ -68,15 +47,15 @@ To configure and build workspace execute following commands: ## Running Executable ``` -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.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/Universal_Robots_ROS2_Ignition_Simulation.rolling.repos b/Universal_Robots_ROS2_Ignition_Simulation.rolling.repos deleted file mode 100644 index 3b7152b..0000000 --- a/Universal_Robots_ROS2_Ignition_Simulation.rolling.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: master - 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/Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos b/ur_simulation_gz.rolling.repos similarity index 56% rename from Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos rename to ur_simulation_gz.rolling.repos index 1e2d710..3e435d4 100644 --- a/Universal_Robots_ROS2_Ignition_Simulation-not-released.galactic.repos +++ b/ur_simulation_gz.rolling.repos @@ -1,28 +1,29 @@ 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/ros-planning/moveit2.git + version: main + ros2_control: + type: git + url: https://github.com/ros-controls/ros2_control.git + version: master ros2_control_demos: type: git url: https://github.com/ros-controls/ros2_control_demos.git version: master - - Universal_Robots_Client_Library: + ros2_controllers: type: git - url: https://github.com/UniversalRobots/Universal_Robots_Client_Library.git + url: https://github.com/ros-controls/ros2_controllers.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 + version: rolling diff --git a/ur_simulation_ignition/CMakeLists.txt b/ur_simulation_gz/CMakeLists.txt similarity index 83% rename from ur_simulation_ignition/CMakeLists.txt rename to ur_simulation_gz/CMakeLists.txt index 5badc1c..05c404a 100644 --- a/ur_simulation_ignition/CMakeLists.txt +++ b/ur_simulation_gz/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(ur_simulation_ignition) +project(ur_simulation_gz) find_package(ament_cmake REQUIRED) 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 95% rename from ur_simulation_ignition/launch/ur_sim_control.launch.py rename to ur_simulation_gz/launch/ur_sim_control.launch.py index 97301d4..9f6993e 100644 --- a/ur_simulation_ignition/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -147,9 +147,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 +162,11 @@ 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": " -r -v 4 empty.sdf"}.items(), ) nodes_to_start = [ @@ -175,8 +175,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 @@ -218,7 +218,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/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..488f716 100644 --- a/ur_simulation_ignition/launch/ur_sim_moveit.launch.py +++ b/ur_simulation_gz/launch/ur_sim_moveit.launch.py @@ -51,7 +51,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, @@ -112,7 +112,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 83% rename from ur_simulation_ignition/package.xml rename to ur_simulation_gz/package.xml index 228e326..a5170ad 100644 --- a/ur_simulation_ignition/package.xml +++ b/ur_simulation_gz/package.xml @@ -1,9 +1,9 @@ - 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 @@ -16,7 +16,7 @@ ament_cmake - ign_ros2_control + gz_ros2_control joint_state_publisher launch launch_ros From 1f1543b2593049d6b9ea0dd3eb202011492dfa87 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 20 Nov 2023 07:48:30 +0000 Subject: [PATCH 02/12] Updated CI * Update gz_ros2_control branches * use pre-commit in a newer version * Update pre-commit hooks * Python formatting * Remove manual ament jobs * They are part of pre-commit anyway * Remove installing clang-format * Remove unused CMake define --- .github/workflows/ci-format.yml | 6 +- .github/workflows/ci-ros-lint.yml | 40 --------- .github/workflows/galactic-binary-build.yml | 56 ------------ .../workflows/galactic-semi-binary-build.yml | 56 ------------ .github/workflows/galactic-source-build.yml | 36 -------- .github/workflows/humble-binary-main.yml | 21 +++++ .github/workflows/humble-binary-testing.yml | 21 +++++ .github/workflows/humble-semi-binary-main.yml | 22 +++++ .../workflows/humble-semi-binary-testing.yml | 22 +++++ .github/workflows/iron-binary-main.yml | 21 +++++ .github/workflows/iron-binary-testing.yml | 21 +++++ .github/workflows/iron-semi-binary-main.yml | 22 +++++ .../workflows/iron-semi-binary-testing.yml | 22 +++++ .github/workflows/reusable_ici.yml | 85 ++++++++++++++++++ .github/workflows/rolling-binary-build.yml | 56 ------------ .github/workflows/rolling-binary-main.yml | 22 +++++ .github/workflows/rolling-binary-testing.yml | 22 +++++ .../workflows/rolling-semi-binary-build.yml | 56 ------------ .../workflows/rolling-semi-binary-main.yml | 22 +++++ .../workflows/rolling-semi-binary-testing.yml | 22 +++++ .github/workflows/rolling-source-build.yml | 36 -------- .pre-commit-config.yaml | 60 ++----------- README.md | 50 +++++++++-- ci_status.md | 88 +++++++++++++++++++ ur_simulation_gz-not-released.rolling.repos | 5 ++ ur_simulation_gz.humble.repos | 25 ++++++ ur_simulation_gz.iron.repos | 25 ++++++ ur_simulation_gz.rolling.repos | 4 +- .../launch/ur_sim_control.launch.py | 1 - .../launch/ur_sim_moveit.launch.py | 1 - 30 files changed, 541 insertions(+), 405 deletions(-) delete mode 100644 .github/workflows/ci-ros-lint.yml delete mode 100644 .github/workflows/galactic-binary-build.yml delete mode 100644 .github/workflows/galactic-semi-binary-build.yml delete mode 100644 .github/workflows/galactic-source-build.yml create mode 100644 .github/workflows/humble-binary-main.yml create mode 100644 .github/workflows/humble-binary-testing.yml create mode 100644 .github/workflows/humble-semi-binary-main.yml create mode 100644 .github/workflows/humble-semi-binary-testing.yml create mode 100644 .github/workflows/iron-binary-main.yml create mode 100644 .github/workflows/iron-binary-testing.yml create mode 100644 .github/workflows/iron-semi-binary-main.yml create mode 100644 .github/workflows/iron-semi-binary-testing.yml create mode 100644 .github/workflows/reusable_ici.yml delete mode 100644 .github/workflows/rolling-binary-build.yml create mode 100644 .github/workflows/rolling-binary-main.yml create mode 100644 .github/workflows/rolling-binary-testing.yml delete mode 100644 .github/workflows/rolling-semi-binary-build.yml create mode 100644 .github/workflows/rolling-semi-binary-main.yml create mode 100644 .github/workflows/rolling-semi-binary-testing.yml delete mode 100644 .github/workflows/rolling-source-build.yml create mode 100644 ci_status.md create mode 100644 ur_simulation_gz-not-released.rolling.repos create mode 100644 ur_simulation_gz.humble.repos create mode 100644 ur_simulation_gz.iron.repos 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..d55ac84 --- /dev/null +++ b/.github/workflows/humble-binary-main.yml @@ -0,0 +1,21 @@ +name: Humble 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: humble + ros_repo: main + ref_for_scheduled_build: ros2 diff --git a/.github/workflows/humble-binary-testing.yml b/.github/workflows/humble-binary-testing.yml new file mode 100644 index 0000000..32d2887 --- /dev/null +++ b/.github/workflows/humble-binary-testing.yml @@ -0,0 +1,21 @@ +name: Humble 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: humble + ros_repo: testing + ref_for_scheduled_build: ros2 diff --git a/.github/workflows/humble-semi-binary-main.yml b/.github/workflows/humble-semi-binary-main.yml new file mode 100644 index 0000000..f4c65b6 --- /dev/null +++ b/.github/workflows/humble-semi-binary-main.yml @@ -0,0 +1,22 @@ +name: Humble 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: humble + ros_repo: main + ref_for_scheduled_build: ros2 + 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..38835b5 --- /dev/null +++ b/.github/workflows/humble-semi-binary-testing.yml @@ -0,0 +1,22 @@ +name: Humble 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: humble + ros_repo: testing + ref_for_scheduled_build: ros2 + 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..d5324bd --- /dev/null +++ b/.github/workflows/iron-binary-main.yml @@ -0,0 +1,21 @@ +name: Iron 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: iron + ros_repo: main + ref_for_scheduled_build: ros2 diff --git a/.github/workflows/iron-binary-testing.yml b/.github/workflows/iron-binary-testing.yml new file mode 100644 index 0000000..5fa2e09 --- /dev/null +++ b/.github/workflows/iron-binary-testing.yml @@ -0,0 +1,21 @@ +name: Iron 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: iron + ros_repo: testing + ref_for_scheduled_build: ros2 diff --git a/.github/workflows/iron-semi-binary-main.yml b/.github/workflows/iron-semi-binary-main.yml new file mode 100644 index 0000000..f73970f --- /dev/null +++ b/.github/workflows/iron-semi-binary-main.yml @@ -0,0 +1,22 @@ +name: Iron 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: iron + ros_repo: main + ref_for_scheduled_build: ros2 + 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..009650d --- /dev/null +++ b/.github/workflows/iron-semi-binary-testing.yml @@ -0,0 +1,22 @@ +name: Iron 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: iron + ros_repo: testing + ref_for_scheduled_build: ros2 + 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/README.md b/README.md index a7de439..f53c05c 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,48 @@ Universal_Robots_ROS2_GZ_Simulation 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) - - -# Using the repository + + + + + + + + + + + + + + + + + + + +
HumbleIronRolling
Branchros2ros2ros2
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 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..d954436 --- /dev/null +++ b/ur_simulation_gz-not-released.rolling.repos @@ -0,0 +1,5 @@ +repositories: + gz_ros2_control: + type: git + url: https://github.com/ignitionrobotics/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..0fde6cc --- /dev/null +++ b/ur_simulation_gz.humble.repos @@ -0,0 +1,25 @@ +repositories: + gz_ros2_control: + type: git + url: https://github.com/ignitionrobotics/gz_ros2_control.git + version: humble + ros_ign: + type: git + url: https://github.com/ignitionrobotics/ros_ign.git + 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..dd23f74 --- /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_ign: + type: git + url: https://github.com/ignitionrobotics/ros_ign.git + 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/ur_simulation_gz.rolling.repos b/ur_simulation_gz.rolling.repos index 3e435d4..ce61fb8 100644 --- a/ur_simulation_gz.rolling.repos +++ b/ur_simulation_gz.rolling.repos @@ -1,8 +1,8 @@ repositories: ign_ros2_control: type: git - url: https://github.com/ignitionrobotics/ign_ros2_control.git - version: main + url: https://github.com/ignitionrobotics/gz_ros2_control.git + version: master ros_ign: type: git url: https://github.com/ignitionrobotics/ros_ign.git diff --git a/ur_simulation_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index 9f6993e..ba066c7 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -44,7 +44,6 @@ def launch_setup(context, *args, **kwargs): - # Initialize Arguments ur_type = LaunchConfiguration("ur_type") safety_limits = LaunchConfiguration("safety_limits") diff --git a/ur_simulation_gz/launch/ur_sim_moveit.launch.py b/ur_simulation_gz/launch/ur_sim_moveit.launch.py index 488f716..67a9716 100644 --- a/ur_simulation_gz/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") From ad5290e7f52a7f849c3ddef3da6e01062aa098c3 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 20 Nov 2023 11:02:13 +0000 Subject: [PATCH 03/12] Update license files to make ament_copyright happy --- CONTRIBUTING.md | 3 +++ LICENSE | 38 +++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 CONTRIBUTING.md 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. From 46066ba8ba40ceaf45f44bd88a542a8b195ca215 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Tue, 21 Nov 2023 10:53:26 +0000 Subject: [PATCH 04/12] Do not run humble on ros2 branch --- .github/workflows/humble-binary-main.yml | 8 ++++---- .github/workflows/humble-binary-testing.yml | 8 ++++---- .github/workflows/humble-semi-binary-main.yml | 8 ++++---- .github/workflows/humble-semi-binary-testing.yml | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/humble-binary-main.yml b/.github/workflows/humble-binary-main.yml index d55ac84..a82498a 100644 --- a/.github/workflows/humble-binary-main.yml +++ b/.github/workflows/humble-binary-main.yml @@ -2,13 +2,13 @@ name: Humble Binary Main on: workflow_dispatch: branches: - - ros2 + - humble pull_request: branches: - - ros2 + - humble push: branches: - - ros2 + - humble schedule: - cron: '13 4 * * *' @@ -18,4 +18,4 @@ jobs: with: ros_distro: humble ros_repo: main - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-binary-testing.yml b/.github/workflows/humble-binary-testing.yml index 32d2887..9b13c39 100644 --- a/.github/workflows/humble-binary-testing.yml +++ b/.github/workflows/humble-binary-testing.yml @@ -2,13 +2,13 @@ name: Humble Binary Testing on: workflow_dispatch: branches: - - ros2 + - humble pull_request: branches: - - ros2 + - humble push: branches: - - ros2 + - humble schedule: - cron: '13 4 * * *' @@ -18,4 +18,4 @@ jobs: with: ros_distro: humble ros_repo: testing - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-main.yml b/.github/workflows/humble-semi-binary-main.yml index f4c65b6..a83d23f 100644 --- a/.github/workflows/humble-semi-binary-main.yml +++ b/.github/workflows/humble-semi-binary-main.yml @@ -2,13 +2,13 @@ name: Humble Semi Binary Main on: workflow_dispatch: branches: - - ros2 + - humble pull_request: branches: - - ros2 + - humble push: branches: - - ros2 + - humble schedule: - cron: '13 4 * * *' @@ -18,5 +18,5 @@ jobs: with: ros_distro: humble ros_repo: main - ref_for_scheduled_build: ros2 + 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 index 38835b5..8a078f8 100644 --- a/.github/workflows/humble-semi-binary-testing.yml +++ b/.github/workflows/humble-semi-binary-testing.yml @@ -2,13 +2,13 @@ name: Humble Semi Binary Testing on: workflow_dispatch: branches: - - ros2 + - humble pull_request: branches: - - ros2 + - humble push: branches: - - ros2 + - humble schedule: - cron: '13 4 * * *' @@ -18,5 +18,5 @@ jobs: with: ros_distro: humble ros_repo: testing - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: humble upstream_workspace: ur_simulation_gz.humble.repos From cc47b69164d0d24b218958350b26791ea7498003 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 14 Dec 2023 10:24:32 +0000 Subject: [PATCH 05/12] Added description with ros2_control tag This uses ur_description without a ros2_control tag --- ur_simulation_gz/CMakeLists.txt | 8 +- .../launch/ur_sim_control.launch.py | 23 +--- ur_simulation_gz/package.xml | 2 + ur_simulation_gz/test/test_description.py | 118 ++++++++++++++++++ .../urdf/ur_gz.ros2_control.xacro | 29 +++++ ur_simulation_gz/urdf/ur_gz.urdf.xacro | 61 +++++++++ 6 files changed, 219 insertions(+), 22 deletions(-) create mode 100644 ur_simulation_gz/test/test_description.py create mode 100644 ur_simulation_gz/urdf/ur_gz.ros2_control.xacro create mode 100644 ur_simulation_gz/urdf/ur_gz.urdf.xacro diff --git a/ur_simulation_gz/CMakeLists.txt b/ur_simulation_gz/CMakeLists.txt index 05c404a..48d5f6c 100644 --- a/ur_simulation_gz/CMakeLists.txt +++ b/ur_simulation_gz/CMakeLists.txt @@ -3,8 +3,14 @@ project(ur_simulation_gz) find_package(ament_cmake REQUIRED) -install(DIRECTORY config launch +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_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index ba066c7..0a1a2d7 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -52,8 +52,6 @@ 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") @@ -64,7 +62,7 @@ def launch_setup(context, *args, **kwargs): ) rviz_config_file = PathJoinSubstitution( - [FindPackageShare(description_package), "rviz", "view_robot.rviz"] + [FindPackageShare("ur_description"), "rviz", "view_robot.rviz"] ) robot_description_content = Command( @@ -72,7 +70,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:=", @@ -93,8 +91,6 @@ def launch_setup(context, *args, **kwargs): "prefix:=", prefix, " ", - "sim_ignition:=true", - " ", "simulation_controllers:=", initial_joint_controllers, ] @@ -229,21 +225,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", diff --git a/ur_simulation_gz/package.xml b/ur_simulation_gz/package.xml index a5170ad..70fb5ba 100644 --- a/ur_simulation_gz/package.xml +++ b/ur_simulation_gz/package.xml @@ -26,6 +26,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..25715e2 --- /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"] +) +@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..70c8f02 --- /dev/null +++ b/ur_simulation_gz/urdf/ur_gz.urdf.xacro @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(arg simulation_controllers) + + + + + + From 3ced1a1d4b4458bdff6864191d4cdc6aab9d02c6 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Wed, 20 Dec 2023 10:31:31 +0000 Subject: [PATCH 06/12] Update branches in CI and README --- .github/workflows/iron-binary-main.yml | 8 ++++---- .github/workflows/iron-binary-testing.yml | 8 ++++---- .github/workflows/iron-semi-binary-main.yml | 8 ++++---- .github/workflows/iron-semi-binary-testing.yml | 8 ++++---- README.md | 4 ++-- ur_simulation_gz-not-released.rolling.repos | 2 +- ur_simulation_gz.rolling.repos | 6 +++++- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/iron-binary-main.yml b/.github/workflows/iron-binary-main.yml index d5324bd..40ddb61 100644 --- a/.github/workflows/iron-binary-main.yml +++ b/.github/workflows/iron-binary-main.yml @@ -2,13 +2,13 @@ name: Iron Binary Main on: workflow_dispatch: branches: - - ros2 + - iron pull_request: branches: - - ros2 + - iron push: branches: - - ros2 + - iron schedule: - cron: '13 4 * * *' @@ -18,4 +18,4 @@ jobs: with: ros_distro: iron ros_repo: main - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-binary-testing.yml b/.github/workflows/iron-binary-testing.yml index 5fa2e09..f790e51 100644 --- a/.github/workflows/iron-binary-testing.yml +++ b/.github/workflows/iron-binary-testing.yml @@ -2,13 +2,13 @@ name: Iron Binary Testing on: workflow_dispatch: branches: - - ros2 + - iron pull_request: branches: - - ros2 + - iron push: branches: - - ros2 + - iron schedule: - cron: '13 4 * * *' @@ -18,4 +18,4 @@ jobs: with: ros_distro: iron ros_repo: testing - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: iron diff --git a/.github/workflows/iron-semi-binary-main.yml b/.github/workflows/iron-semi-binary-main.yml index f73970f..c587f71 100644 --- a/.github/workflows/iron-semi-binary-main.yml +++ b/.github/workflows/iron-semi-binary-main.yml @@ -2,13 +2,13 @@ name: Iron Semi Binary Main on: workflow_dispatch: branches: - - ros2 + - iron pull_request: branches: - - ros2 + - iron push: branches: - - ros2 + - iron schedule: - cron: '13 4 * * *' @@ -18,5 +18,5 @@ jobs: with: ros_distro: iron ros_repo: main - ref_for_scheduled_build: ros2 + 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 index 009650d..36429f6 100644 --- a/.github/workflows/iron-semi-binary-testing.yml +++ b/.github/workflows/iron-semi-binary-testing.yml @@ -2,13 +2,13 @@ name: Iron Semi Binary Testing on: workflow_dispatch: branches: - - ros2 + - iron pull_request: branches: - - ros2 + - iron push: branches: - - ros2 + - iron schedule: - cron: '13 4 * * *' @@ -18,5 +18,5 @@ jobs: with: ros_distro: iron ros_repo: testing - ref_for_scheduled_build: ros2 + ref_for_scheduled_build: iron upstream_workspace: ur_simulation_gz.iron.repos diff --git a/README.md b/README.md index f53c05c..aca30c9 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Example files and configurations for Gazebo simulation of Universal Robots' mani Branch - ros2 - ros2 + humble + iron ros2 diff --git a/ur_simulation_gz-not-released.rolling.repos b/ur_simulation_gz-not-released.rolling.repos index d954436..9ec6deb 100644 --- a/ur_simulation_gz-not-released.rolling.repos +++ b/ur_simulation_gz-not-released.rolling.repos @@ -1,5 +1,5 @@ repositories: gz_ros2_control: type: git - url: https://github.com/ignitionrobotics/gz_ros2_control.git + url: https://github.com/ros-controls/gz_ros2_control.git version: master diff --git a/ur_simulation_gz.rolling.repos b/ur_simulation_gz.rolling.repos index ce61fb8..b6abc16 100644 --- a/ur_simulation_gz.rolling.repos +++ b/ur_simulation_gz.rolling.repos @@ -1,7 +1,7 @@ repositories: ign_ros2_control: type: git - url: https://github.com/ignitionrobotics/gz_ros2_control.git + url: https://github.com/ros-controls/gz_ros2_control.git version: master ros_ign: type: git @@ -11,6 +11,10 @@ repositories: type: git 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 From 9d9175879b33a1300b3250475dd711062adb41ac Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 15 Apr 2024 11:02:55 +0200 Subject: [PATCH 07/12] Update maintainer information --- ur_simulation_gz/package.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ur_simulation_gz/package.xml b/ur_simulation_gz/package.xml index 70fb5ba..bf2e3c0 100644 --- a/ur_simulation_gz/package.xml +++ b/ur_simulation_gz/package.xml @@ -6,8 +6,9 @@ Example and configuration files for Gazebo simulation of UR manipulators. Lovro Ivanov + Denis Stogl - Denis Stogl + Felix Exner BSD-3-Clause From c141ee0b5d621e7943c89187664836685dd8bfb5 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 15 Apr 2024 11:55:52 +0200 Subject: [PATCH 08/12] Add gazebo_gui argument --- .../launch/ur_sim_control.launch.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ur_simulation_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index 0a1a2d7..df56acf 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -38,7 +38,13 @@ 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 @@ -56,6 +62,7 @@ def launch_setup(context, *args, **kwargs): 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] @@ -161,7 +168,11 @@ def launch_setup(context, *args, **kwargs): PythonLaunchDescriptionSource( [FindPackageShare("ros_gz_sim"), "/launch/gz_sim.launch.py"] ), - launch_arguments={"gz_args": " -r -v 4 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 = [ @@ -251,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)]) From 5cb2054babd034b621ddbec3969dbc73a1086392 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 15 Apr 2024 13:19:41 +0200 Subject: [PATCH 09/12] Add UR20 and UR30 --- ur_simulation_gz/launch/ur_sim_control.launch.py | 2 +- ur_simulation_gz/launch/ur_sim_moveit.launch.py | 2 +- ur_simulation_gz/test/test_description.py | 2 +- ur_simulation_gz/urdf/ur_gz.urdf.xacro | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ur_simulation_gz/launch/ur_sim_control.launch.py b/ur_simulation_gz/launch/ur_sim_control.launch.py index df56acf..8adb070 100644 --- a/ur_simulation_gz/launch/ur_sim_control.launch.py +++ b/ur_simulation_gz/launch/ur_sim_control.launch.py @@ -195,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", ) ) diff --git a/ur_simulation_gz/launch/ur_sim_moveit.launch.py b/ur_simulation_gz/launch/ur_sim_moveit.launch.py index 67a9716..e2989b3 100644 --- a/ur_simulation_gz/launch/ur_sim_moveit.launch.py +++ b/ur_simulation_gz/launch/ur_sim_moveit.launch.py @@ -96,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", ) ) diff --git a/ur_simulation_gz/test/test_description.py b/ur_simulation_gz/test/test_description.py index 25715e2..291a505 100644 --- a/ur_simulation_gz/test/test_description.py +++ b/ur_simulation_gz/test/test_description.py @@ -38,7 +38,7 @@ @pytest.mark.parametrize( - "ur_type", ["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e", "ur20"] + "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): diff --git a/ur_simulation_gz/urdf/ur_gz.urdf.xacro b/ur_simulation_gz/urdf/ur_gz.urdf.xacro index 70c8f02..59a9587 100644 --- a/ur_simulation_gz/urdf/ur_gz.urdf.xacro +++ b/ur_simulation_gz/urdf/ur_gz.urdf.xacro @@ -7,7 +7,7 @@ - + From 1e9955f994f7ef733bab491feda395a0eda62a21 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 29 Apr 2024 11:57:15 +0200 Subject: [PATCH 10/12] Update README --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index aca30c9..703d157 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,8 @@ Skip any of below steps is not applicable. 1. Download the required repositories and install package dependencies: ``` cd $COLCON_WS - git clone git@github.com:UniversalRobots/Universal_Robots_ROS2_Ignition_Simulation.git src/ur_simulation_gz - vcs import src --input src/Universal_Robots_ROS2_Ignition_Simulation/ur_simulation_gz..repos - rosdep install --ignore-src --from-paths src -y - 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 ``` @@ -76,10 +74,16 @@ 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_gz ur_sim_control.launch.py ``` From c496094a9f6f82dd36b3f91750b04c9ea3d6dd10 Mon Sep 17 00:00:00 2001 From: "Felix Exner (fexner)" Date: Tue, 30 Apr 2024 11:09:19 +0200 Subject: [PATCH 11/12] Update remote project URLs Co-authored-by: Vincenzo Di Pentima --- ur_simulation_gz.humble.repos | 6 +++--- ur_simulation_gz.iron.repos | 4 ++-- ur_simulation_gz.rolling.repos | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ur_simulation_gz.humble.repos b/ur_simulation_gz.humble.repos index 0fde6cc..7b8f109 100644 --- a/ur_simulation_gz.humble.repos +++ b/ur_simulation_gz.humble.repos @@ -1,11 +1,11 @@ repositories: gz_ros2_control: type: git - url: https://github.com/ignitionrobotics/gz_ros2_control.git + url: https://github.com/ros-controls/gz_ros2_control.git version: humble - ros_ign: + ros_gz: type: git - url: https://github.com/ignitionrobotics/ros_ign.git + url: https://github.com/gazebosim/ros_gz version: humble moveit2: type: git diff --git a/ur_simulation_gz.iron.repos b/ur_simulation_gz.iron.repos index dd23f74..0f89292 100644 --- a/ur_simulation_gz.iron.repos +++ b/ur_simulation_gz.iron.repos @@ -3,9 +3,9 @@ repositories: type: git url: https://github.com/ignitionrobotics/gz_ros2_control.git version: master - ros_ign: + ros_gz: type: git - url: https://github.com/ignitionrobotics/ros_ign.git + url: https://github.com/gazebosim/ros_gz version: iron moveit2: type: git diff --git a/ur_simulation_gz.rolling.repos b/ur_simulation_gz.rolling.repos index b6abc16..8d2f3af 100644 --- a/ur_simulation_gz.rolling.repos +++ b/ur_simulation_gz.rolling.repos @@ -1,5 +1,5 @@ repositories: - ign_ros2_control: + gz_ros2_control: type: git url: https://github.com/ros-controls/gz_ros2_control.git version: master From 8176509474fab426fb57dda7a3b5812449adf8bb Mon Sep 17 00:00:00 2001 From: "Felix Exner (fexner)" Date: Tue, 30 Apr 2024 19:56:58 +0200 Subject: [PATCH 12/12] Update ur_simulation_gz/package.xml Co-authored-by: Vincenzo Di Pentima --- ur_simulation_gz/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/ur_simulation_gz/package.xml b/ur_simulation_gz/package.xml index bf2e3c0..45a37df 100644 --- a/ur_simulation_gz/package.xml +++ b/ur_simulation_gz/package.xml @@ -17,6 +17,7 @@ ament_cmake + ros_gz_sim gz_ros2_control joint_state_publisher launch