Skip to content

Commit

Permalink
Using SubscriptionOptions for QoS overrides
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Perron <[email protected]>
  • Loading branch information
karl-schulz and jacobperron committed Mar 21, 2022
1 parent 8f35c4e commit 7aecf68
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rqt_image_view/image_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,15 @@ void ImageView::onTopicChanged(int index)
{
const image_transport::TransportHints hints(node_.get(), transport.toStdString());
try {
subscriber_ = image_transport::create_subscription(node_.get(), topic.toStdString(), std::bind(&ImageView::callbackImage, this, std::placeholders::_1),
hints.getTransport(), rmw_qos_profile_sensor_data);
auto subscription_options = rclcpp::SubscriptionOptions();
subscription_options.qos_overriding_options = rclcpp::QosOverridingOptions::with_default_policies();
subscriber_ = image_transport::create_subscription(
node_.get(),
topic.toStdString(),
std::bind(&ImageView::callbackImage, this, std::placeholders::_1),
hints.getTransport(),
rmw_qos_profile_sensor_data,
subscription_options);
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());
Expand Down

0 comments on commit 7aecf68

Please sign in to comment.