Skip to content

Commit

Permalink
ros2GH-27 Stop topic polling if subscription setup is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Idel-SI committed Nov 26, 2018
1 parent 1751302 commit 525d0ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rosbag2_transport/src/rosbag2_transport/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ std::future<void> Recorder::launch_topics_discovery(
node_->get_all_topics_with_types() :
node_->get_topics_with_types(topics);

if (!topics.empty() && subscriptions_.size() == topics.size()) {
return;
}

for (const auto & topic_with_type : all_topics_and_types) {
std::string topic_name = topic_with_type.first;
bool already_subscribed = std::find(
Expand Down

0 comments on commit 525d0ac

Please sign in to comment.