Skip to content
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

Fix for Quality of Service (QoS) settings incompatibility between Gazebo plugin and depthimage_to_laserscan package #74

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/DepthImageToLaserScanROS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
namespace depthimage_to_laserscan{

DepthImageToLaserScanROS::DepthImageToLaserScanROS(const rclcpp::NodeOptions & options): rclcpp::Node("depthimage_to_laserscan", options){
auto qos = rclcpp:: SystemDefaultsQoS();
// auto qos = rclcpp:: SystemDefaultsQoS(); // Changed because depth camera publisher does not use RELIABLE (default) QoS but BestEffort
auto qos = rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_default));
qos.reliability(rclcpp::ReliabilityPolicy::BestEffort);


cam_info_sub_ = this->create_subscription<sensor_msgs::msg::CameraInfo>("depth_camera_info", qos,
std::bind(
&DepthImageToLaserScanROS::infoCb, this,
Expand Down Expand Up @@ -96,3 +100,4 @@ void DepthImageToLaserScanROS::depthCb(const sensor_msgs::msg::Image::SharedPtr
} // namespace depthimage_to_laserscan

RCLCPP_COMPONENTS_REGISTER_NODE(depthimage_to_laserscan::DepthImageToLaserScanROS)