Ask Your Question
7

Check if roscore is started in C++

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

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 -0500

Lorenz gravatar image

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 1,719 times

Last updated: Jun 18 '12