Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

https://github.com/ros/ros_comm/blob/indigo-devel/tools/rosnode/src/rosnode/__init__.py#L295

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:

http://wiki.ros.org/ROS/Master_Slave_APIs

http://wiki.ros.org/ROS/Master_API

http://wiki.ros.org/ROS/Slave_API

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

https://github.com/ros/ros_comm/blob/indigo-devel/clients/roscpp/src/libros/master.cpp#L146