Build C++ Library and use in Python Package (Node)
Dear ROS(2) community,
I have developed a C++ library that exposes it's classes to python using Pybind11 bindings. As a dry-run I managed to get the python node to work with the C++ classes. Thus I am able to use this C++ library in a python node.
However, this only works if I manually build the C++ library externally and copy-paste the shared library (.so) into the ROS build folder of my python package.
Obviously this should not be the final way of doing this.
So my question is this:
- Is it possible to nest my C++ library into the python package
- Build the C++ library && Build the python package <-- in one
colcon build --symlink-install
command - Run the python package with python knowing where to look for the built library
basically, seamless integration of my C++ library in my python node
Greetings and thank you for your time,
Deniz
My intuition is telling me that i should wrap this as a whole as a C++ package (and not as a python package)...
If you make it a c++ package, you can't (to the best of my knowledge) make endpoints to the python code which means you can't run it via
ros2 run ...
. Similarly, with a python package you can't build the c++ code.