Ask Your Question
3

check if topic is being published to without subscribing

asked 2019-01-29 11:12:20 -0500

bearot gravatar image

updated 2019-01-30 08:54:15 -0500

gvdhoorn gravatar image

In our project we want to write a node to check sensor nodes for possible errors. One of the checked criterion is, if the topics of the node are actually published and not just have publisher.

Is it possible to check for published messages or publishing frequency without actually subscribing? The reason behind it is, that some sensors like cameras publishes large amount of data, which slow down the checknode.

Not suitable solutions:

  • "rospy.get_published_topics" does not check, if the publisher is publishing at all.
  • rostopic hz subscribes the topic
  • time saving solutions require subscription at some point

Thank you.


Edit/Solution:

I'm not sure (hence a comment), but there is a chance you could do this using topic statistics.

by gvdhoorn

This is our solution. Thanks.

edit retag flag offensive close merge delete

Comments

It is correct that there are already subscribers to the topics. We want to check on a running system.

Thank you for your answer gvdhoorn. It is definitly new to us and what we searched for. I will post it as answer and mark it as correct.

bearot gravatar image bearot  ( 2019-01-30 06:44:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2019-01-29 11:21:36 -0500

gvdhoorn gravatar image

I'm not sure (hence a comment), but there is a chance you could do this using topic statistics.

edit flag offensive delete link more

Comments

topic statistics are still per-connection, so if there are no subscribers, there will not be any statistics.

ahendrix gravatar image ahendrix  ( 2019-01-29 12:02:17 -0500 )edit

If there are no subscribers, it doesn't make sense to want to check for "publishing frequency" anyway :)

I assumed (perhaps wrongly) that the OP had subscribers, but didn't want to add more just to check node liveness.

gvdhoorn gravatar image gvdhoorn  ( 2019-01-30 08:55:08 -0500 )edit
2

answered 2019-01-29 12:06:10 -0500

ahendrix gravatar image

All of the software that I've worked on does sensor health reporting with the diagnostic_updater library. It includes built-in functions to measuring and reporting the topic publish frequency, and reporting diagnostic errors if the publish frequency is too high or too low. It also provides a framework for reporting any other problems you might want to detect.

The only downside is that you must modify your nodes to use it; but generally the modifications are quite easy. Many of the mature ROS camera and laser drivers already incorporate diagnostics like this.

edit flag offensive delete link more

Comments

Thank you for your answer, but it does not work out for us. Not every sensor node is written by us and some are missing diagnostic_updater, but it may be a solution for others.

bearot gravatar image bearot  ( 2019-01-30 06:51:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-01-29 11:12:20 -0500

Seen: 1,732 times

Last updated: Jan 30 '19