-
Notifications
You must be signed in to change notification settings - Fork 712
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_pointcloud_preprocessor): templated version of the pointcloud concatenation #10298
base: main
Are you sure you want to change the base?
feat(autoware_pointcloud_preprocessor): templated version of the pointcloud concatenation #10298
Conversation
…lementations and extend it to radars Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10298 +/- ##
==========================================
+ Coverage 25.44% 25.90% +0.46%
==========================================
Files 1321 1385 +64
Lines 102799 107044 +4245
Branches 39102 40990 +1888
==========================================
+ Hits 26154 27728 +1574
- Misses 74131 76603 +2472
- Partials 2514 2713 +199
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I noticed that one or more functions might not be using the latest version from the concatenation node.
Could you please update them to reflect the most recent implementation?
double timeout_sec, bool debug_mode); | ||
bool topic_exists(const std::string & topic_name); | ||
void process_pointcloud( | ||
const std::string & topic_name, sensor_msgs::msg::PointCloud2::SharedPtr cloud); | ||
bool process_pointcloud( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update this function to reflect the latest version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the rebase did not work as expected. Check at a glance all the cpp from the base with the ipp and cpp from this PR. This once is addressed in 593ddc6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good functionally!
I left some comments on factoring out unrelated classes into their own files, and on reducing templated code by introducing ..Base
versions of some classes. Please have a look!
...autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/utility/memory.hpp
Show resolved
Hide resolved
...autoware_pointcloud_preprocessor/include/autoware/pointcloud_preprocessor/utility/memory.hpp
Outdated
Show resolved
Hide resolved
sensing/autoware_pointcloud_preprocessor/src/concatenate_data/combine_cloud_handler.cpp
Outdated
Show resolved
Hide resolved
if ( | ||
(*concatenated_cloud_result.topic_to_transformed_cloud_map).find(topic) != | ||
(*concatenated_cloud_result.topic_to_transformed_cloud_map).end()) { | ||
auto transformed_cloud_output = std::move((*concatenated_cloud_result.topic_to_transformed_cloud_map).at(topic)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leaves moved-from unique ptr in the map (which will be a nullptr).
Using .extract
instead of .at
is a safe alternative that removes the element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method you provided does not compile.
If it is for peace of mind, I used an erase afterwards in 34f8008
topic_to_transformed_cloud_publisher_map_; | ||
std::unique_ptr<autoware_utils::DebugPublisher> debug_publisher_; | ||
|
||
std::unique_ptr<autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_; | ||
diagnostic_updater::Updater diagnostic_updater_{this}; | ||
|
||
void initialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please choose a more descriptive name, such as initialize_pub_sub
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 2e49f11
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//#include "autoware/pointcloud_preprocessor/concatenate_data/concatenate_and_time_sync_node.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unneeded commented out statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Addressed in 2c51d20
this->get_clock()->now().seconds(), | ||
this->get_clock()->now().seconds() - rclcpp::Time(input_ptr->header.stamp).seconds()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted to cloud_arrival_time
given that's what the log message says.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It seem this got into due to the rebases...
Addressed in 8fe850c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, nothing in the CollectorMatchingStrategy directly interacts with pointclouds and thus no templating should be necessary.
It looks like templating was done because CloudCollector is also templated and appears as an argument. I would suggest creating a non-templated CloudCollectorBase
to solve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try that, but ended up creating more mess than it solved. For such simple structure, I don't think that the increased binary size is a problem. Additionally, when everything is templated, it is easier to extend behavior later down the line
} | ||
|
||
template <typename MsgTraits> | ||
std::string PointCloudConcatenateDataSynchronizerComponentTemplated<MsgTraits>::format_timestamp( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions like these should not need to be templated. With this particular one, moving it out of the class is probably best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there were more than just this one or there was an helper header with these functions I would agree. But I prefer having it here repeated by each template instantiation rather than have a single dangling method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put CombineCloudHandlerBase
and CombineCloudHandler<PointCloud2Traits>
into separate files. It is difficult to quickly discern between common and PC2-specific functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 8b44c16
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
Signed-off-by: Kenzo Lobos-Tsunekawa <[email protected]>
…autoware.universe into feat/concat_pointcloud_templated
Description
As part of #9722,
the pointcloud concatenation as accelerated using cuda.
Since we do not want to add a cuda dependency to this package, nor want to duplicate a node that has become more complex, I implemented a templated version of the node, which will enable cuda acceleration in the respective package with minimal code duplication and will easily enable to reuse this logic for radar concatenation.
In addition, this node PR changes the use of some shared pointers to unique pointers, which reduces an entire copy of the pointclouds.
The layout checks were also copied to the
autoware_point_types
package, yet they are still in this package. I will move them in a later PRRelated links
Parent Issue:
How was this PR tested?
Tested using my local environment an a robotaxi rosbag
Notes for reviewers
This PR should work the same as the baseline as it only refactors it into a templated form
Interface changes
None.
Effects on system behavior
None.