diff --git a/hardware_interface/include/hardware_interface/actuator_interface.hpp b/hardware_interface/include/hardware_interface/actuator_interface.hpp index 7e5b3eccc7..32b937fbd8 100644 --- a/hardware_interface/include/hardware_interface/actuator_interface.hpp +++ b/hardware_interface/include/hardware_interface/actuator_interface.hpp @@ -114,6 +114,8 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod info_ = hardware_info; if (info_.is_async) { + RCLCPP_INFO_STREAM( + get_logger(), "Starting async handler with scheduler priority: " << info_.thread_priority); async_handler_ = std::make_unique>(); async_handler_->init( [this](const rclcpp::Time & time, const rclcpp::Duration & period) @@ -130,7 +132,8 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod next_trigger_ = TriggerType::READ; return ret; } - }); + }, + info_.thread_priority); async_handler_->start_thread(); } return on_init(hardware_info); diff --git a/hardware_interface/include/hardware_interface/sensor_interface.hpp b/hardware_interface/include/hardware_interface/sensor_interface.hpp index 5a09747925..65947ec7ae 100644 --- a/hardware_interface/include/hardware_interface/sensor_interface.hpp +++ b/hardware_interface/include/hardware_interface/sensor_interface.hpp @@ -114,9 +114,12 @@ class SensorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI info_ = hardware_info; if (info_.is_async) { + RCLCPP_INFO_STREAM( + get_logger(), "Starting async handler with scheduler priority: " << info_.thread_priority); read_async_handler_ = std::make_unique>(); read_async_handler_->init( - std::bind(&SensorInterface::read, this, std::placeholders::_1, std::placeholders::_2)); + std::bind(&SensorInterface::read, this, std::placeholders::_1, std::placeholders::_2), + info_.thread_priority); read_async_handler_->start_thread(); } return on_init(hardware_info); diff --git a/hardware_interface/include/hardware_interface/system_interface.hpp b/hardware_interface/include/hardware_interface/system_interface.hpp index f959484896..a79221f7c8 100644 --- a/hardware_interface/include/hardware_interface/system_interface.hpp +++ b/hardware_interface/include/hardware_interface/system_interface.hpp @@ -117,6 +117,8 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI info_ = hardware_info; if (info_.is_async) { + RCLCPP_INFO_STREAM( + get_logger(), "Starting async handler with scheduler priority: " << info_.thread_priority); async_handler_ = std::make_unique>(); async_handler_->init( [this](const rclcpp::Time & time, const rclcpp::Duration & period) @@ -133,7 +135,8 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI next_trigger_ = TriggerType::READ; return ret; } - }); + }, + info_.thread_priority); async_handler_->start_thread(); } return on_init(hardware_info);