Disparity between `rospy.get_published_topics()` and `rostopic list`

asked 2018-03-12 11:45:14 -0500

Cerin gravatar image

updated 2018-03-12 11:47:55 -0500

I'm trying to write some helper functions to supplement rospy's clunky subscribe/publish methods, and I'm trying to validate if the given topic matches a known topic.

So I'm trying to check the topic against the output from rospy.get_published_topics(). However, I'm finding that this often returns a little less than rostopic list. Why is this? What would cause rospy to not see the same topics as rostopic? It seems to exclude all topics that use the std_msg/Empty type. Why would this be?

edit retag flag offensive close merge delete

Comments

From the code API documentation of rospy : "Retrieve list of topics that the master is reporting as being published" could mean that the topic have to be published on to be detected by the function...

Delb gravatar image Delb  ( 2018-03-13 09:30:11 -0500 )edit

... have you tried rostopic echo on the topics found with rostopic list but not by rospy.get_published_topics() ?

Delb gravatar image Delb  ( 2018-03-13 09:30:54 -0500 )edit