Skip to content

Commit adfecc2

Browse files
technolojinknzo25
andauthored
feat(autoware_lidar_centerpoint): added a check to notify if we are dropping pillars (autowarefoundation#9488) (#1676)
* feat: added a check to notify if we are dropping pillars * chore: updated text * chore: throttled the message --------- Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]> Co-authored-by: Kenzo Lobos Tsunekawa <[email protected]>
1 parent db51b36 commit adfecc2

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

perception/lidar_centerpoint/lib/centerpoint_trt.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,28 @@ bool CenterPointTRT::detect(
115115
cudaMemsetAsync(spatial_features_d_.get(), 0, spatial_features_size_ * sizeof(float), stream_));
116116

117117
if (!preprocess(input_pointcloud_msg, tf_buffer)) {
118-
RCLCPP_WARN_STREAM(
119-
rclcpp::get_logger("lidar_centerpoint"), "Fail to preprocess and skip to detect.");
118+
RCLCPP_WARN(rclcpp::get_logger("lidar_centerpoint"), "Fail to preprocess and skip to detect.");
120119
return false;
121120
}
122121

123122
inference();
124123

125124
postProcess(det_boxes3d);
126125

126+
// Check the actual number of pillars after inference to avoid unnecessary synchronization.
127+
unsigned int num_pillars = 0;
128+
CHECK_CUDA_ERROR(
129+
cudaMemcpy(&num_pillars, num_voxels_d_.get(), sizeof(unsigned int), cudaMemcpyDeviceToHost));
130+
131+
if (num_pillars >= config_.max_voxel_size_) {
132+
rclcpp::Clock clock{RCL_ROS_TIME};
133+
RCLCPP_WARN_THROTTLE(
134+
rclcpp::get_logger("lidar_centerpoint"), clock, 1000,
135+
"The actual number of pillars (%u) exceeds its maximum value (%zu). "
136+
"Please considering increasing it since it may limit the detection performance.",
137+
num_pillars, config_.max_voxel_size_);
138+
}
139+
127140
return true;
128141
}
129142

0 commit comments

Comments
 (0)