Skip to content

Commit 9227726

Browse files
committed
feat: add pipeline latency publisher in centerpoint
Signed-off-by: kminoda <koji.minoda@tier4.jp>
1 parent a52ce29 commit 9227726

File tree

1 file changed

+7
-0
lines changed
  • perception/lidar_centerpoint/src

1 file changed

+7
-0
lines changed

perception/lidar_centerpoint/src/node.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,17 @@ void LidarCenterPointNode::pointCloudCallback(
169169
if (debug_publisher_ptr_ && stop_watch_ptr_) {
170170
const double cyclic_time_ms = stop_watch_ptr_->toc("cyclic_time", true);
171171
const double processing_time_ms = stop_watch_ptr_->toc("processing_time", true);
172+
const double pipeline_latency_ms =
173+
std::chrono::duration<double, std::milli>(
174+
std::chrono::nanoseconds(
175+
(this->get_clock()->now() - output_msg.header.stamp).nanoseconds()))
176+
.count();
172177
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
173178
"debug/cyclic_time_ms", cyclic_time_ms);
174179
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
175180
"debug/processing_time_ms", processing_time_ms);
181+
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
182+
"debug/pipeline_latency_ms", pipeline_latency_ms);
176183
}
177184
}
178185

0 commit comments

Comments
 (0)