Disparity between `rospy.get_published_topics()` and `rostopic list`
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?
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...
... have you tried
rostopic echo
on the topics found with rostopic list but not byrospy.get_published_topics()
?