Skip to content

Commit

Permalink
Using "sensor data" QoS profile with BEST_EFFORT (#67)
Browse files Browse the repository at this point in the history
* Fixing #41 - using sensor data QoS profile with BEST_EFFORT

* Using SubscriptionOptions for QoS overrides

Co-authored-by: Jacob Perron <[email protected]>

* Disable QoS overrides until they will actually work

We need to wait until ROS command-line arguments are properly parsed upstream.

Signed-off-by: Jacob Perron <[email protected]>

Co-authored-by: Jacob Perron <[email protected]>
  • Loading branch information
karl-schulz and jacobperron authored Mar 21, 2022
1 parent 390a399 commit 2046bc3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/rqt_image_view/image_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,18 @@ 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);
auto subscription_options = rclcpp::SubscriptionOptions();
// TODO(jacobperron): Enable once ROS CLI args are supported https://github.com/ros-visualization/rqt/issues/262
// 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 2046bc3

Please sign in to comment.