ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
7

Check if roscore is started in C++

asked 2012-06-18 07:33:29 -0600

Dave Coleman gravatar image

Hi, what is the best way for a C++ application to check if roscore has already been started? I think I would like to avoid doing a system() call. Catching exceptions is also an undesirable feature for me because I am working on a Qt application. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
6

answered 2012-06-18 08:18:10 -0600

Lorenz gravatar image

updated 2012-06-18 08:19:41 -0600

There is the roscpp API function ros::master::check(). Note that you have to call ros::init before. ros::init won't block, instantiating a ros::NodeHandle will block and wait for the core though.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-06-18 07:33:29 -0600

Seen: 2,725 times

Last updated: Jun 18 '12