From e6ddca159ce8959ed833548664a06b8484401041 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 15 Jan 2020 11:21:07 -0800 Subject: [PATCH 1/2] Image publishers use SensorDataQoSProfile (#1031) All other sensor publishers were updated previously to use the same profile (#926). I'm not sure if the image publishers were overlooked or the image_transport API didn't support setting the QoS profile at the time. Signed-off-by: Jacob Perron --- gazebo_plugins/src/gazebo_ros_camera.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gazebo_plugins/src/gazebo_ros_camera.cpp b/gazebo_plugins/src/gazebo_ros_camera.cpp index ba5fd4b51..6d86121c0 100644 --- a/gazebo_plugins/src/gazebo_ros_camera.cpp +++ b/gazebo_plugins/src/gazebo_ros_camera.cpp @@ -182,7 +182,7 @@ void GazeboRosCamera::Load(gazebo::sensors::SensorPtr _sensor, sdf::ElementPtr _ image_transport::create_publisher( impl_->ros_node_.get(), camera_topic, - qos.get_publisher_qos(camera_topic).get_rmw_qos_profile())); + qos.get_publisher_qos(camera_topic, rclcpp::SensorDataQos()).get_rmw_qos_profile())); // TODO(louise) Uncomment this once image_transport::Publisher has a function to return the // full topic. @@ -208,7 +208,8 @@ void GazeboRosCamera::Load(gazebo::sensors::SensorPtr _sensor, sdf::ElementPtr _ impl_->image_pub_.push_back( image_transport::create_publisher( impl_->ros_node_.get(), - camera_topic, qos.get_publisher_qos(camera_topic).get_rmw_qos_profile())); + camera_topic, + qos.get_publisher_qos(camera_topic, rclcpp::SensorDataQoS()).get_rmw_qos_profile())); // RCLCPP_INFO( // impl_->ros_node_->get_logger(), "Publishing %s camera images to [%s]", @@ -235,7 +236,7 @@ void GazeboRosCamera::Load(gazebo::sensors::SensorPtr _sensor, sdf::ElementPtr _ impl_->depth_image_pub_ = image_transport::create_publisher( impl_->ros_node_.get(), depth_topic, - qos.get_publisher_qos(depth_topic).get_rmw_qos_profile()); + qos.get_publisher_qos(depth_topic, rclcpp::SensorDataQoS()).get_rmw_qos_profile()); // RCLCPP_INFO(impl_->ros_node_->get_logger(), "Publishing depth images to [%s]", // impl_->depth_image_pub_.getTopic().c_str()); From ea7a809b94e282d9221fafb3bb1addeec3e65720 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Fri, 12 Jun 2020 10:42:40 -0700 Subject: [PATCH 2/2] Fix typo from rebase Signed-off-by: Jacob Perron --- gazebo_plugins/src/gazebo_ros_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gazebo_plugins/src/gazebo_ros_camera.cpp b/gazebo_plugins/src/gazebo_ros_camera.cpp index 6d86121c0..b45034ee7 100644 --- a/gazebo_plugins/src/gazebo_ros_camera.cpp +++ b/gazebo_plugins/src/gazebo_ros_camera.cpp @@ -182,7 +182,7 @@ void GazeboRosCamera::Load(gazebo::sensors::SensorPtr _sensor, sdf::ElementPtr _ image_transport::create_publisher( impl_->ros_node_.get(), camera_topic, - qos.get_publisher_qos(camera_topic, rclcpp::SensorDataQos()).get_rmw_qos_profile())); + qos.get_publisher_qos(camera_topic, rclcpp::SensorDataQoS()).get_rmw_qos_profile())); // TODO(louise) Uncomment this once image_transport::Publisher has a function to return the // full topic.