How to pass node from cpp to python?

asked 2020-05-16 15:13:04 -0500

billtheplatypus gravatar image

I am working in a package that is primarily written in C++, but with some code written in python. The python code does some initialization and such, but the ROS publishing is done in C++. I would like to publish some messages from the python side of the code, and so I initialize a new node in the python side and use that to publish. The works fine, until I try to run it from roslaunch. roslaunch overrides the names of both of the nodes, so that they have the same name, and they conflict.

I figure the easiest way would be to use a single node for both the python and C++ code, but I can't find any way to do that, nor confirmation that this is even possible. I am trying to avoid changing the C++ code as much as possible, and so I don't want to move everything to C++ or python. Is there a way to publish from the C++ node in python?

edit retag flag offensive close merge delete


This would be much easier to help if you provided a copy and paste of the launch file and minimal working example of the nodes.

jayess gravatar image jayess  ( 2020-05-16 23:06:31 -0500 )edit