Skip to content

feat(autoware_pointcloud_preprocessor): templatize Filter into FilterBase<NodeT> - #13331

Draft
Koichi98 wants to merge 1 commit into
autowarefoundation:mainfrom
Koichi98:apply_agnocast_filter_base
Draft

feat(autoware_pointcloud_preprocessor): templatize Filter into FilterBase<NodeT>#13331
Koichi98 wants to merge 1 commit into
autowarefoundation:mainfrom
Koichi98:apply_agnocast_filter_base

Conversation

@Koichi98

@Koichi98 Koichi98 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Description

autoware_pointcloud_preprocessor::Filter was hard-wired to rclcpp::Node, so a node that wants to run on Agnocast had to bypass the base class. PolarVoxelOutlierFilterComponent does exactly that today: it resets Filter::sub_input_ and hand-rolls its own Agnocast subscription, with a TODO waiting for base-class support.

This turns Filter into template <typename NodeT = rclcpp::Node> class FilterBase : public NodeT, with the publisher, subscription, message_filters and autoware_utils member types derived from NodeT. Filter stays as a real class deriving from FilterBase<>, so all 26 existing subclasses (17 here, 3 in autoware_ground_segmentation, 6 in autoware_compare_map_segmentation) are unchanged.

No node is instantiated on FilterBase<autoware::agnocast_wrapper::Node> yet — that instantiation is explicit in filter.cpp so both are compile-checked, and moving the first node onto it is a follow-up PR. The TF backend is deliberately untouched here: ManagedTransformBuffer builds an internal rclcpp::Node, which an AgnocastOnly executable cannot construct, and swapping it belongs with the first node that actually needs it.

Depends on autowarefoundation/autoware_core#1433: FilterBase<agnocast_wrapper::Node>::subscribe() registers input_indices_callback — which takes PointCloud2::ConstSharedPtr — on the wrapper's synchronizer, and that callback shape is what #1433 adds.

Related links

How was this PR tested?

Built autoware_pointcloud_preprocessor, autoware_ground_segmentation and autoware_compare_map_segmentation with ENABLE_AGNOCAST=0 and ENABLE_AGNOCAST=1; no errors and no new warnings in either.

Ran colcon test for autoware_pointcloud_preprocessor at ENABLE_AGNOCAST=0: 117 gtest cases across 14 suites, 0 failures.

No tests are added. The change introduces no new behavior on the rclcpp::Node instantiation, which the existing suites already cover, and the Agnocast instantiation has no node behind it yet.

Notes for reviewers

ALLOCATE_OUTPUT_MESSAGE_UNIQUE(pub_output_) in allocate_output_message() has to stay a macro and stay behind if constexpr (kIsAgnocastNode). Without USE_AGNOCAST_ENABLED the macro expands to std::make_unique<...>(), because agnocast_wrapper::Node::create_publisher returns a plain rclcpp::Publisher::SharedPtr there, which has no allocate_output_message_unique().

Filter is a class rather than using Filter = FilterBase<>; because subclasses in other namespaces write a bare : Filter(...) in their mem-initializer list, which relies on the injected class name that an alias does not provide.

Interface changes

None.

Effects on system behavior

None. Every node still runs on FilterBase<rclcpp::Node>.

…Base<NodeT>

Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
@github-actions github-actions Bot added the component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

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

Please ensure:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned)

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant