Sometimes a service cannot be found if computer is not connected to the internet

asked 2020-12-03 20:24:17 -0600

erinliu gravatar image

HI: I came across a random problem. If my computer is not connected to the internet, a client send request to a service , the service cannot be found in the network.But at the same time ,publishers and subscribers work well. Once I connect the computer to Internet, the service will turn to normal. Does anyone have any ideas?

    RCLCPP_WARN(nh_->get_logger(), "Interrupted while waiting for the  service. Exiting.");
    RCLCPP_WARN(nh_->get_logger(), "Can not find  service in the network in 1 second");
 auto result = client->async_send_request(request);
// Wait for the result.
if (rclcpp::spin_until_future_complete(node, result,std::chrono::seconds(1)) == 
} else {
      RCLCPP_WARN(nh_->get_logger(), "Failed to get response of  service in 1 second");
edit retag flag offensive close merge delete