Ask Your Question
1

is there a reason why rclcpp_components/register_node_macro.hpp is included at the bottom of the source file vs the top, when writing a composition?

asked 2020-08-05 14:24:12 -0600

asobhy gravatar image

is there a reason why rclcpp_components/register_node_macro.hpp is included at the bottom of the source file vs the top, when writing a composition?

The file in the link below shows rclcpp_components/register_node_macro.hpp included at the bottom: https://github.com/ros2/demos/blob/ma...

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-08-05 18:09:43 -0600

Geoff gravatar image

It's more convention than anything else. It will still work even if you put it at the top of the file, but putting it at the end means that you see the node implementation first. You could also look at it as saying "I've defined this node, now register it" in a procedural sort of way.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2020-08-05 14:24:12 -0600

Seen: 86 times

Last updated: Aug 05 '20