15 ServiceClient(
const rclcpp::NodeOptions& options,
const std::string& service) : rclcpp::Node(
"client_node", options) {
16 this->client_ = this->create_client<SrvT>(service);
17 if (!this->client_->wait_for_service(1s)) {
18 throw std::runtime_error(
"Service not available");
22 typename rclcpp::Client<SrvT>::FutureAndRequestId call_async(
const std::shared_ptr<typename SrvT::Request>& request) {
23 return this->client_->async_send_request(request);
26 std::shared_ptr<rclcpp::Client<SrvT>> client_;