Skip to content

Commit

Permalink
Reintroduce Don't warn for unknown types if topics are not selected
Browse files Browse the repository at this point in the history
Reintroduce the fix from 51a83f4 which
was discussed in #1485. This gives
a massive CPU improvement.
  • Loading branch information
Rayman committed Sep 27, 2024
1 parent 6e82f52 commit d141e90
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions rosbag2_transport/src/rosbag2_transport/topic_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ bool TopicFilter::take_topic(
const std::string & topic_type = topic_types[0];
bool is_service_event_topic = rosbag2_cpp::is_service_event_topic(topic_name, topic_type);

if (!record_options_.include_unpublished_topics && node_graph_ &&
topic_is_unpublished(topic_name, *node_graph_))
{
return false;
}

if (record_options_.ignore_leaf_topics && node_graph_ &&
is_leaf_topic(topic_name, *node_graph_))
{
return false;
}

if (!is_service_event_topic) {
if (!record_options_.all_topics &&
Expand Down Expand Up @@ -235,6 +224,18 @@ bool TopicFilter::take_topic(
return false;
}

if (!record_options_.include_unpublished_topics && node_graph_ &&
topic_is_unpublished(topic_name, *node_graph_))
{
return false;
}

if (record_options_.ignore_leaf_topics && node_graph_ &&
is_leaf_topic(topic_name, *node_graph_))
{
return false;
}

return true;
}

Expand Down

0 comments on commit d141e90

Please sign in to comment.