From 9b15dc804aef3252aaae9fa88637df844adc5ec0 Mon Sep 17 00:00:00 2001 From: Karl Schulz Date: Tue, 8 Mar 2022 20:43:14 +0100 Subject: [PATCH] Fixing #41 - using sensor data QoS profile with BEST_EFFORT --- src/rqt_image_view/image_view.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rqt_image_view/image_view.cpp b/src/rqt_image_view/image_view.cpp index 9eaf21a..6185c03 100644 --- a/src/rqt_image_view/image_view.cpp +++ b/src/rqt_image_view/image_view.cpp @@ -313,10 +313,10 @@ void ImageView::onTopicChanged(int index) if (!topic.isEmpty()) { - image_transport::ImageTransport it(node_); const image_transport::TransportHints hints(node_.get(), transport.toStdString()); try { - subscriber_ = it.subscribe(topic.toStdString(), 1, &ImageView::callbackImage, this, &hints); + subscriber_ = image_transport::create_subscription(node_.get(), topic.toStdString(), std::bind(&ImageView::callbackImage, this, std::placeholders::_1), + hints.getTransport(), rmw_qos_profile_sensor_data); qDebug("ImageView::onTopicChanged() to topic '%s' with transport '%s'", topic.toStdString().c_str(), subscriber_.getTransport().c_str()); } catch (image_transport::TransportLoadException& e) { QMessageBox::warning(widget_, tr("Loading image transport plugin failed"), e.what());