Skip to content

Commit 484e648

Browse files
Keep rmw_qos_profile_t for humble
Signed-off-by: ElSayed ElSheikh <elsayed.elsheikh97@gmail.com>
1 parent f1fad00 commit 484e648

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

behaviortree_ros2/include/behaviortree_ros2/bt_service_node.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <string>
2020
#include <rclcpp/executors.hpp>
2121
#include <rclcpp/allocator/allocator_common.hpp>
22+
#include <rclcpp/version.h>
2223
#include <rclcpp/qos.hpp>
2324
#include "behaviortree_cpp/bt_factory.h"
2425

@@ -217,8 +218,14 @@ inline RosServiceNode<T>::ServiceClientInstance::ServiceClientInstance(
217218
node->create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive, false);
218219
callback_executor.add_callback_group(callback_group, node->get_node_base_interface());
219220

221+
// For Jazzy and Later Support
222+
#if RCLCPP_VERSION_GTE(28, 0, 0)
220223
service_client = node->create_client<T>(service_name, rclcpp::ServicesQoS(),
221224
callback_group);
225+
#else
226+
service_client = node->create_client<T>(service_name, rmw_qos_profile_services_default,
227+
callback_group);
228+
#endif
222229
}
223230

224231
template <class T>

0 commit comments

Comments
 (0)