ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A

ROS 2 Graph

Where can I find the imlementation of the Graph API in ros 2 ? Is it in the DDS layers or rclcpp layers ?

We have some ROS graph information available through our C++ and Python API’s:

1 Like

Thanks for the link. I have some doubt about this Graph API. Does it maintain any kind of Graph Data strucutre which stores all the ros 2 nodes created in the memory ? Can I obtain information regarding nodes created using these ?

You can get the names of the nodes on the system with this method:

That is part of our generic C api, unfortunately we don’t have that exposed in our C++ API yet, but we will in the future.

As for an “object-oriented” data structure with nodes and all of their properties, we don’t have that yet either, though there’s nothing preventing us from doing that. We haven’t exchanged a lot of information about nodes yet, other than what we can collect from DDS already, because we’ve still got some design work to do on ensuring node name uniqueness and that will impact how we communicate other details about nodes across the graph.