Template Class ServiceServer

Class Documentation

template<class ServiceT, typename NodeT = rclcpp::Node::SharedPtr>
class ServiceServer

A simple wrapper on ROS2 services server.

Public Types

using RequestType = typename ServiceT::Request
using ResponseType = typename ServiceT::Response
using CallbackType = std::function<void(const std::shared_ptr<rmw_request_id_t>, const std::shared_ptr<RequestType>, std::shared_ptr<ResponseType>)>
using SharedPtr = std::shared_ptr<ServiceServer<ServiceT, NodeT>>

Public Functions

inline explicit ServiceServer(const std::string &service_name, const NodeT &node, CallbackType callback, const rclcpp::QoS &qos = rclcpp::ServicesQoS(), rclcpp::CallbackGroup::SharedPtr callback_group = nullptr)

Protected Attributes

std::string service_name_
CallbackType callback_
rclcpp::Service<ServiceT>::SharedPtr server_