-
Notifications
You must be signed in to change notification settings - Fork 766
[depth_image_proc] using sensor data qos profile everywhere #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: humble
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ CropForemostNode::CropForemostNode(const rclcpp::NodeOptions & options) | |
| std::lock_guard<std::mutex> lock(connect_mutex_); | ||
| // TODO(ros2) Implement when SubscriberStatusCallback is available | ||
| // pub_depth_ = it_->advertise("image", 1, connect_cb, connect_cb); | ||
| pub_depth_ = image_transport::create_publisher(this, "image"); | ||
| pub_depth_ = image_transport::create_publisher(this, "image", rmw_qos_profile_sensor_data); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also revert |
||
| } | ||
|
|
||
| // Handles (un)subscribing when clients (un)subscribe | ||
|
|
@@ -97,7 +97,8 @@ void CropForemostNode::connectCb() | |
| sub_raw_ = image_transport::create_subscription( | ||
| this, "image_raw", | ||
| std::bind(&CropForemostNode::depthCb, this, std::placeholders::_1), | ||
| hints.getTransport()); | ||
| hints.getTransport(), | ||
| rmw_qos_profile_sensor_data); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,7 +132,9 @@ RegisterNode::RegisterNode(const rclcpp::NodeOptions & options) | |
| // pub_registered_ = it_depth_reg.advertiseCamera("image_rect", 1, | ||
| // image_connect_cb, image_connect_cb, | ||
| // info_connect_cb, info_connect_cb); | ||
| pub_registered_ = image_transport::create_camera_publisher(this, "depth_registered/image_rect"); | ||
| pub_registered_ = image_transport::create_camera_publisher( | ||
| this, "depth_registered/image_rect", | ||
| rmw_qos_profile_sensor_data); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert |
||
| } | ||
|
|
||
| // Handles (un)subscribing when clients (un)subscribe | ||
|
|
@@ -147,9 +149,11 @@ void RegisterNode::connectCb() | |
| sub_rgb_info_.unsubscribe(); | ||
| } else if (!sub_depth_image_.getSubscriber()) { | ||
| image_transport::TransportHints hints(this, "raw"); | ||
| sub_depth_image_.subscribe(this, "depth/image_rect", hints.getTransport()); | ||
| sub_depth_info_.subscribe(this, "depth/camera_info"); | ||
| sub_rgb_info_.subscribe(this, "rgb/camera_info"); | ||
| sub_depth_image_.subscribe( | ||
| this, "depth/image_rect", | ||
| hints.getTransport(), rmw_qos_profile_sensor_data); | ||
| sub_depth_info_.subscribe(this, "depth/camera_info", rmw_qos_profile_sensor_data); | ||
| sub_rgb_info_.subscribe(this, "rgb/camera_info", rmw_qos_profile_sensor_data); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -192,6 +196,7 @@ void RegisterNode::imageCb( | |
| registered_msg->width = resolution.width; | ||
| // step and data set in convert(), depend on depth data type | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can revert this extra newline |
||
| if (depth_image_msg->encoding == sensor_msgs::image_encodings::TYPE_16UC1) { | ||
| convert<uint16_t>(depth_image_msg, registered_msg, depth_to_rgb); | ||
| } else if (depth_image_msg->encoding == sensor_msgs::image_encodings::TYPE_32FC1) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be reverted - the strategy throughout image_pipeline is supposed to be:
This follows REP-2003 and deals with the fact that a DefaultQOS publisher will publish best effort when a SensorQOS subscribes to it - but is entirely incompatible with a DefaultQOS subscriber.