diff --git a/perception/image_projection_based_fusion/src/fusion_node.cpp b/perception/image_projection_based_fusion/src/fusion_node.cpp index 76dc50980a926..4ce3acf00eb71 100644 --- a/perception/image_projection_based_fusion/src/fusion_node.cpp +++ b/perception/image_projection_based_fusion/src/fusion_node.cpp @@ -167,7 +167,6 @@ void FusionNode::subCallback(const typename Msg::ConstSharedPtr timer_->cancel(); postprocess(*(cached_msg_.second)); publish(*(cached_msg_.second)); - cached_msg_.second = nullptr; std::fill(is_fused_.begin(), is_fused_.end(), false); // add processing time for debug @@ -187,6 +186,8 @@ void FusionNode::subCallback(const typename Msg::ConstSharedPtr "debug/pipeline_latency_ms", pipeline_latency_ms); processing_time_ms = 0; } + + cached_msg_.second = nullptr; } std::lock_guard lock(mutex_cached_msgs_);