Ask Your Question

Using Rosnode's API c++

asked 2015-05-05 08:07:21 -0500

bulgrozer gravatar image


I work with ROS since two months and I would like to use rosnode's API.

In fact, i'm trying to create a Node that get and store the name of initiailized nodes and ping all of them.

In ordre to do that, I want to use API from rosnode as get_node_names and rosnode_ping.

So is that possible to use those API in a c++ script ? because i've tried lots of methods but none of them worked. Do I need to include a header ?

Thank you in advance for your answer

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-05-05 10:54:57 -0500

Wolf gravatar image

For get_nodes_name yu can use ros::master::getNodes. But there is no full C++ API for rosnode as it is written in python. E. g. the src of rosnode ping can be found here:

But if you have to use C++ for your node it's still no problem because all rosnode methods in the end just perform plain vanilla xml_rpc calls to the Master or the node slaves. E. g. rosnode ping just performs the xml_rpc call get_pid . The ros Master and slave xml_rpc APIs are documented here:

xml_rpc is available in C++, too. As an example for its usage see e. g. the the implementation of ros::master::getNodes:

edit flag offensive delete link more


Sorry for answering this late and thank you a lot, I'll try to do that.

bulgrozer gravatar imagebulgrozer ( 2015-05-07 04:14:30 -0500 )edit

Your Answer


Add Answer

Question Tools


Asked: 2015-05-05 08:07:21 -0500

Seen: 1,604 times

Last updated: May 05 '15