ros-perception / image_common

Common code for working with images in ROS
http://www.ros.org/wiki/image_common
125 stars 220 forks source link

[ROS2 Galactic Subscriber] Cannot subscribe to 2 compressed image topic using image_transport subscriber filter #222

Open chenjunnn opened 2 years ago

chenjunnn commented 2 years ago

When I try the following code:

// hpp
image_transport::SubscriberFilter color_img_sub_filter_;
image_transport::SubscriberFilter depth_img_sub_filter_;

// cpp
color_img_sub_filter_.subscribe(
    this, "/camera/color/image_raw", "compressed", rmw_qos_profile_sensor_data);
depth_img_sub_filter_.subscribe(
    this, "/camera/aligned_depth_to_color/image_raw", "compressed", rmw_qos_profile_sensor_data);

it terminated with:

terminate called after throwing an instance of 'rclcpp::exceptions::ParameterAlreadyDeclaredException'
  what():  parameter 'mode' has already been declared
chenjunnn commented 2 years ago

This bug is mentioned here: https://github.com/ros-perception/image_transport_plugins/pull/82 If anyone meets the same problem, please check the above PR.