From 18fd2c7faf089bfcd6958c67c948de62c8884803 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Tue, 7 May 2024 15:23:42 -0500 Subject: [PATCH] Use Gazebo ROS vendor packages (#277) Signed-off-by: Addisu Z. Taddese --- .github/workflows/ci-iron.yaml | 97 ------------------- .github/workflows/ci-rolling.yaml | 38 +------- Dockerfile/Dockerfile | 3 +- README.md | 22 ++--- gz_ros2_control/CMakeLists.txt | 41 ++------ .../gz_ros2_control_plugin.hpp | 5 - .../gz_ros2_control/gz_system_interface.hpp | 5 - gz_ros2_control/package.xml | 13 +-- .../src/gz_ros2_control_plugin.cpp | 22 ----- gz_ros2_control/src/gz_system.cpp | 26 +---- .../launch/cart_example_effort.launch.py | 14 +-- .../launch/cart_example_position.launch.py | 14 +-- .../launch/cart_example_velocity.launch.py | 14 +-- .../launch/diff_drive_example.launch.py | 14 +-- ...ipper_mimic_joint_example_effort.launch.py | 14 +-- ...pper_mimic_joint_example_effort.launch.xml | 2 +- ...per_mimic_joint_example_position.launch.py | 14 +-- .../launch/pendulum_example_effort.launch.py | 14 +-- .../pendulum_example_position.launch.py | 14 +-- .../launch/tricycle_drive_example.launch.py | 16 +-- gz_ros2_control_demos/package.xml | 5 +- .../urdf/test_cart_velocity.xacro.urdf | 4 +- gz_ros2_control_tests/package.xml | 5 +- 23 files changed, 94 insertions(+), 322 deletions(-) delete mode 100644 .github/workflows/ci-iron.yaml diff --git a/.github/workflows/ci-iron.yaml b/.github/workflows/ci-iron.yaml deleted file mode 100644 index c6993d08..00000000 --- a/.github/workflows/ci-iron.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: gz_ros2_control CI - Iron - -on: - pull_request: - branches: [ iron ] - push: - branches: [ iron ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - docker-image: "ubuntu:22.04" - gz-version: "fortress" - ros-distro: "iron" - ros-repo-packages: "" - - docker-image: "ubuntu:22.04" - gz-version: "garden" - ros-distro: "iron" - ros-repo-packages: "" - - docker-image: "ubuntu:22.04" - gz-version: "fortress" - ros-distro: "iron" - ros-repo-packages: "-testing" - - docker-image: "ubuntu:22.04" - gz-version: "garden" - ros-distro: "iron" - ros-repo-packages: "-testing" - - env: - DOCKER_IMAGE: ${{ matrix.docker-image }} - GZ_VERSION: ${{ matrix.gz-version }} - ROS_DISTRO: ${{ matrix.ros-distro }} - ROS_REPO_PACKAGES: ${{ matrix.ros-repo-packages }} - container: - image: ${{ matrix.docker-image }} - steps: - - uses: actions/checkout@v4 - - name: Setup colcon workspace - id: configure - shell: bash - run: | - export DEBIAN_FRONTEND=noninteractive - apt update -qq - apt install -qq -y lsb-release wget curl gnupg2 git - cd .. - mkdir -p /home/ros2_ws/src - if [ "$ROS_DISTRO" == "rolling" ]; then - git clone https://github.com/gazebosim/ros_gz/ - fi - cp -r gz_ros2_control /home/ros2_ws/src/ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2$ROS_REPO_PACKAGES/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null - if [ "$GZ_VERSION" == "garden" ]; then - export GZ_DEPS="libgz-sim7-dev libgz-plugin2-dev gz-sim7-cli" - fi - - apt-get update && apt-get upgrade -q -y - apt-get update && apt-get install -qq -y \ - dirmngr \ - python3-colcon-ros \ - python3-colcon-common-extensions \ - python3-rosdep \ - build-essential \ - ${GZ_DEPS} - - if [ "$GZ_VERSION" == "garden" ]; then - export ROSDEP_ARGS="--skip-keys ros_gz_sim --skip-keys gz-plugin2 --skip-keys gz-sim7 --skip-keys gz-transport12 --skip-keys gz-math7 --skip-keys gz-msgs9" - fi - cd /home/ros2_ws/src/ - if [ "$ROS_DISTRO" == "rolling" ]; then - git clone https://github.com/gazebosim/ros_gz/ - fi - if [ "$ROS_DISTRO" == "iron" ]; then - git clone https://github.com/gazebosim/ros_gz/ -b iron - fi - rosdep init - rosdep update - rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --ignore-src ${ROSDEP_ARGS} - - name: Build project - id: build - run: | - cd /home/ros2_ws/ - . /opt/ros/${ROS_DISTRO}/local_setup.sh - colcon build --packages-up-to gz_ros2_control_demos gz_ros2_control_tests - - name: Run tests - id: test - run: | - cd /home/ros2_ws/ - . /opt/ros/${ROS_DISTRO}/local_setup.sh - colcon test --event-handlers console_direct+ --packages-select gz_ros2_control gz_ros2_control_demos gz_ros2_control_tests - colcon test-result diff --git a/.github/workflows/ci-rolling.yaml b/.github/workflows/ci-rolling.yaml index f19e156d..85b6784b 100644 --- a/.github/workflows/ci-rolling.yaml +++ b/.github/workflows/ci-rolling.yaml @@ -13,26 +13,12 @@ jobs: fail-fast: false matrix: include: - - docker-image: "ubuntu:22.04" - gz-version: "fortress" - ros-distro: "rolling" - ros-repo-packages: "" - - docker-image: "ubuntu:22.04" - gz-version: "garden" - ros-distro: "rolling" - ros-repo-packages: "" - - docker-image: "ubuntu:22.04" - gz-version: "fortress" - ros-distro: "rolling" - ros-repo-packages: "-testing" - - docker-image: "ubuntu:22.04" - gz-version: "garden" + - docker-image: "ubuntu:24.04" ros-distro: "rolling" ros-repo-packages: "-testing" env: DOCKER_IMAGE: ${{ matrix.docker-image }} - GZ_VERSION: ${{ matrix.gz-version }} ROS_DISTRO: ${{ matrix.ros-distro }} ROS_REPO_PACKAGES: ${{ matrix.ros-repo-packages }} container: @@ -48,17 +34,9 @@ jobs: apt install -qq -y lsb-release wget curl gnupg2 git cd .. mkdir -p /home/ros2_ws/src - if [ "$ROS_DISTRO" == "rolling" ]; then - git clone https://github.com/gazebosim/ros_gz/ - fi cp -r gz_ros2_control /home/ros2_ws/src/ curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2$ROS_REPO_PACKAGES/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null - if [ "$GZ_VERSION" == "garden" ]; then - export GZ_DEPS="libgz-sim7-dev libgz-plugin2-dev gz-sim7-cli" - fi apt-get update && apt-get upgrade -q -y apt-get update && apt-get install -qq -y \ @@ -66,22 +44,12 @@ jobs: python3-colcon-ros \ python3-colcon-common-extensions \ python3-rosdep \ - build-essential \ - ${GZ_DEPS} + build-essential - if [ "$GZ_VERSION" == "garden" ]; then - export ROSDEP_ARGS="--skip-keys ros_gz_sim --skip-keys gz-plugin2 --skip-keys gz-sim7 --skip-keys gz-transport12 --skip-keys gz-math7 --skip-keys gz-msgs9" - fi cd /home/ros2_ws/src/ - if [ "$ROS_DISTRO" == "rolling" ]; then - git clone https://github.com/gazebosim/ros_gz/ - fi - if [ "$ROS_DISTRO" == "iron" ]; then - git clone https://github.com/gazebosim/ros_gz/ -b iron - fi rosdep init rosdep update - rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --ignore-src ${ROSDEP_ARGS} + rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --ignore-src - name: Build project id: build run: | diff --git a/Dockerfile/Dockerfile b/Dockerfile/Dockerfile index 14ff6792..ae4731be 100644 --- a/Dockerfile/Dockerfile +++ b/Dockerfile/Dockerfile @@ -1,7 +1,6 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV DEBIAN_FRONTEND noninteractive -ENV GZ_VERSION fortress ENV ROS_DISTRO rolling # Make sure everything is up to date before building from source diff --git a/README.md b/README.md index 7ea22fa6..89fa1a67 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,10 @@ Galactic | Fortress | [galactic](https://github.com/ros-controls/gz_ros2_control Humble | Fortress | [humble](https://github.com/ros-controls/gz_ros2_control/tree/humble) | https://packages.ros.org Iron | Edifice | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source Iron | Fortress | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | https://packages.ros.org -Iron | Garden (not released) | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source -Iron | Harmonic (not released) | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source -Rolling | Edifice | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | only from source -Rolling | Fortress | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org -Rolling | Garden (not released) | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | only from source -Rolling | Harmonic (not released) | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | only from source +Iron | Garden | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source +Iron | Harmonic | [iron](https://github.com/ros-controls/gz_ros2_control/tree/iron) | only from source +Jazzy | Harmonic | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org +Rolling | Harmonic | [master](https://github.com/ros-controls/gz_ros2_control/tree/master) | https://packages.ros.org ## Build status @@ -37,15 +35,11 @@ See the [documentation file](doc/index.rst) or [control.ros.org](https://control # Compile from source -If you want compile this from source, you should choose the Gazebo version. The default one is `garden`: +Note that `gz_ros2_control` depends on the version of Gazebo that is +provided by the Gazebo Vendor packages [`gz_plugin_vendor`](https://github.com/gazebo-release/gz_plugin_vendor) and [`gz_sim_vendor`](https://github.com/gazebo-release/gz_sim_vendor). +Currently, for ROS 2 Jazzy and Rolling, the Gazebo version is Harmonic. -```bash -export GZ_VERSION=fortress -export GZ_VERSION=garden -export GZ_VERSION=harmonic -``` - -Then create a workspace, clone the repo and compile it: +To compile `gz_ros2_control` from source, create a workspace, clone the repo and compile it: ```bash mkdir -p ~/gz_ros2_control_ws/src diff --git a/gz_ros2_control/CMakeLists.txt b/gz_ros2_control/CMakeLists.txt index acc7d047..196f62d5 100644 --- a/gz_ros2_control/CMakeLists.txt +++ b/gz_ros2_control/CMakeLists.txt @@ -24,36 +24,11 @@ find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) find_package(yaml_cpp_vendor REQUIRED) -set(GZ_PLUGIN) -set(GZ_SIM) - -if("$ENV{GZ_VERSION}" STREQUAL "garden") - find_package(gz-sim7 REQUIRED) - set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR}) - message(STATUS "Compiling against Gazebo Garden") - find_package(gz-plugin2 REQUIRED) - set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR}) - set(GZ_PLUGIN gz-plugin${GZ_PLUGIN_VER}::register) - set(GZ_SIM gz-sim${GZ_SIM_VER}::core) - add_definitions(-DGZ_HEADERS) -elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic") - find_package(gz-sim8 REQUIRED) - set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR}) - message(STATUS "Compiling against Gazebo Harmonic") - find_package(gz-plugin2 REQUIRED) - set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR}) - set(GZ_PLUGIN gz-plugin${GZ_PLUGIN_VER}::register) - set(GZ_SIM gz-sim${GZ_SIM_VER}::core) - add_definitions(-DGZ_HEADERS) -else() - find_package(ignition-gazebo6 REQUIRED) - set(GZ_SIM_VER ${ignition-gazebo6_VERSION_MAJOR}) - message(STATUS "Compiling against Gazebo Fortress") - find_package(ignition-plugin1 REQUIRED) - set(GZ_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR}) - set(GZ_PLUGIN ignition-plugin${GZ_PLUGIN_VER}::register) - set(GZ_SIM ignition-gazebo${GZ_SIM_VER}::core) -endif() +find_package(gz_sim_vendor REQUIRED) +find_package(gz-sim REQUIRED) + +find_package(gz_plugin_vendor REQUIRED) +find_package(gz-plugin REQUIRED) include_directories(include) @@ -62,8 +37,8 @@ add_library(${PROJECT_NAME}-system SHARED ) target_link_libraries(${PROJECT_NAME}-system - ${GZ_SIM} - ${GZ_PLUGIN} + gz-sim::gz-sim + gz-plugin::register ) ament_target_dependencies(${PROJECT_NAME}-system ament_index_cpp @@ -86,7 +61,7 @@ ament_target_dependencies(gz_hardware_plugins rclcpp ) target_link_libraries(gz_hardware_plugins - ${GZ_SIM} + gz-sim::gz-sim ) ## Install diff --git a/gz_ros2_control/include/gz_ros2_control/gz_ros2_control_plugin.hpp b/gz_ros2_control/include/gz_ros2_control/gz_ros2_control_plugin.hpp index e7c26603..43d71a20 100644 --- a/gz_ros2_control/include/gz_ros2_control/gz_ros2_control_plugin.hpp +++ b/gz_ros2_control/include/gz_ros2_control/gz_ros2_control_plugin.hpp @@ -17,13 +17,8 @@ #include -#ifdef GZ_HEADERS #include namespace sim = gz::sim; -#else -#include -namespace sim = ignition::gazebo; -#endif namespace gz_ros2_control { diff --git a/gz_ros2_control/include/gz_ros2_control/gz_system_interface.hpp b/gz_ros2_control/include/gz_ros2_control/gz_system_interface.hpp index 745864d3..60fa685f 100644 --- a/gz_ros2_control/include/gz_ros2_control/gz_system_interface.hpp +++ b/gz_ros2_control/include/gz_ros2_control/gz_system_interface.hpp @@ -21,13 +21,8 @@ #include #include -#ifdef GZ_HEADERS #include namespace sim = gz::sim; -#else -#include -namespace sim = ignition::gazebo; -#endif #include #include diff --git a/gz_ros2_control/package.xml b/gz_ros2_control/package.xml index ac82b023..8f10adff 100644 --- a/gz_ros2_control/package.xml +++ b/gz_ros2_control/package.xml @@ -11,16 +11,9 @@ ament_cmake ament_index_cpp - - ignition-gazebo6 - ignition-gazebo6 - gz-sim7 - gz-sim8 - - ignition-plugin - ignition-plugin - gz-plugin2 - gz-plugin2 + + gz_sim_vendor + gz_plugin_vendor pluginlib rclcpp yaml_cpp_vendor diff --git a/gz_ros2_control/src/gz_ros2_control_plugin.cpp b/gz_ros2_control/src/gz_ros2_control_plugin.cpp index 5b2d23b3..7620ec9a 100644 --- a/gz_ros2_control/src/gz_ros2_control_plugin.cpp +++ b/gz_ros2_control/src/gz_ros2_control_plugin.cpp @@ -22,7 +22,6 @@ #include #include -#ifdef GZ_HEADERS #include #include #include @@ -30,15 +29,6 @@ #include #include #include -#else -#include -#include -#include -#include -#include -#include -#include -#endif #include @@ -581,7 +571,6 @@ void GazeboSimROS2ControlPlugin::PostUpdate( } } // namespace gz_ros2_control -#ifdef GZ_HEADERS GZ_ADD_PLUGIN( gz_ros2_control::GazeboSimROS2ControlPlugin, gz::sim::System, @@ -591,14 +580,3 @@ GZ_ADD_PLUGIN( GZ_ADD_PLUGIN_ALIAS( gz_ros2_control::GazeboSimROS2ControlPlugin, "ign_ros2_control::IgnitionROS2ControlPlugin") -#else -IGNITION_ADD_PLUGIN( - gz_ros2_control::GazeboSimROS2ControlPlugin, - ignition::gazebo::System, - gz_ros2_control::GazeboSimROS2ControlPlugin::ISystemConfigure, - gz_ros2_control::GazeboSimROS2ControlPlugin::ISystemPreUpdate, - gz_ros2_control::GazeboSimROS2ControlPlugin::ISystemPostUpdate) -IGNITION_ADD_PLUGIN_ALIAS( - gz_ros2_control::GazeboSimROS2ControlPlugin, - "ign_ros2_control::IgnitionROS2ControlPlugin") -#endif diff --git a/gz_ros2_control/src/gz_system.cpp b/gz_ros2_control/src/gz_system.cpp index ac5cc8d1..363c37a1 100644 --- a/gz_ros2_control/src/gz_system.cpp +++ b/gz_ros2_control/src/gz_system.cpp @@ -14,6 +14,8 @@ #include "gz_ros2_control/gz_system.hpp" +#include + #include #include #include @@ -21,9 +23,6 @@ #include #include -#ifdef GZ_HEADERS -#include - #include #include #include @@ -41,27 +40,6 @@ #include #define GZ_TRANSPORT_NAMESPACE gz::transport:: #define GZ_MSGS_NAMESPACE gz::msgs:: -#else -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define GZ_TRANSPORT_NAMESPACE ignition::transport:: -#define GZ_MSGS_NAMESPACE ignition::msgs:: -#endif #include #include diff --git a/gz_ros2_control_demos/launch/cart_example_effort.launch.py b/gz_ros2_control_demos/launch/cart_example_effort.launch.py index 2f0c6bad..8d6b4fe9 100644 --- a/gz_ros2_control_demos/launch/cart_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_effort.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_cart_effort.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_cart_effort.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", - "-name", "cart", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', + '-name', 'cart', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/cart_example_position.launch.py b/gz_ros2_control_demos/launch/cart_example_position.launch.py index 03896e25..14391bb4 100644 --- a/gz_ros2_control_demos/launch/cart_example_position.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_position.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_cart_position.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_cart_position.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", - "-name", "cart", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', + '-name', 'cart', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py b/gz_ros2_control_demos/launch/cart_example_velocity.launch.py index 5694dd16..3406e35d 100644 --- a/gz_ros2_control_demos/launch/cart_example_velocity.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_velocity.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_cart_velocity.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_cart_velocity.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", - "-name", "cart", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', + '-name', 'cart', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/diff_drive_example.launch.py b/gz_ros2_control_demos/launch/diff_drive_example.launch.py index 84bce494..f91560d3 100644 --- a/gz_ros2_control_demos/launch/diff_drive_example.launch.py +++ b/gz_ros2_control_demos/launch/diff_drive_example.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_diff_drive.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_diff_drive.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", "-name", - "diff_drive", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', '-name', + 'diff_drive', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py index eab09938..dbeae8db 100644 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.py @@ -33,15 +33,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_gripper_mimic_joint_effort.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_gripper_mimic_joint_effort.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -54,8 +54,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", "-name", - "gripper", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', '-name', + 'gripper', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.xml b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.xml index 67e2fcb3..a1127a48 100644 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.xml +++ b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_effort.launch.xml @@ -38,7 +38,7 @@ Author: Dr. Denis diff --git a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py index 2b196a35..6e932da5 100644 --- a/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py +++ b/gz_ros2_control_demos/launch/gripper_mimic_joint_example_position.launch.py @@ -33,15 +33,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_gripper_mimic_joint_position.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_gripper_mimic_joint_position.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -54,8 +54,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", "-name", - "gripper", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', '-name', + 'gripper', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py b/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py index a9a54f8e..d09ae2f9 100644 --- a/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/pendulum_example_effort.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_pendulum_effort.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_pendulum_effort.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", - "-name", "cart", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', + '-name', 'cart', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/pendulum_example_position.launch.py b/gz_ros2_control_demos/launch/pendulum_example_position.launch.py index a95af408..24045420 100644 --- a/gz_ros2_control_demos/launch/pendulum_example_position.launch.py +++ b/gz_ros2_control_demos/launch/pendulum_example_position.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_pendulum_position.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_pendulum_position.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", - "-name", "cart", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', + '-name', 'cart', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( diff --git a/gz_ros2_control_demos/launch/tricycle_drive_example.launch.py b/gz_ros2_control_demos/launch/tricycle_drive_example.launch.py index 5aaeac5a..5fe7bd6d 100644 --- a/gz_ros2_control_demos/launch/tricycle_drive_example.launch.py +++ b/gz_ros2_control_demos/launch/tricycle_drive_example.launch.py @@ -30,15 +30,15 @@ def generate_launch_description(): # Get URDF via xacro robot_description_content = Command( [ - PathJoinSubstitution([FindExecutable(name="xacro")]), - " ", + PathJoinSubstitution([FindExecutable(name='xacro')]), + ' ', PathJoinSubstitution( - [FindPackageShare("gz_ros2_control_demos"), - "urdf", "test_tricycle_drive.xacro.urdf"] + [FindPackageShare('gz_ros2_control_demos'), + 'urdf', 'test_tricycle_drive.xacro.urdf'] ), ] ) - robot_description = {"robot_description": robot_description_content} + robot_description = {'robot_description': robot_description_content} node_robot_state_publisher = Node( package='robot_state_publisher', @@ -51,8 +51,8 @@ def generate_launch_description(): package='ros_gz_sim', executable='create', output='screen', - arguments=["-topic", "robot_description", "-name", - "tricyle", "-allow_renaming", "true"], + arguments=['-topic', 'robot_description', '-name', + 'tricyle', '-allow_renaming', 'true'], ) load_joint_state_broadcaster = ExecuteProcess( @@ -71,7 +71,7 @@ def generate_launch_description(): bridge = Node( package='ros_gz_bridge', executable='parameter_bridge', - arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock'], + arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], output='screen' ) diff --git a/gz_ros2_control_demos/package.xml b/gz_ros2_control_demos/package.xml index 4d78438d..d346c54f 100644 --- a/gz_ros2_control_demos/package.xml +++ b/gz_ros2_control_demos/package.xml @@ -37,10 +37,7 @@ ros2launch rclcpp robot_state_publisher - ros_gz_sim - ros_gz_sim - ros_gz_sim - ros_ign_gazebo + ros_gz_sim ros2controlcli std_msgs velocity_controllers diff --git a/gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf b/gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf index 37b062af..be0039ac 100644 --- a/gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf +++ b/gz_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf @@ -165,8 +165,8 @@ $(find gz_ros2_control_demos)/config/cart_controller_velocity.yaml + filename="gz-sim-imu-system" + name="gz::sim::systems::Imu"> diff --git a/gz_ros2_control_tests/package.xml b/gz_ros2_control_tests/package.xml index 100459c7..0c5d3c05 100644 --- a/gz_ros2_control_tests/package.xml +++ b/gz_ros2_control_tests/package.xml @@ -28,10 +28,7 @@ ros2launch rclcpp robot_state_publisher - ros_gz_sim - ros_gz_sim - ros_gz_sim - ros_ign_gazebo + ros_gz_sim ros2controlcli xacro