ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can use ros::master::check().
#include "ros/ros.h"
#include <iostream>
int main(int argc, char *argv[])
{
ros::init(argc, argv, "master_test");
ros::Time::init();
while (!ros::master::check())
{
std::cout << "waiting..." << std::endl;
ros::Duration(0.5).sleep();
}
std::cout << "master started!" << std::endl;
return 0;
}