in ctrl_pkg/src/ctrl_node.cpp [201:212]
void waitForServices(){
videoClientCbGrp_ = this->create_callback_group(rclcpp::CallbackGroupType::Reentrant);
videoClient_ = this->create_client<deepracer_interfaces_pkg::srv::VideoStateSrv>("/camera_pkg/media_state",
rmw_qos_profile_services_default,
videoClientCbGrp_);
while (!videoClient_->wait_for_service(std::chrono::seconds(1))) {
if (!rclcpp::ok()) {
RCLCPP_ERROR(this->get_logger(), "Camera node failed");
}
RCLCPP_INFO(this->get_logger(), "Camera node not available, waiting again...");
}
}