diff --git a/jsk_pcl_ros/src/organized_statistical_outlier_removal_nodelet.cpp b/jsk_pcl_ros/src/organized_statistical_outlier_removal_nodelet.cpp index d3b367711e..67dbd35d12 100644 --- a/jsk_pcl_ros/src/organized_statistical_outlier_removal_nodelet.cpp +++ b/jsk_pcl_ros/src/organized_statistical_outlier_removal_nodelet.cpp @@ -94,7 +94,15 @@ namespace jsk_pcl_ros void OrganizedStatisticalOutlierRemoval::unsubscribe() { - sub_.shutdown(); + if (use_cpi_) + { + sub_cloud_.unsubscribe(); + sub_cpi_.unsubscribe(); + } + else + { + sub_.shutdown(); + } } void OrganizedStatisticalOutlierRemoval::configCallback(Config &config, uint32_t level)