Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[humble] Reduce message spam when topics to be recorded do not exist #1434

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rosbag2_transport/include/rosbag2_transport/recorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

#include "rosbag2_transport/record_options.hpp"
#include "rosbag2_transport/visibility_control.hpp"
#include "rosbag2_transport/topic_filter.hpp"

namespace rosbag2_cpp
{
Expand Down Expand Up @@ -156,6 +157,7 @@ class Recorder : public rclcpp::Node

void warn_if_new_qos_for_subscribed_topic(const std::string & topic_name);

std::unique_ptr<TopicFilter> topic_filter_;
std::future<void> discovery_future_;
std::unordered_map<std::string, std::shared_ptr<rclcpp::GenericSubscription>> subscriptions_;
std::unordered_set<std::string> topics_warned_about_incompatibility_;
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "rosbag2_transport/reader_writer_factory.hpp"

#include "logging.hpp"
#include "topic_filter.hpp"
#include "rosbag2_transport/topic_filter.hpp"

namespace
{
Expand Down
6 changes: 3 additions & 3 deletions rosbag2_transport/src/rosbag2_transport/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "rosbag2_storage/yaml.hpp"
#include "rosbag2_transport/qos.hpp"

#include "topic_filter.hpp"
#include "rosbag2_transport/topic_filter.hpp"

namespace rosbag2_transport
{
Expand Down Expand Up @@ -100,6 +100,7 @@ Recorder::Recorder(
[this](KeyboardHandler::KeyCode /*key_code*/,
KeyboardHandler::KeyModifiers /*key_modifiers*/) {this->toggle_paused();},
Recorder::kPauseResumeToggleKey);
topic_filter_ = std::make_unique<TopicFilter>(record_options, this->get_node_graph_interface());
// show instructions
RCLCPP_INFO_STREAM(
get_logger(),
Expand Down Expand Up @@ -313,8 +314,7 @@ std::unordered_map<std::string, std::string>
Recorder::get_requested_or_available_topics()
{
auto all_topics_and_types = this->get_topic_names_and_types();
TopicFilter topic_filter{record_options_, this->get_node_graph_interface()};
return topic_filter.filter_topics(all_topics_and_types);
return topic_filter_->filter_topics(all_topics_and_types);
}

std::unordered_map<std::string, std::string>
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/src/rosbag2_transport/topic_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "rosbag2_cpp/typesupport_helpers.hpp"

#include "logging.hpp"
#include "topic_filter.hpp"
#include "rosbag2_transport/topic_filter.hpp"

namespace
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <unordered_set>
#include <vector>

#include "./topic_filter.hpp"
#include "rosbag2_transport/topic_filter.hpp"

using namespace ::testing; // NOLINT

Expand Down