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

Create node executables using rclcpp_component macros #198

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ ament_auto_add_library(laser_scan_filters SHARED src/laser_scan_filters.cpp)
ament_auto_add_library(laser_filter_chains SHARED
src/scan_to_cloud_filter_chain.cpp
src/scan_to_scan_filter_chain.cpp)
rclcpp_components_register_nodes(laser_filter_chains
"ScanToCloudFilterChain"
"ScanToScanFilterChain")

set(FILTER_CHAINS
scan_to_cloud_filter_chain
scan_to_scan_filter_chain
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment describing what rclcpp_components_register_node does here? It's a very cool and useful macro, but the documentation isn't super easy to find, and it'd be nice to have a summary here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment that briefly describes the macro

# The rclcpp_components_register_node macro registers an rclcpp component for the node with
# the ament resource index AND creates a templated executable that spins the given node.

rclcpp_components_register_node(
laser_filter_chains
PLUGIN "ScanToCloudFilterChain"
EXECUTABLE "scan_to_cloud_filter_chain"
)

rclcpp_components_register_node(
laser_filter_chains
PLUGIN "ScanToScanFilterChain"
EXECUTABLE "scan_to_scan_filter_chain"
)
foreach(FILTER_CHAIN ${FILTER_CHAINS})
ament_auto_add_executable(${FILTER_CHAIN} src/${FILTER_CHAIN}_node.cpp)
endforeach()

ament_auto_add_executable(generic_laser_filter_node src/generic_laser_filter_node.cpp)

Expand Down
59 changes: 0 additions & 59 deletions src/scan_to_cloud_filter_chain_node.cpp

This file was deleted.

59 changes: 0 additions & 59 deletions src/scan_to_scan_filter_chain_node.cpp

This file was deleted.

Loading