Skip to content

Commit

Permalink
ros2_parsers/generic_subscription.hpp -> rclcpp/generic_subscription (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
doisyg authored Jun 20, 2021
1 parent 96fe7bc commit fc0f399
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 166 deletions.
10 changes: 6 additions & 4 deletions plugins/DataStreamROS2/datastream_ros2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <QMessageBox>
#include <QApplication>
#include <QProgressDialog>
#include "ros2_parsers/generic_subscription.hpp"
#include "rclcpp/generic_subscription.hpp"

DataStreamROS2::DataStreamROS2() :
DataStreamer(),
Expand Down Expand Up @@ -198,9 +198,11 @@ void DataStreamROS2::subscribeToTopic(const std::string& topic_name, const std::
// double subscription, latching or not
for (bool transient : { true, false })
{
auto subscription = std::make_shared<rosbag2_transport::GenericSubscription>(_node->get_node_base_interface().get(),
*_parser->typeSupport(topic_name),
topic_name, transient, bound_callback);
auto subscription = _node->create_generic_subscription(topic_name,
topic_type,
transient,
bound_callback);

_subscriptions[topic_name + (transient ? "/transient_" : "")] = subscription;
_node->get_node_topics_interface()->add_subscription(subscription, nullptr);
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/DataStreamROS2/datastream_ros2.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "dialog_select_ros_topics.h"
#include "ros2_parsers/ros2_parser.h"
#include "ros2_parsers/generic_subscription.hpp"
#include "rclcpp/generic_subscription.hpp"

class DataStreamROS2 : public PJ::DataStreamer
{
Expand Down Expand Up @@ -64,7 +64,7 @@ class DataStreamROS2 : public PJ::DataStreamer

void loadDefaultSettings();

std::unordered_map<std::string, rosbag2_transport::GenericSubscription::Ptr> _subscriptions;
std::unordered_map<std::string, rclcpp::GenericSubscription::SharedPtr> _subscriptions;

void subscribeToTopic(const std::string& topic_name, const std::string& topic_type);
void waitOneSecond();
Expand Down
160 changes: 0 additions & 160 deletions plugins/ros2_parsers/generic_subscription.hpp

This file was deleted.

0 comments on commit fc0f399

Please sign in to comment.