connect python to c++
Hi I am not sure how to use the variables and function of a python code (.py) in a cpp file?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Usually, if you have two nodes written in different languages, you can have one publish its output to a topic, and have the other node subscribe to that topic.
Trying to call Python functions from C++ is possible, but it's not usually a good idea due to the complexity and the overhead involved.
If you want a more specific answer, you'll need to provide more specifics (and preferably examples) of what you want to do.
Asked: 2015-08-13 17:03:45 -0500
Seen: 1,051 times
Last updated: Aug 17 '15
This is kind of a big question, and this forum is specifically for ROS support. Can you describe how you want to use Python and C++ with ROS?
I have two code in ROS One written by C++ and another one with python. I want to use in ROS c++ code the output of python code(variables, functions) as input of C++ program!
I think this kind of questions would be better in stackoverflow, but if you are flexible about the solution, publishing/subscribing is the way to go.