Robotics StackExchange | Archived questions

Is it more "rossy" to publish to one topic and later distinguish msgs?

Hi!

I guess I have a quite general question. Imagine the following: You have a list of sensors that all publish some sort of status message. What is the more "rossy" way of publishing and subscribing to this status message?

  1. All the sensors publish to the same topic and a potential subscriber later filters for its messages of interest?
  2. Each sensor publishes to an individual topic and a later subscriber will actually have one subscriber for each sensor of interest?

What do you consider "better" and why? Thanks!

Asked by JayDe on 2018-07-09 03:33:16 UTC

Comments

Answers

When talking about a "status message" in terms of "sensors", I would actually use approach 1, name the topic /diagnostics and use a diagnostic_aggregator to do the separation.

For exactly this use-case the diagnostics system has been designed:

The diagnostics system is designed to collect information from hardware drivers and robot hardware to users and operators for analysis, troubleshooting, and logging. The diagnostics stack contains tools for collecting, publishing, analyzing and viewing diagnostics data.

The diagnostics toolchain is built around the /diagnostics topic. On this topic, hardware drivers and devices publish diagnostic_msgs/DiagnosticArray messages with the device names, status and specific data points.

The diagnostic_updater and self_test packages allow nodes to collect and publish diagnostics data. The diagnostic_aggregator can categorize and analyze diagnostics at runtime. Operators and developers can view the diagnostics data using the rqt_robot_monitor package. The diagnostic_analysis package can convert diagnostics logs to CSV files for examination and after-the-fact analysis.

Asked by mgruhler on 2018-07-09 04:43:15 UTC

Comments

What is a good package to reference for how to do this?

Asked by shoemakerlevy9 on 2018-07-19 00:21:11 UTC

Click on Used By on the right side of the page of any package on the ROS wiki, e.g. http://wiki.ros.org/diagnostic_updater?distro=kinetic to see which other (released) packages use this. Maybe have a look at the urg_node.

Asked by mgruhler on 2018-07-19 01:26:02 UTC

ROS logging uses approach 1. All log messages are passed to /rosout.

The first approach is simple to implement as well. You just need a single subscriber topic and each node has to publish to one topic making the debugging easy as well if there is an issue.

Approach 2 may take up more bandwidth. Each new topic will take up a certain amount of bandwidth which may not be ideal if you are also passing bandwidth heavy information such as pointclouds/images.

Asked by ashwath1993 on 2018-07-09 08:17:43 UTC

Comments