Template Class Service

Inheritance Relationships

Base Types

  • public rclcpp::ServiceBase (Class ServiceBase)

  • public std::enable_shared_from_this< Service< ServiceT > >

Class Documentation

template<typename ServiceT>
class Service : public rclcpp::ServiceBase, public std::enable_shared_from_this<Service<ServiceT>>

Public Types

using CallbackType = std::function<void(const std::shared_ptr<typename ServiceT::Request>, std::shared_ptr<typename ServiceT::Response>)>

Public Functions

inline Service(std::shared_ptr<rcl_node_t> node_handle, const std::string &service_name, AnyServiceCallback<ServiceT> callback, rcl_service_options_t &service_options)
inline void post_init_setup()

Called after construction to continue setup that requires shared_from_this().

inline std::shared_ptr<void> create_request() override
inline std::shared_ptr<rmw_request_id_t> create_request_header() override
inline void handle_request(const std::shared_ptr<rmw_request_id_t> &request_header, const std::shared_ptr<void> &request) override
inline std::shared_ptr<typename ServiceT::Response> handle_request(std::shared_ptr<rmw_request_id_t> request_header, std::shared_ptr<typename ServiceT::Request> typed_request)