From 6e896bf091fd879660b872c5177c04b30c1b7775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sun, 8 Dec 2024 22:39:17 +0100 Subject: [PATCH] [CI] Add clang job, setup concurrency, use rt_tools humble branch (#1910) --- .../workflows/humble-abi-compatibility.yml | 5 +++++ .github/workflows/humble-binary-build.yml | 5 +++++ .github/workflows/humble-check-docs.yml | 4 ++++ .github/workflows/humble-coverage-build.yml | 5 +++++ .github/workflows/humble-debian-build.yml | 4 ++++ .github/workflows/humble-pre-commit.yml | 4 ++++ .../workflows/humble-rhel-binary-build.yml | 5 +++++ .../workflows/humble-semi-binary-build.yml | 20 ++++++++++++++++-- .github/workflows/jazzy-abi-compatibility.yml | 5 +++++ .github/workflows/jazzy-binary-build.yml | 5 +++++ .github/workflows/jazzy-check-docs.yml | 4 ++++ .github/workflows/jazzy-debian-build.yml | 4 ++++ .github/workflows/jazzy-pre-commit.yml | 4 ++++ .github/workflows/jazzy-rhel-binary-build.yml | 5 +++++ .github/workflows/jazzy-semi-binary-build.yml | 20 ++++++++++++++++-- .../workflows/rolling-abi-compatibility.yml | 5 +++++ .github/workflows/rolling-binary-build.yml | 5 +++++ .github/workflows/rolling-check-docs.yml | 4 ++++ ...ling-compatibility-humble-binary-build.yml | 5 +++++ ...lling-compatibility-jazzy-binary-build.yml | 5 +++++ .github/workflows/rolling-coverage-build.yml | 5 +++++ .github/workflows/rolling-debian-build.yml | 5 +++++ .github/workflows/rolling-pre-commit.yml | 4 ++++ .../workflows/rolling-rhel-binary-build.yml | 5 +++++ .../workflows/rolling-semi-binary-build.yml | 21 +++++++++++++++++-- .github/workflows/rosdoc2.yml | 3 +++ .../force_torque_sensor.hpp | 4 ++-- .../src/controller_interface_base.cpp | 8 ++++--- controller_manager/src/ros2_control_node.cpp | 2 +- hardware_interface/src/component_parser.cpp | 4 ++-- .../src/mock_components/generic_system.cpp | 14 +++++++------ .../test/test_component_interfaces.cpp | 6 +++--- hardware_interface/test/test_macros.cpp | 2 +- ros2_control.humble.repos | 2 +- 34 files changed, 183 insertions(+), 25 deletions(-) diff --git a/.github/workflows/humble-abi-compatibility.yml b/.github/workflows/humble-abi-compatibility.yml index 0e2488d31e..eed2a7589f 100644 --- a/.github/workflows/humble-abi-compatibility.yml +++ b/.github/workflows/humble-abi-compatibility.yml @@ -14,6 +14,11 @@ on: - '**/CMakeLists.txt' - 'ros2_control-not-released.humble.repos' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: abi_check: runs-on: ubuntu-latest diff --git a/.github/workflows/humble-binary-build.yml b/.github/workflows/humble-binary-build.yml index 6392ba8e68..0fabfda92f 100644 --- a/.github/workflows/humble-binary-build.yml +++ b/.github/workflows/humble-binary-build.yml @@ -32,6 +32,11 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master diff --git a/.github/workflows/humble-check-docs.yml b/.github/workflows/humble-check-docs.yml index f3c31703cd..078a541bf0 100644 --- a/.github/workflows/humble-check-docs.yml +++ b/.github/workflows/humble-check-docs.yml @@ -10,6 +10,10 @@ on: - '**.md' - '**.yaml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-docs: name: Check Docs diff --git a/.github/workflows/humble-coverage-build.yml b/.github/workflows/humble-coverage-build.yml index 209c931d4e..8255b02bb4 100644 --- a/.github/workflows/humble-coverage-build.yml +++ b/.github/workflows/humble-coverage-build.yml @@ -28,6 +28,11 @@ on: - 'ros2_control.humble.repos' - 'codecov.yml' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: coverage_humble: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-build-coverage.yml@master diff --git a/.github/workflows/humble-debian-build.yml b/.github/workflows/humble-debian-build.yml index 85a1b38241..d613d99ed3 100644 --- a/.github/workflows/humble-debian-build.yml +++ b/.github/workflows/humble-debian-build.yml @@ -17,6 +17,10 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} jobs: debian_source_build: diff --git a/.github/workflows/humble-pre-commit.yml b/.github/workflows/humble-pre-commit.yml index 5bb2408578..38a76ee025 100644 --- a/.github/workflows/humble-pre-commit.yml +++ b/.github/workflows/humble-pre-commit.yml @@ -6,6 +6,10 @@ on: branches: - humble +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: pre-commit: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml index 62c5cd62ba..e986bf361e 100644 --- a/.github/workflows/humble-rhel-binary-build.yml +++ b/.github/workflows/humble-rhel-binary-build.yml @@ -17,6 +17,11 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: rhel_semi_binary_build: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master diff --git a/.github/workflows/humble-semi-binary-build.yml b/.github/workflows/humble-semi-binary-build.yml index 96938467f9..7b0c5f1fd3 100644 --- a/.github/workflows/humble-semi-binary-build.yml +++ b/.github/workflows/humble-semi-binary-build.yml @@ -1,6 +1,6 @@ name: Humble Semi-Binary Build # author: Denis Štogl -# description: 'Build & test all dependencies from released (binary) packages.' +# description: 'Build & test all ros2_control dependencies from source.' on: workflow_dispatch: @@ -32,8 +32,13 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on humble branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: - binary: + semi-binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: fail-fast: false @@ -45,3 +50,14 @@ jobs: ros_repo: ${{ matrix.ROS_REPO }} upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: humble + semi-binary-clang: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master + with: + ros_distro: humble + ros_repo: testing + upstream_workspace: ros2_control.humble.repos + ref_for_scheduled_build: humble + additional_debs: clang + c_compiler: clang + cxx_compiler: clang++ + not_test_build: true diff --git a/.github/workflows/jazzy-abi-compatibility.yml b/.github/workflows/jazzy-abi-compatibility.yml index 367b3736fb..aa0fe81e63 100644 --- a/.github/workflows/jazzy-abi-compatibility.yml +++ b/.github/workflows/jazzy-abi-compatibility.yml @@ -14,6 +14,11 @@ on: - '**/CMakeLists.txt' - 'ros2_control-not-released.jazzy.repos' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: abi_check: runs-on: ubuntu-latest diff --git a/.github/workflows/jazzy-binary-build.yml b/.github/workflows/jazzy-binary-build.yml index 5be853ebfc..599a075d9a 100644 --- a/.github/workflows/jazzy-binary-build.yml +++ b/.github/workflows/jazzy-binary-build.yml @@ -32,6 +32,11 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master diff --git a/.github/workflows/jazzy-check-docs.yml b/.github/workflows/jazzy-check-docs.yml index cbdf6c30bd..7910cde0b5 100644 --- a/.github/workflows/jazzy-check-docs.yml +++ b/.github/workflows/jazzy-check-docs.yml @@ -10,6 +10,10 @@ on: - '**.md' - '**.yaml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-docs: name: Check Docs diff --git a/.github/workflows/jazzy-debian-build.yml b/.github/workflows/jazzy-debian-build.yml index 4ec6a29fff..0f695ed8bc 100644 --- a/.github/workflows/jazzy-debian-build.yml +++ b/.github/workflows/jazzy-debian-build.yml @@ -17,6 +17,10 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} jobs: debian_source_build: diff --git a/.github/workflows/jazzy-pre-commit.yml b/.github/workflows/jazzy-pre-commit.yml index d9ec610bbc..aab5ba52ac 100644 --- a/.github/workflows/jazzy-pre-commit.yml +++ b/.github/workflows/jazzy-pre-commit.yml @@ -6,6 +6,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: pre-commit: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master diff --git a/.github/workflows/jazzy-rhel-binary-build.yml b/.github/workflows/jazzy-rhel-binary-build.yml index 0dcc912dab..a6404d2dbd 100644 --- a/.github/workflows/jazzy-rhel-binary-build.yml +++ b/.github/workflows/jazzy-rhel-binary-build.yml @@ -17,6 +17,11 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: rhel_semi_binary_build: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master diff --git a/.github/workflows/jazzy-semi-binary-build.yml b/.github/workflows/jazzy-semi-binary-build.yml index 12769eb740..d5e3a96835 100644 --- a/.github/workflows/jazzy-semi-binary-build.yml +++ b/.github/workflows/jazzy-semi-binary-build.yml @@ -1,6 +1,6 @@ name: Jazzy Semi-Binary Build # author: Denis Štogl -# description: 'Build & test all dependencies from released (binary) packages.' +# description: 'Build & test all ros2_control dependencies from source.' on: workflow_dispatch: @@ -32,8 +32,13 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: - binary: + semi-binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: fail-fast: false @@ -45,3 +50,14 @@ jobs: ros_repo: ${{ matrix.ROS_REPO }} upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: master + semi-binary-clang: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master + with: + ros_distro: jazzy + ros_repo: testing + upstream_workspace: ros2_control.jazzy.repos + ref_for_scheduled_build: master + additional_debs: clang + c_compiler: clang + cxx_compiler: clang++ + not_test_build: true diff --git a/.github/workflows/rolling-abi-compatibility.yml b/.github/workflows/rolling-abi-compatibility.yml index b7828390fb..50f2a46154 100644 --- a/.github/workflows/rolling-abi-compatibility.yml +++ b/.github/workflows/rolling-abi-compatibility.yml @@ -14,6 +14,11 @@ on: - '**/CMakeLists.txt' - 'ros2_control-not-released.rolling.repos' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: abi_check: runs-on: ubuntu-latest diff --git a/.github/workflows/rolling-binary-build.yml b/.github/workflows/rolling-binary-build.yml index 24a28f16ae..0859169b15 100644 --- a/.github/workflows/rolling-binary-build.yml +++ b/.github/workflows/rolling-binary-build.yml @@ -32,6 +32,11 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master diff --git a/.github/workflows/rolling-check-docs.yml b/.github/workflows/rolling-check-docs.yml index bd83c0caca..085ee7f9d1 100644 --- a/.github/workflows/rolling-check-docs.yml +++ b/.github/workflows/rolling-check-docs.yml @@ -11,6 +11,10 @@ on: - '**.yaml' - '.github/workflows/rolling-check-docs.yml' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-docs: name: Check Docs diff --git a/.github/workflows/rolling-compatibility-humble-binary-build.yml b/.github/workflows/rolling-compatibility-humble-binary-build.yml index b55091521e..35957bbc0e 100644 --- a/.github/workflows/rolling-compatibility-humble-binary-build.yml +++ b/.github/workflows/rolling-compatibility-humble-binary-build.yml @@ -29,6 +29,11 @@ on: - '**/CMakeLists.txt' - 'ros2_control.rolling.repos' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: build-on-humble: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master diff --git a/.github/workflows/rolling-compatibility-jazzy-binary-build.yml b/.github/workflows/rolling-compatibility-jazzy-binary-build.yml index 621ffb6a26..bddbd14878 100644 --- a/.github/workflows/rolling-compatibility-jazzy-binary-build.yml +++ b/.github/workflows/rolling-compatibility-jazzy-binary-build.yml @@ -29,6 +29,11 @@ on: - '**/CMakeLists.txt' - 'ros2_control.rolling.repos' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: build-on-jazzy: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master diff --git a/.github/workflows/rolling-coverage-build.yml b/.github/workflows/rolling-coverage-build.yml index 45b10876e7..ad4e467606 100644 --- a/.github/workflows/rolling-coverage-build.yml +++ b/.github/workflows/rolling-coverage-build.yml @@ -28,6 +28,11 @@ on: - 'ros2_control.rolling.repos' - 'codecov.yml' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: coverage_rolling: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-build-coverage.yml@master diff --git a/.github/workflows/rolling-debian-build.yml b/.github/workflows/rolling-debian-build.yml index 00d4ad844b..a54e7ad0d1 100644 --- a/.github/workflows/rolling-debian-build.yml +++ b/.github/workflows/rolling-debian-build.yml @@ -17,6 +17,11 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: debian_source_build: diff --git a/.github/workflows/rolling-pre-commit.yml b/.github/workflows/rolling-pre-commit.yml index 7bc07ba802..792278d6d2 100644 --- a/.github/workflows/rolling-pre-commit.yml +++ b/.github/workflows/rolling-pre-commit.yml @@ -6,6 +6,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: pre-commit: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml index c8939d6015..95d6759da6 100644 --- a/.github/workflows/rolling-rhel-binary-build.yml +++ b/.github/workflows/rolling-rhel-binary-build.yml @@ -17,6 +17,11 @@ on: # Run every day to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: rhel_semi_binary_build: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-rhel-binary-build.yml@master diff --git a/.github/workflows/rolling-semi-binary-build.yml b/.github/workflows/rolling-semi-binary-build.yml index 492da45ab9..6431b9f4fa 100644 --- a/.github/workflows/rolling-semi-binary-build.yml +++ b/.github/workflows/rolling-semi-binary-build.yml @@ -1,6 +1,6 @@ name: Rolling Semi-Binary Build # author: Denis Štogl -# description: 'Build & test all dependencies from released (binary) packages.' +# description: 'Build & test all ros2_control dependencies from source.' on: workflow_dispatch: @@ -32,8 +32,13 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' +concurrency: + # cancel previous runs of the same workflow, except for pushes on master branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ !startsWith(github.ref, '/refs/heads') }} + jobs: - binary: + semi-binary: uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master strategy: fail-fast: false @@ -45,3 +50,15 @@ jobs: ros_repo: ${{ matrix.ROS_REPO }} upstream_workspace: ros2_control.${{ matrix.ROS_DISTRO }}.repos ref_for_scheduled_build: master + semi-binary-clang: + uses: ros-controls/ros2_control_ci/.github/workflows/reusable-industrial-ci-with-cache.yml@master + with: + # job for building only, no tests -> one distro is enough + ros_distro: rolling + ros_repo: testing + upstream_workspace: ros2_control.rolling.repos + ref_for_scheduled_build: master + additional_debs: clang + c_compiler: clang + cxx_compiler: clang++ + not_test_build: true diff --git a/.github/workflows/rosdoc2.yml b/.github/workflows/rosdoc2.yml index 07a9e2904a..3452796f55 100644 --- a/.github/workflows/rosdoc2.yml +++ b/.github/workflows/rosdoc2.yml @@ -8,6 +8,9 @@ on: - ros2_control/rosdoc2.yaml - ros2_control/package.xml +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: check: diff --git a/controller_interface/include/semantic_components/force_torque_sensor.hpp b/controller_interface/include/semantic_components/force_torque_sensor.hpp index ab55a537ad..c749ed1db8 100644 --- a/controller_interface/include/semantic_components/force_torque_sensor.hpp +++ b/controller_interface/include/semantic_components/force_torque_sensor.hpp @@ -62,7 +62,7 @@ class ForceTorqueSensor : public SemanticComponentInterface(std::count(existing_axes_.begin(), existing_axes_.begin() + 3, true)); for (size_t i = 3; i < 6; ++i) { diff --git a/controller_interface/src/controller_interface_base.cpp b/controller_interface/src/controller_interface_base.cpp index 065fe77061..03d45fa384 100644 --- a/controller_interface/src/controller_interface_base.cpp +++ b/controller_interface/src/controller_interface_base.cpp @@ -34,7 +34,9 @@ return_type ControllerInterfaceBase::init( try { - auto_declare("update_rate", update_rate_); + // no rclcpp::ParameterValue unsigned int specialization + auto_declare("update_rate", static_cast(update_rate_)); + auto_declare("is_async", false); auto_declare("thread_priority", 50); } @@ -123,8 +125,8 @@ const rclcpp_lifecycle::State & ControllerInterfaceBase::configure() } if (is_async_) { - const unsigned int thread_priority = - static_cast(get_node()->get_parameter("thread_priority").as_int()); + const int thread_priority = + static_cast(get_node()->get_parameter("thread_priority").as_int()); RCLCPP_INFO( get_node()->get_logger(), "Starting async handler with scheduler priority: %d", thread_priority); diff --git a/controller_manager/src/ros2_control_node.cpp b/controller_manager/src/ros2_control_node.cpp index 4cec3368b7..6bff653044 100644 --- a/controller_manager/src/ros2_control_node.cpp +++ b/controller_manager/src/ros2_control_node.cpp @@ -73,7 +73,7 @@ int main(int argc, char ** argv) std::vector cpus = {}; if (cpu_affinity_param.get_type() == rclcpp::ParameterType::PARAMETER_INTEGER) { - cpus = {cpu_affinity_param.as_int()}; + cpus = {static_cast(cpu_affinity_param.as_int())}; } else if (cpu_affinity_param.get_type() == rclcpp::ParameterType::PARAMETER_INTEGER_ARRAY) { diff --git a/hardware_interface/src/component_parser.cpp b/hardware_interface/src/component_parser.cpp index f32db49dcb..146a5aef05 100644 --- a/hardware_interface/src/component_parser.cpp +++ b/hardware_interface/src/component_parser.cpp @@ -187,7 +187,7 @@ std::size_t parse_size_attribute(const tinyxml2::XMLElement * elem) std::regex int_re("[1-9][0-9]*"); if (std::regex_match(s, int_re)) { - size = std::stoi(s); + size = static_cast(std::stoi(s)); } else { @@ -923,7 +923,7 @@ std::vector parse_control_resources_from_urdf(const std::string & { throw std::runtime_error("Mimic joint '" + name + "' not found in tag"); } - return std::distance(hw_info.joints.begin(), it); + return static_cast(std::distance(hw_info.joints.begin(), it)); }; MimicJoint mimic_joint; diff --git a/hardware_interface/src/mock_components/generic_system.cpp b/hardware_interface/src/mock_components/generic_system.cpp index 8b46d21f4d..2b1d635c97 100644 --- a/hardware_interface/src/mock_components/generic_system.cpp +++ b/hardware_interface/src/mock_components/generic_system.cpp @@ -117,7 +117,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i custom_interface_with_following_offset_ = it->second; } } - // it's extremely improbable that std::distance results int this value - therefore default + // it's extremely improbable that std::distance results in this value - therefore default index_custom_interface_with_following_offset_ = std::numeric_limits::max(); // Initialize storage for standard interfaces @@ -157,7 +157,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i if (if_it != other_interfaces_.end()) { index_custom_interface_with_following_offset_ = - std::distance(other_interfaces_.begin(), if_it); + static_cast(std::distance(other_interfaces_.begin(), if_it)); RCLCPP_INFO( get_logger(), "Custom interface with following offset '%s' found at index: %zu.", custom_interface_with_following_offset_.c_str(), @@ -348,7 +348,8 @@ return_type GenericSystem::prepare_command_mode_switch( if (joint_it_found != info.joints.end()) { - const size_t joint_index = std::distance(info.joints.begin(), joint_it_found); + const size_t joint_index = + static_cast(std::distance(info.joints.begin(), joint_it_found)); if (joint_found_in_x_requests_[joint_index] == 0) { joint_found_in_x_requests_[joint_index] = FOUND_ONCE_FLAG; @@ -436,7 +437,8 @@ return_type GenericSystem::perform_command_mode_switch( if (joint_it_found != info.joints.end()) { - const size_t joint_index = std::distance(info.joints.begin(), joint_it_found); + const size_t joint_index = + static_cast(std::distance(info.joints.begin(), joint_it_found)); if (key == info.joints[joint_index].name + "/" + hardware_interface::HW_IF_POSITION) { @@ -630,7 +632,7 @@ bool GenericSystem::get_interface( auto it = std::find(interface_list.begin(), interface_list.end(), interface_name); if (it != interface_list.end()) { - auto j = std::distance(interface_list.begin(), it); + auto j = static_cast(std::distance(interface_list.begin(), it)); interfaces.emplace_back(name, *it, &values[j][vector_index]); return true; } @@ -662,7 +664,7 @@ void GenericSystem::initialize_storage_vectors( // If interface name is found in the interfaces list if (it != interfaces.end()) { - auto index = std::distance(interfaces.begin(), it); + auto index = static_cast(std::distance(interfaces.begin(), it)); // Check the initial_value param is used if (!interface.initial_value.empty()) diff --git a/hardware_interface/test/test_component_interfaces.cpp b/hardware_interface/test/test_component_interfaces.cpp index df2147bd1a..9ca46ee0f8 100644 --- a/hardware_interface/test/test_component_interfaces.cpp +++ b/hardware_interface/test/test_component_interfaces.cpp @@ -467,7 +467,7 @@ class DummySystem : public hardware_interface::SystemInterface return hardware_interface::return_type::ERROR; } - for (auto i = 0; i < 3; ++i) + for (size_t i = 0; i < 3; ++i) { position_state_[i] += velocity_command_[0]; velocity_state_[i] = velocity_command_[0]; @@ -477,7 +477,7 @@ class DummySystem : public hardware_interface::SystemInterface CallbackReturn on_shutdown(const rclcpp_lifecycle::State & /*previous_state*/) override { - for (auto i = 0ul; i < 3; ++i) + for (size_t i = 0; i < 3; ++i) { velocity_state_[i] = 0.0; } @@ -573,7 +573,7 @@ class DummySystemDefault : public hardware_interface::SystemInterface return hardware_interface::return_type::ERROR; } - for (auto i = 0; i < 3; ++i) + for (size_t i = 0; i < 3; ++i) { auto current_pos = get_state(position_states_[i]); set_state(position_states_[i], current_pos + get_command(velocity_commands_[i])); diff --git a/hardware_interface/test/test_macros.cpp b/hardware_interface/test/test_macros.cpp index 18e9e292c0..db62bce38f 100644 --- a/hardware_interface/test/test_macros.cpp +++ b/hardware_interface/test/test_macros.cpp @@ -62,7 +62,7 @@ TEST_F(TestMacros, throw_on_not_null) EXPECT_ANY_THROW(THROW_ON_NOT_NULLPTR(a_ptr)); std::vector vec_ptr; - for (auto i : {0, 1, 2}) + for (size_t i = 0; i < 3; ++i) { vec_ptr.push_back(i_ptr); EXPECT_ANY_THROW(THROW_ON_NOT_NULLPTR(vec_ptr[i])); diff --git a/ros2_control.humble.repos b/ros2_control.humble.repos index 98b2866d38..af5cbc3c26 100644 --- a/ros2_control.humble.repos +++ b/ros2_control.humble.repos @@ -2,7 +2,7 @@ repositories: ros-controls/realtime_tools: type: git url: https://github.com/ros-controls/realtime_tools.git - version: master + version: humble ros-controls/control_msgs: type: git url: https://github.com/ros-controls/control_msgs.git