Template Function rclcpp::create_service(std::shared_ptr<node_interfaces::NodeBaseInterface>, std::shared_ptr<node_interfaces::NodeServicesInterface>, const std::string&, CallbackT&&, const rclcpp::QoS&, rclcpp::CallbackGroup::SharedPtr)
Defined in File create_service.hpp
Function Documentation
-
template<typename ServiceT, typename CallbackT>
rclcpp::Service<ServiceT>::SharedPtr rclcpp::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 rclcpp::QoS &qos, rclcpp::CallbackGroup::SharedPtr group) Create a service with a given type.
- Parameters:
node_base – [in] NodeBaseInterface implementation of the node on which to create the service.
node_services – [in] NodeServicesInterface implementation of the node on which to create the service.
service_name – [in] The name on which the service is accessible.
callback – [in] The callback to call when the service gets a request.
qos – [in] Quality of service profile for the service.
group – [in] Callback group to handle the reply to service calls.
- Returns:
Shared pointer to the created service.