Robotics StackExchange | Archived questions

How does roscore register the subscriber and publisher when registering a node?

In order for a node to run in ros, you need to register its information in roscore. The node then sends its information to the roscore and when it is registered it runs. When registering a node in this process, how does roscore register whether it is publisher or subscriber? Thank you :)

Asked by simphony on 2018-12-10 23:28:47 UTC

Comments

Answers

This document describes the basics of how a ROS node registers itself with the ROS master: http://wiki.ros.org/ROS/Technical%20Overview

In short, it makes one XMLRPC call (an API call, similar to REST) to the ROS master to inform it that it exists, and more XMLRPC calls to inform that ROS master that it has publishers and/or subscribers. A node can have one or more than one publisher, subscriber, or both publishers and subscribers!

Asked by ahendrix on 2018-12-11 00:08:04 UTC

Comments

Thank you for your feedback! I have seen this part before. When registering node information in roscore, it is known that it is divided into publisher and subscriber. I am wondering what criteria roscore have registered in roscore for subscribers and publishers!

Asked by simphony on 2018-12-11 00:19:14 UTC

There are no "criteria": the XMLRPC call for publishers and subscribers is different, similar to how you'd call a different function with different arguments.

Asked by gvdhoorn on 2018-12-11 02:08:22 UTC

I'm not really sure what additional information you're asking for. This is the code that implements publisher and subscriber registration in the ROS master: https://github.com/ros/ros_comm/blob/669fbd32d2f92cc295f4b024fcb2f982fddec0f0/tools/rosmaster/src/rosmaster/master_api.py#L672-L791

Asked by ahendrix on 2018-12-11 13:21:12 UTC