ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS2 as shared library in existing application

asked 2018-03-16 04:03:29 -0500

Jesper gravatar image

I would like to integrate ROS2 inside an existing application. Is there a way to build a ROS2 node as shared library?

The application is not conductive to turn into a library that can be used inside a ROS2 node.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-16 13:17:11 -0500

tfoote gravatar image

Certainly. The recommended way to write ROS2 nodes is as a class which can easily be compiled into a library and integrated into an existing application.

For example take a look at our basic talker demo: https://github.com/ros2/demos/blob/ma...

The node is created as a class. There's a little bit of boilerplate setup that you'll need to do to that can be seen in the main function. But there's no requirement that it happen in main. The can easily be embedded into another application.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2018-03-16 04:03:29 -0500

Seen: 323 times

Last updated: Mar 16 '18