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

Revision history [back]

click to hide/show revision 1
initial version

As you describe it 1. and 2. are two different things.

  1. uses ROS to (continuously) transfer information between nodes.
  2. uses a getter, which means that B will need to have an instance of A from somewhere (i.e. they can't be in different nodes). The ROS equivalent of this will be to use a service call that B can use to get specific information from A.

Which one you need depends on the use case. If it is a lot of data and you only need part of the data in specific situations a service seems good.