Skip to content

Commit

Permalink
feat: add pipeline latency publisher in centerpoint
Browse files Browse the repository at this point in the history
Signed-off-by: kminoda <[email protected]>
  • Loading branch information
kminoda committed Jan 29, 2024
1 parent a52ce29 commit 9227726
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions perception/lidar_centerpoint/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,17 @@ void LidarCenterPointNode::pointCloudCallback(
if (debug_publisher_ptr_ && stop_watch_ptr_) {
const double cyclic_time_ms = stop_watch_ptr_->toc("cyclic_time", true);
const double processing_time_ms = stop_watch_ptr_->toc("processing_time", true);
const double pipeline_latency_ms =
std::chrono::duration<double, std::milli>(
std::chrono::nanoseconds(
(this->get_clock()->now() - output_msg.header.stamp).nanoseconds()))
.count();
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
"debug/cyclic_time_ms", cyclic_time_ms);
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
"debug/processing_time_ms", processing_time_ms);
debug_publisher_ptr_->publish<tier4_debug_msgs::msg::Float64Stamped>(
"debug/pipeline_latency_ms", pipeline_latency_ms);
}
}

Expand Down

0 comments on commit 9227726

Please sign in to comment.