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

Provide CMake infrastructure for creating a node #114

Closed
wjwwood opened this issue Sep 16, 2015 · 4 comments
Closed

Provide CMake infrastructure for creating a node #114

wjwwood opened this issue Sep 16, 2015 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@wjwwood
Copy link
Member

wjwwood commented Sep 16, 2015

This is a spin off from ros2/ros2#55.

Basically we need to add some lubrication to the process of making a node which can be loaded as a library into a container or run as a stand-alone executable. This is what I imagine it would look like:

rclcpp_add_node(my_node src/my_node.cpp)
target_link_libraries(my_node ...)
ament_target_dependencies(my_node "rclcpp" ...)
...

The rclcpp_add_node macro would create a target my_node which builds a shared library, and also creates a target which builds an executable (name of this target is an implementation detail) with the output name my_node. This allows the user to link extra libraries and what not to the library containing the node. It would also register this node in the ament index.

The output files will be lib/libmy_node.so, bin/my_node, and share/ament_index/resource_index/nodes/pkg_name/my_node (maybe just share/ament_index/resource_index/nodes/pkg_name with the my_node in the contents of that file).

The user's code is compiled into lib/libmy_node.so.
The executable is a boilerplate main which can load and run the shared library in stand alone mode or, with a cli switch, it can tell a remote container to load and run the library, acting as a surrogate until the node is removed from the container.

The infrastructure has been prototyped here: ros2/demos#18

Making all of this work will require us to figure out the issues surrounding multi vendor support in #48

@Karsten1987
Copy link
Contributor

@wjwwood same as #115 (comment)

@wjwwood
Copy link
Member Author

wjwwood commented Feb 26, 2018

I would say no. We still do not have CMake infrastructure to let users easily create node components. And I still think we should.

@jacobperron
Copy link
Member

I've proposed this for a Dashing patch release since it enables ros2/demos#325.

@wjwwood
Copy link
Member Author

wjwwood commented Mar 19, 2020

Closed by #784?

@wjwwood wjwwood closed this as completed Mar 19, 2020
nnmm pushed a commit to ApexAI/rclcpp that referenced this issue Jul 9, 2022
Revert "Control shared/static linking via BUILD_SHARED_LIBS"
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this issue Aug 5, 2022
* Handle message type name with multiple namespace parts

For now, it is okay to ignore the middle parts of the namespace, but this should be updated in the future.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Update tests

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Remove extra line

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
mauropasse pushed a commit to mauropasse/rclcpp that referenced this issue Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants