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

An alternative way of doing this without having to look at the graph is to use

    from rosgraph.masterapi import Master
    master = Master("/bag_helper")
    all_topics = sorted([topic_tuple[0] for topic_tuple in master.getTopicTypes()])
    published_topics = [topic_tuple[0] for topic_tuple in master.getPublishedTopics("/")]
    subscribed_topics = list(set(all_topics) - set(published_topics))

An alternative way of doing this without having to look at the graph is to use

    from rosgraph.masterapi import Master
    master = Master("/bag_helper")
    all_topics = sorted([topic_tuple[0] [topic_tuple[0] for topic_tuple in master.getTopicTypes()])
master.getTopicTypes()]
    published_topics = [topic_tuple[0] for topic_tuple in master.getPublishedTopics("/")]
    subscribed_topics = list(set(all_topics) - set(published_topics))

An alternative way of doing this without having to look at the graph is to use

    from rosgraph.masterapi import Master
    master = Master("/bag_helper")
Master("/my_node")
    all_topics = [topic_tuple[0] for topic_tuple in master.getTopicTypes()]
    published_topics = [topic_tuple[0] for topic_tuple in master.getPublishedTopics("/")]
    subscribed_topics = list(set(all_topics) - set(published_topics))

An alternative way of doing this without having to look at the graph is to use

    #!/usr/bin/env python
    from rosgraph.masterapi import Master
    master = Master("/my_node")
    all_topics = [topic_tuple[0] for topic_tuple in master.getTopicTypes()]
    published_topics = [topic_tuple[0] for topic_tuple in master.getPublishedTopics("/")]
    subscribed_topics = list(set(all_topics) - set(published_topics))

An alternative way of doing this without having to look at the graph is to use

    #!/usr/bin/env python
    from rosgraph.masterapi import Master
    master = Master("/my_node")
    all_topics = [topic_tuple[0] for topic_tuple in master.getTopicTypes()]
    published_topics = [topic_tuple[0] for topic_tuple in master.getPublishedTopics("/")]
    subscribed_topics = list(set(all_topics) - set(published_topics))