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

Conversation

bjsowa
Copy link
Contributor

@bjsowa bjsowa commented Jul 17, 2024

rclcpp_components_register_node macro can create templated source for node executable that runs the Node component.

This PR replaces some boilerplate code using this macro.

@bjsowa bjsowa mentioned this pull request Jul 17, 2024
@jonbinney jonbinney self-assigned this Jul 17, 2024
@jonbinney
Copy link
Contributor

I like using the macros, but I think there's still a good reason to put them in separate _node source files. In #188 the main function was split into a separate file so that the filter chain component classes could be #included by other people's code without getting a main function.

@bjsowa
Copy link
Contributor Author

bjsowa commented Jul 21, 2024

I like using the macros, but I think there's still a good reason to put them in separate _node source files.

Sure, If you feel so, you can close this PR. The macros just seem "cleaner" to me but it's just my opinion.

If you want to stick to _node source file, I will at least try to get 0597364 merged.

Copy link
Contributor

@jonbinney jonbinney left a comment

Choose a reason for hiding this comment

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

I read up on rclcpp_components_register_node and now this PR makes sense to me. Once you add the suggested comment, I'll merge this.


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

@jonbinney
Copy link
Contributor

Looks good, merging! btw i find it very odd that rclcpp_components_register_node creates the templated node executable, but rclcpp_components_register_nodes (plural) doesn't.....

@jonbinney jonbinney merged commit c9bfbbf into ros-perception:ros2 Jul 23, 2024
5 checks passed
@bjsowa bjsowa deleted the use-templated-node-executables branch July 23, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants