Skip to content

Commit f6d61f4

Browse files
author
devis12
committed
Backward compatibility with humble
1 parent 92cb373 commit f6d61f4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

behaviortree_ros2/include/behaviortree_ros2/bt_service_node.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,12 @@ inline RosServiceNode<T>::ServiceClientInstance::ServiceClientInstance(
216216
node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
217217
callback_executor.add_callback_group(callback_group, node->get_node_base_interface());
218218

219-
service_client = node->create_client<T>(service_name, rclcpp::QoS(rclcpp::ServicesQoS()),
220-
callback_group);
219+
#if RCLCPP_VERSION_MAJOR >= 21 // Iron, Jazzy and later
220+
service_client = node->create_client<T>(service_name, rclcpp::QoS(rclcpp::ServicesQoS()),
221+
callback_group);
222+
#else // Humble
223+
service_client = node->create_client<T>(service_name, rmw_qos_profile_services_default, callback_group);
224+
#endif
221225
}
222226

223227
template <class T>

0 commit comments

Comments
 (0)