diff --git a/.github/workflows/galactic-rhel-binary-build.yml b/.github/workflows/galactic-rhel-binary-build.yml index c5e592b33d..ca0b30382a 100644 --- a/.github/workflows/galactic-rhel-binary-build.yml +++ b/.github/workflows/galactic-rhel-binary-build.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest env: ROS_DISTRO: galactic - container: ghcr.io/ros-controls/ros:${{ env.ROS_DISTRO }}-rhel + container: ghcr.io/ros-controls/ros:galactic-rhel steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/humble-rhel-binary-build.yml b/.github/workflows/humble-rhel-binary-build.yml index e9c4f5f8b9..5e4548f4a1 100644 --- a/.github/workflows/humble-rhel-binary-build.yml +++ b/.github/workflows/humble-rhel-binary-build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest env: ROS_DISTRO: humble - container: ghcr.io/ros-controls/ros:${{ env.ROS_DISTRO }}-rhel + container: ghcr.io/ros-controls/ros:humble-rhel steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/reusable-industrial-ci-with-cache.yml b/.github/workflows/reusable-industrial-ci-with-cache.yml index 0ff359d091..490b680e7c 100644 --- a/.github/workflows/reusable-industrial-ci-with-cache.yml +++ b/.github/workflows/reusable-industrial-ci-with-cache.yml @@ -54,7 +54,7 @@ jobs: env: CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} BASEDIR: ${{ github.workspace }}/${{ inputs.basedir }} - CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.os_code_name }}-${{ inputs.ros_repo }}-${{ github.job }} + 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' }} diff --git a/.github/workflows/rolling-rhel-binary-build.yml b/.github/workflows/rolling-rhel-binary-build.yml index fb6da24908..563ad6e3d4 100644 --- a/.github/workflows/rolling-rhel-binary-build.yml +++ b/.github/workflows/rolling-rhel-binary-build.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest env: ROS_DISTRO: rolling - container: ghcr.io/ros-controls/ros:${{ env.ROS_DISTRO }}-rhel + container: ghcr.io/ros-controls/ros:rolling-rhel steps: - uses: actions/checkout@v3 with: diff --git a/controller_interface/CHANGELOG.rst b/controller_interface/CHANGELOG.rst index f2f0505538..9b80541b43 100644 --- a/controller_interface/CHANGELOG.rst +++ b/controller_interface/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog for package controller_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ +* Add docs in export interface configurations for controllers. (`#804 `_) +* Contributors: Denis Štogl + 3.0.0 (2022-09-19) ------------------ diff --git a/controller_interface/package.xml b/controller_interface/package.xml index c5b50ec64e..99191e56c9 100644 --- a/controller_interface/package.xml +++ b/controller_interface/package.xml @@ -2,7 +2,7 @@ controller_interface - 3.0.0 + 3.1.0 Description of controller_interface Bence Magyar Denis Štogl diff --git a/controller_manager/CHANGELOG.rst b/controller_manager/CHANGELOG.rst index 3f28140a5c..4e765cd61b 100644 --- a/controller_manager/CHANGELOG.rst +++ b/controller_manager/CHANGELOG.rst @@ -2,6 +2,18 @@ Changelog for package controller_manager ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ +* Don't ask to export reference interface if controller not 'inactive' or 'active' (`#824 `_) +* Add diagnostics for controllers activity (`#820 `_) +* Search for controller manager in the same namespace as spawner (`#810 `_) +* Handle HW errors on read and write in CM by stopping controllers (`#742 `_) + Add code for deactivating controller when hardware gets an error on read and write. + Fix misleading variable name in the tests. + Remove all interface from available list for hardware when an error happens. + Do some more variable renaming to the new nomenclature. +* Contributors: Denis Štogl, Tony Najjar + 3.0.0 (2022-09-19) ------------------ diff --git a/controller_manager/CMakeLists.txt b/controller_manager/CMakeLists.txt index ba0686d522..c1da253f1e 100644 --- a/controller_manager/CMakeLists.txt +++ b/controller_manager/CMakeLists.txt @@ -9,6 +9,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS ament_index_cpp controller_interface controller_manager_msgs + diagnostic_updater hardware_interface pluginlib rclcpp diff --git a/controller_manager/include/controller_manager/controller_manager.hpp b/controller_manager/include/controller_manager/controller_manager.hpp index 5c8bc9851e..e6b377570a 100644 --- a/controller_manager/include/controller_manager/controller_manager.hpp +++ b/controller_manager/include/controller_manager/controller_manager.hpp @@ -40,6 +40,7 @@ #include "controller_manager_msgs/srv/switch_controller.hpp" #include "controller_manager_msgs/srv/unload_controller.hpp" +#include "diagnostic_updater/diagnostic_updater.hpp" #include "hardware_interface/handle.hpp" #include "hardware_interface/resource_manager.hpp" @@ -378,6 +379,9 @@ class ControllerManager : public rclcpp::Node const std::vector & controllers, int strictness, const ControllersListIterator controller_it); + void controller_activity_diagnostic_callback(diagnostic_updater::DiagnosticStatusWrapper & stat); + diagnostic_updater::Updater diagnostics_updater_; + std::shared_ptr executor_; std::shared_ptr> loader_; diff --git a/controller_manager/package.xml b/controller_manager/package.xml index be3ee3f435..d974d69e53 100644 --- a/controller_manager/package.xml +++ b/controller_manager/package.xml @@ -2,7 +2,7 @@ controller_manager - 3.0.0 + 3.1.0 Description of controller_manager Bence Magyar Denis Štogl @@ -14,6 +14,7 @@ ament_index_cpp controller_interface controller_manager_msgs + diagnostic_updater hardware_interface launch launch_ros diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 441efe4bec..eee46d203f 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -147,7 +147,8 @@ ControllerManager::ControllerManager( kControllerInterfaceNamespace, kControllerInterfaceClassName)), chainable_loader_( std::make_shared>( - kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)) + kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)), + diagnostics_updater_(this) { if (!get_parameter("update_rate", update_rate_)) { @@ -163,6 +164,9 @@ ControllerManager::ControllerManager( init_resource_manager(robot_description); + diagnostics_updater_.setHardwareID("ros2_control"); + diagnostics_updater_.add( + "Controllers Activity", this, &ControllerManager::controller_activity_diagnostic_callback); init_services(); } @@ -177,8 +181,12 @@ ControllerManager::ControllerManager( kControllerInterfaceNamespace, kControllerInterfaceClassName)), chainable_loader_( std::make_shared>( - kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)) + kControllerInterfaceNamespace, kChainableControllerInterfaceClassName)), + diagnostics_updater_(this) { + diagnostics_updater_.setHardwareID("ros2_control"); + diagnostics_updater_.add( + "Controllers Activity", this, &ControllerManager::controller_activity_diagnostic_callback); init_services(); } @@ -1307,24 +1315,25 @@ void ControllerManager::list_controllers_srv_cb( { controller_state.required_state_interfaces = state_interface_config.names; } - } - // check for chained interfaces - for (const auto & interface : controller_state.required_command_interfaces) - { - auto prefix_interface_type_pair = split_command_interface(interface); - auto prefix = prefix_interface_type_pair.first; - auto interface_type = prefix_interface_type_pair.second; - if (controller_chain_map.find(prefix) != controller_chain_map.end()) + // check for chained interfaces + for (const auto & interface : controller_state.required_command_interfaces) { - controller_chain_map[controller_state.name].insert(prefix); - controller_chain_interface_map[controller_state.name].push_back(interface_type); + auto prefix_interface_type_pair = split_command_interface(interface); + auto prefix = prefix_interface_type_pair.first; + auto interface_type = prefix_interface_type_pair.second; + if (controller_chain_map.find(prefix) != controller_chain_map.end()) + { + controller_chain_map[controller_state.name].insert(prefix); + controller_chain_interface_map[controller_state.name].push_back(interface_type); + } + } + // check reference interfaces only if controller is inactive or active + auto references = controllers[i].c->export_reference_interfaces(); + controller_state.reference_interfaces.reserve(references.size()); + for (const auto & reference : references) + { + controller_state.reference_interfaces.push_back(reference.get_interface_name()); } - } - auto references = controllers[i].c->export_reference_interfaces(); - controller_state.reference_interfaces.reserve(references.size()); - for (const auto & reference : references) - { - controller_state.reference_interfaces.push_back(reference.get_interface_name()); } response->controller.push_back(controller_state); // keep track of controllers that are part of a chain @@ -2119,4 +2128,30 @@ controller_interface::return_type ControllerManager::check_preceeding_controller return controller_interface::return_type::OK; }; +void ControllerManager::controller_activity_diagnostic_callback( + diagnostic_updater::DiagnosticStatusWrapper & stat) +{ + // lock controllers + std::lock_guard guard(rt_controllers_wrapper_.controllers_lock_); + const std::vector & controllers = rt_controllers_wrapper_.get_updated_list(guard); + bool all_active = true; + for (size_t i = 0; i < controllers.size(); ++i) + { + if (!is_controller_active(controllers[i].c)) + { + all_active = false; + } + stat.add(controllers[i].info.name, controllers[i].c->get_state().label()); + } + + if (all_active) + { + stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "All controllers are active"); + } + else + { + stat.summary(diagnostic_msgs::msg::DiagnosticStatus::ERROR, "Not all controllers are active"); + } +} + } // namespace controller_manager diff --git a/controller_manager/test/test_controller_manager_srvs.cpp b/controller_manager/test/test_controller_manager_srvs.cpp index b6247b8179..adb227d6fe 100644 --- a/controller_manager/test/test_controller_manager_srvs.cpp +++ b/controller_manager/test/test_controller_manager_srvs.cpp @@ -242,7 +242,7 @@ TEST_F(TestControllerManagerSrvs, list_chained_controllers_srv) ASSERT_EQ(result->controller[0].required_state_interfaces.size(), 0u); ASSERT_EQ(result->controller[0].is_chainable, true); ASSERT_EQ(result->controller[0].is_chained, false); - ASSERT_EQ(result->controller[0].reference_interfaces.size(), 2u); + ASSERT_EQ(result->controller[0].reference_interfaces.size(), 0u); ASSERT_EQ(result->controller[0].chain_connections.size(), 0u); // check test controller ASSERT_EQ(result->controller[1].name, "test_controller_name"); diff --git a/controller_manager_msgs/CHANGELOG.rst b/controller_manager_msgs/CHANGELOG.rst index dce07c1875..43d7625e8d 100644 --- a/controller_manager_msgs/CHANGELOG.rst +++ b/controller_manager_msgs/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package controller_manager_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/controller_manager_msgs/package.xml b/controller_manager_msgs/package.xml index b1e65f5f54..d19c69a274 100644 --- a/controller_manager_msgs/package.xml +++ b/controller_manager_msgs/package.xml @@ -2,7 +2,7 @@ controller_manager_msgs - 3.0.0 + 3.1.0 Messages and services for the controller manager. Bence Magyar Denis Štogl diff --git a/hardware_interface/CHANGELOG.rst b/hardware_interface/CHANGELOG.rst index 8fd57a86e1..501dd24a94 100644 --- a/hardware_interface/CHANGELOG.rst +++ b/hardware_interface/CHANGELOG.rst @@ -2,6 +2,13 @@ Changelog for package hardware_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ +* Cleanup Resource Manager a bit to increase clarity. (`#816 `_) +* Handle hardware errors in Resource Manager (`#805 `_) + * Add code for deactivating controller when hardware gets an error on read and write. +* Contributors: Denis Štogl + 3.0.0 (2022-09-19) ------------------ diff --git a/hardware_interface/doc/writing_new_hardware_interface.rst b/hardware_interface/doc/writing_new_hardware_interface.rst index eb4c528216..fb748359eb 100644 --- a/hardware_interface/doc/writing_new_hardware_interface.rst +++ b/hardware_interface/doc/writing_new_hardware_interface.rst @@ -3,7 +3,7 @@ Writing a new hardware interface ================================= -In ros2_control hardware system components are libraries, dynamically loaded by the controller manager using the `pluginlib `_ interface. +In ros2_control hardware system components are libraries, dynamically loaded by the controller manager using the `pluginlib `_ interface. The following is a step-by-step guide to create source files, basic tests, and compile rules for a new hardware interface. 1. **Preparing package** @@ -28,7 +28,7 @@ The following is a step-by-step guide to create source files, basic tests, and c 1. Take care that you use header guards. ROS2-style is using ``#ifndef`` and ``#define`` preprocessor directives. (For more information on this, a search engine is your friend :) ). 2. Include ``"hardware_interface/$interface_type$_interface.hpp"`` and ``visibility_control.h`` if you are using one. - ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check `Hardware Components description `_. + ``$interface_type$`` can be ``Actuator``, ``Sensor`` or ``System`` depending on the type of hardware you are using. for more details about each type check `Hardware Components description `_. 3. Define a unique namespace for your hardware_interface. This is usually the package name written in ``snake_case``. @@ -37,7 +37,7 @@ The following is a step-by-step guide to create source files, basic tests, and c class HardwareInterfaceName : public hardware_interface::$InterfaceType$Interface 5. Add a constructor without parameters and the following public methods implementing ``LifecycleNodeInterface``: ``on_configure``, ``on_cleanup``, ``on_shutdown``, ``on_activate``, ``on_deactivate``, ``on_error``; and overriding ``$InterfaceType$Interface`` definition: ``on_init``, ``export_state_interfaces``, ``export_command_interfaces``, ``prepare_command_mode_switch`` (optional), ``perform_command_mode_switch`` (optional), ``read``, ``write``. - For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. + For further explanation of hardware-lifecycle check the `pull request `_ and for exact definitions of methods check the ``"hardware_interface/$interface_type$_interface.hpp"`` header or `doxygen documentation `_ for *Actuator*, *Sensor* or *System*. 4. **Adding definitions into source file (.cpp)** @@ -137,4 +137,4 @@ That's it! Enjoy writing great controllers! Useful External References --------------------------- -- `Templates and scripts for generating controllers shell `_ **NOTE**: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. +- `Templates and scripts for generating controllers shell `_ **NOTE**: The script is currently only recommended to use for Foxy, not compatible with the API from Galactic and onwards. diff --git a/hardware_interface/package.xml b/hardware_interface/package.xml index c485d7fb6d..305280905b 100644 --- a/hardware_interface/package.xml +++ b/hardware_interface/package.xml @@ -1,7 +1,7 @@ hardware_interface - 3.0.0 + 3.1.0 ros2_control hardware interface Bence Magyar Denis Štogl diff --git a/joint_limits/CHANGELOG.rst b/joint_limits/CHANGELOG.rst index 4f99dc4f77..542ad46519 100644 --- a/joint_limits/CHANGELOG.rst +++ b/joint_limits/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package joint_limits ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/joint_limits/package.xml b/joint_limits/package.xml index ce6ded966f..cf8f56ede3 100644 --- a/joint_limits/package.xml +++ b/joint_limits/package.xml @@ -1,6 +1,6 @@ joint_limits - 3.0.0 + 3.1.0 Interfaces for handling of joint limits for controllers or hardware. Bence Magyar diff --git a/ros2_control/CHANGELOG.rst b/ros2_control/CHANGELOG.rst index eb49599ec2..ac95a0e4d2 100644 --- a/ros2_control/CHANGELOG.rst +++ b/ros2_control/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package ros2_control ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/ros2_control/package.xml b/ros2_control/package.xml index 3f76b113bb..a08c20916d 100644 --- a/ros2_control/package.xml +++ b/ros2_control/package.xml @@ -1,7 +1,7 @@ ros2_control - 3.0.0 + 3.1.0 Metapackage for ROS2 control related packages Bence Magyar Denis Štogl diff --git a/ros2_control_test_assets/CHANGELOG.rst b/ros2_control_test_assets/CHANGELOG.rst index 75c0ce9ecc..e644f83862 100644 --- a/ros2_control_test_assets/CHANGELOG.rst +++ b/ros2_control_test_assets/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package ros2_control_test_assets ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/ros2_control_test_assets/package.xml b/ros2_control_test_assets/package.xml index 1948b6efc6..b03e23427d 100644 --- a/ros2_control_test_assets/package.xml +++ b/ros2_control_test_assets/package.xml @@ -2,7 +2,7 @@ ros2_control_test_assets - 3.0.0 + 3.1.0 The package provides shared test resources for ros2_control stack Bence Magyar diff --git a/ros2controlcli/CHANGELOG.rst b/ros2controlcli/CHANGELOG.rst index 3b2637b598..0cd03f7a8c 100644 --- a/ros2controlcli/CHANGELOG.rst +++ b/ros2controlcli/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package ros2controlcli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/ros2controlcli/package.xml b/ros2controlcli/package.xml index 377b2d409c..6aec54e434 100644 --- a/ros2controlcli/package.xml +++ b/ros2controlcli/package.xml @@ -2,7 +2,7 @@ ros2controlcli - 3.0.0 + 3.1.0 The ROS 2 command line tools for ROS2 Control. diff --git a/ros2controlcli/setup.py b/ros2controlcli/setup.py index 985595d931..52267c4101 100644 --- a/ros2controlcli/setup.py +++ b/ros2controlcli/setup.py @@ -5,7 +5,7 @@ setup( name=package_name, - version='3.0.0', + version='3.1.0', packages=find_packages(exclude=['test']), data_files=[ ('share/' + package_name, ['package.xml']), diff --git a/transmission_interface/CHANGELOG.rst b/transmission_interface/CHANGELOG.rst index 3e4d0e4c80..cea9c44877 100644 --- a/transmission_interface/CHANGELOG.rst +++ b/transmission_interface/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package transmission_interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3.1.0 (2022-10-05) +------------------ + 3.0.0 (2022-09-19) ------------------ diff --git a/transmission_interface/package.xml b/transmission_interface/package.xml index 0b9ec6ec60..48cb82a6db 100644 --- a/transmission_interface/package.xml +++ b/transmission_interface/package.xml @@ -2,7 +2,7 @@ transmission_interface - 3.0.0 + 3.1.0 transmission_interface contains data structures for representing mechanical transmissions, methods for propagating values between actuator and joint spaces and tooling to support this. Bence Magyar Denis Štogl