15 #ifndef RCLCPP__CREATE_SERVICE_HPP_ 16 #define RCLCPP__CREATE_SERVICE_HPP_ 32 template<
typename ServiceT,
typename CallbackT>
38 CallbackT && callback,
40 rclcpp::callback_group::CallbackGroup::SharedPtr group)
43 any_service_callback.
set(std::forward<CallbackT>(callback));
46 service_options.
qos = qos_profile;
49 node_base->get_shared_rcl_node_handle(),
50 service_name, any_service_callback, service_options);
52 node_services->add_service(serv_base_ptr, group);
58 #endif // RCLCPP__CREATE_SERVICE_HPP_
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
Definition: service.hpp:89
void set(CallbackT callback)
Definition: any_service_callback.hpp:66
T dynamic_pointer_cast(T... args)
Definition: service.hpp:41
rcl_service_options_t rcl_service_get_default_options(void)
rclcpp::Service< ServiceT >::SharedPtr create_service(std::shared_ptr< node_interfaces::NodeBaseInterface > node_base, std::shared_ptr< node_interfaces::NodeServicesInterface > node_services, const std::string &service_name, CallbackT &&callback, const rmw_qos_profile_t &qos_profile, rclcpp::callback_group::CallbackGroup::SharedPtr group)
Definition: create_service.hpp:34
Definition: any_service_callback.hpp:32