Skip to content

Commit

Permalink
Fix comments for pull request ros2#93
Browse files Browse the repository at this point in the history
Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
  • Loading branch information
Sriram Raghunathan committed Mar 26, 2019
1 parent fa36638 commit 0711fb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion rosbag2/include/rosbag2/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class ROSBAG2_PUBLIC Writer
* \param topic_with_type name and type identifier of topic to be created
* \throws runtime_error if the Writer is not open.
*/

virtual void remove_topic(const TopicMetadata & topic_with_type);

/**
Expand Down
8 changes: 2 additions & 6 deletions rosbag2_transport/src/rosbag2_transport/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,18 @@ void Recorder::subscribe_topics(

void Recorder::subscribe_topic(const rosbag2::TopicMetadata & topic)
{
if(writer_) {
writer_->create_topic(topic);
subscribed_topics_.insert(topic.name);
}

auto subscription = create_subscription(topic.name, topic.type);

if (subscription) {
writer_->create_topic(topic);
subscribed_topics_.insert(topic.name);
subscriptions_.push_back(subscription);
ROSBAG2_TRANSPORT_LOG_INFO_STREAM("Subscribed to topic '" << topic.name << "'");
}
else {
writer_->remove_topic(topic);
subscribed_topics_.erase(topic.name);
}

}

std::shared_ptr<GenericSubscription>
Expand Down

0 comments on commit 0711fb5

Please sign in to comment.