Skip to content

Commit

Permalink
Fix an issue on filtering topic when prepare publishers
Browse files Browse the repository at this point in the history
Co-authored-by: Barry Xu <barry.xu@sony.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
  • Loading branch information
MichaelOrlov and Barry-Xu-2018 committed Apr 10, 2024
1 parent a623a23 commit 091620c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions rosbag2_transport/src/rosbag2_transport/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,8 @@ void PlayerImpl::prepare_publishers()
auto topics = reader_->get_all_topics_and_types();
std::string topic_without_support_acked;
for (const auto & topic : topics) {
if (play_options_.publish_service_requests &&
rosbag2_cpp::is_service_event_topic(topic.name, topic.type))
{
const bool is_service_event_topic = rosbag2_cpp::is_service_event_topic(topic.name, topic.type);
if (play_options_.publish_service_requests && is_service_event_topic) {
// Check if sender was created
if (service_clients_.find(topic.name) != service_clients_.end()) {
continue;
Expand Down Expand Up @@ -1122,14 +1121,7 @@ void PlayerImpl::prepare_publishers()
}

// filter topics to add publishers if necessary
if (!allow_topic(false, topic.name, storage_filter)) {
continue;
}

// if not set publish_service_requests, filter service event topic
if (rosbag2_cpp::is_service_event_topic(topic.name, topic.type) &&
!allow_topic(true, topic.name, storage_filter))
{
if (!allow_topic(is_service_event_topic, topic.name, storage_filter)) {
continue;
}

Expand Down

0 comments on commit 091620c

Please sign in to comment.