Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_lidar_centerpoint): added the cuda_blackboard to centerpoint #9453

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

knzo25
Copy link
Contributor

@knzo25 knzo25 commented Nov 25, 2024

Description

This is part of the series of PR related to #9722

List of PRs:

Depending on your machine and how many nodes are in a container, the following branch may also be required:
https://github.com/knzo25/launch_ros/tree/fix/load_composable_node
There seems to be a but in ROS where if you send too many services at once some will be lost and ros_launch can not handle that.

Related links

Parent Issue:

  • Link

How was this PR tested?

The sensing/perception pipeline was tested until centerpoint for TIER IV's taxi using the logging simulator.
The following tests were executed in a laptop equipped with a RTX 4060 (laptop) GPU and a Intel(R) Core(TM) Ultra 7 165H (22 cores)

Node / processing time [ms] Current PR
/sensing/lidar/top/crop_box_filter_self/debug/processing_time_ms 5.81 N/A
/sensing/lidar/top/crop_box_filter_mirror/debug/processing_time_ms 4.59 N/A
/sensing/lidar/top/distortion_corrector/debug/processing_time_ms 10.96 N/A
/sensing/lidar/top/ring_outlier_filter/debug/processing_time_ms 10.69 N/A
/sensing/lidar/top/cuda_organized_pointcloud_adapter/debug/processing_time_ms N/A 3.75
/sensing/lidar/top/cuda_pointcloud_preprocessor/debug/processing_time_ms N/A 1.00
/sensing/lidar/concatenate_data_synchronizer/debug/processing_time_ms 7.83 0.70
Total 38.8 5.45

Notes for reviewers

Note 1:
The main branch that I used for development is feat/cuda_acceleration_and_transport_layer2.
However, the changes were too big so I split the PRs. That being said, development, if any will still be on that branch (and then cherrypicked to the respective PRs), and the review changes will be cherrypicked into the development branch.

Note 2:
Now that the cuda blackboard itself has been added to autoware, this PR can be tested in a standalone fashion as well

Note 3:
Due to a missing feature in the blackboard, the following version is needed for now: autowarefoundation/cuda_blackboard#1
How that feature will be merged into autoware is explained in the respective PR

Interface changes

An additional topic is added to perform type negotiation:
Example: input/pointcloud -> input/pointcloud and input/pointcloud/cuda

Effects on system behavior

Enabling this preprocessing in the launchers should provide a much reduced latency and cpu usage (at the cost of a higher GPU usage)

…point

Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Nov 25, 2024
Copy link

github-actions bot commented Nov 25, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kminoda
Copy link
Contributor

kminoda commented Nov 26, 2024

@knzo25 Thank you for your great work 🎉

Do you have any documentation for the cuda_blackboard package? Just a simple API references and overall design in a readme would be helpful to review the PRs.

@knzo25
Copy link
Contributor Author

knzo25 commented Nov 26, 2024

@kminoda
Yes, sorry. I am adding some results (processing time, memory consumption, cpu use), documentation, etc as of now, but wanted to open the PRs before to the the ball moving

@knzo25
Copy link
Contributor Author

knzo25 commented Dec 13, 2024

@kminoda
Added the cuda_blackboard documentation in https://github.com/knzo25/cuda_blackboard.
As discussed internally, I will create an issue to manage and discuss about this series of PRs

…terpoint

Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
std::bind(&LidarCenterPointNode::pointCloudCallback, this, std::placeholders::_1));
pointcloud_sub_ =
std::make_unique<cuda_blackboard::CudaBlackboardSubscriber<cuda_blackboard::CudaPointCloud2>>(
*this, "~/input/pointcloud", false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you write a documentation for bool add_compatible_sub in cuda_blackboard repository? It is difficult to tell whether this "false" value is OK or not from the current documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amadeuszsz
Minoda-san will probably not be able to handle these comments. Could you continue these as well 🙏 ?

The add_compatible_sub was a missing auto detection feature, that is being addressed here:
autowarefoundation/cuda_blackboard#1

The value will become unused and deprecated soon

Copy link
Contributor

@amadeuszsz amadeuszsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, as cuda blackboard is 🚀! Apart from review comments, please take a look on pre-commit log (missing header).

@@ -45,15 +45,17 @@ class CenterPointTRT
virtual ~CenterPointTRT();

bool detect(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg, const tf2_ros::Buffer & tf_buffer,
std::vector<Box3D> & det_boxes3d, bool & is_num_pillars_within_range);
const std::shared_ptr<const cuda_blackboard::CudaPointCloud2> & input_pointcloud_msg_ptr,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use pointer as an argument, please remove dereference in node.cpp for detect call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, which de-reference?

void LidarCenterPointNode::pointCloudCallback(
  const std::shared_ptr<const cuda_blackboard::CudaPointCloud2> & input_pointcloud_msg)
...
bool is_success = detector_ptr_->detect(
    input_pointcloud_msg, tf_buffer_, det_boxes3d, is_num_pillars_within_range);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You addressed it in 3893f19

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh sorry, had not pushed the branch 🙏

@knzo25 knzo25 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Mar 19, 2025
@knzo25 knzo25 self-assigned this Mar 19, 2025
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.

Project coverage is 25.91%. Comparing base (660ae1a) to head (61aea14).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ion/src/pointpainting_fusion/pointpainting_trt.cpp 0.00% 16 Missing ⚠️
...dar_centerpoint/lib/preprocess/voxel_generator.cpp 0.00% 7 Missing ⚠️
...rpoint/lib/preprocess/pointcloud_densification.cpp 0.00% 5 Missing ⚠️
perception/autoware_lidar_centerpoint/src/node.cpp 0.00% 4 Missing ⚠️
...autoware_lidar_centerpoint/lib/centerpoint_trt.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9453      +/-   ##
==========================================
- Coverage   25.92%   25.91%   -0.01%     
==========================================
  Files        1382     1382              
  Lines      106811   106833      +22     
  Branches    40907    40911       +4     
==========================================
  Hits        27690    27690              
- Misses      76418    76440      +22     
  Partials     2703     2703              
Flag Coverage Δ *Carryforward flag
differential 4.19% <ø> (?)
differential-cuda 6.41% <0.00%> (?)
total 25.92% <ø> (+<0.01%) ⬆️ Carriedforward from 660ae1a

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

knzo25 added 5 commits March 19, 2025 15:28
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
…autoware.universe into feat/cuda_blackboard_centerpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants