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

Using Rosnode's API c++

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

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

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 image bulgrozer  ( 2015-05-07 04:14:30 -0600 )edit

Question Tools


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

Seen: 3,021 times

Last updated: May 05 '15