deepracer_follow_the_leader_ws/ctrl_pkg/src/ctrl_state.cpp
void waitForService(rclcpp::ClientBase::SharedPtr client,
                        std::shared_ptr<rclcpp::Node> ctrlNode) {
        while (!client->wait_for_service(std::chrono::seconds(1))) {
            if (!rclcpp::ok()) {
                RCLCPP_ERROR(ctrlNode->get_logger(), "%s node failed", client->get_service_name());
            }
            RCLCPP_INFO(ctrlNode->get_logger(), "%s not available, waiting again...", client->get_service_name());
        }
    }
/// Helper method to wait for the service which the client subscribes to.
/// @param client Reference to a service client.
/// @param ctrlNode Reference to the CtrlNode object.
Helper method to wait for the service which the client subscribes to.
Helper method to wait for the service which the client subscribes to .
void waitForService(rclcpp::ClientBase::SharedPtr client,
                        std::shared_ptr<rclcpp::Node> ctrlNode) {
        while (!client->wait_for_service(std::chrono::seconds(1))) {
            if (!rclcpp::ok()) {
                RCLCPP_ERROR(ctrlNode->get_logger(), "%s node failed", client->get_service_name());
            }
            RCLCPP_INFO(ctrlNode->get_logger(), "%s not available, waiting again...", client->get_service_name());
        }
    }
void waitForService ( rclcpp :: ClientBase :: SharedPtr client , std :: shared_ptr < rclcpp :: Node > ctrlNode ) { while ( ! client -> wait_for_service ( std :: chrono :: seconds ( 1 ) ) ) { if ( ! rclcpp :: ok ( ) ) { RCLCPP_ERROR ( ctrlNode -> get_logger ( ) , " " , client -> get_service_name ( ) ) ; } RCLCPP_INFO ( ctrlNode -> get_logger ( ) , " " , client -> get_service_name ( ) ) ; } }
Helper method to wait for the service which the client subscribes to.
Helper method to wait for the service which the client subscribes to .