Correct include_dirs
in setup.py
to be whichever folder contains all of the ROS libraries. For example, [your_include_dir]/ros/ros.h
should be the main ros library for C++.
Run python2 setup.py build_ext --inplace
to build the program
Run python2
to enter a python environment, and type import node
to start it off.
You will probably see an error message that looks something like ImportError: /file/path/to/node.so: undefined symbol: [some mangled symbol name]
.
You can use c++filt
to try determine what it actually talking about by running echo "[mangled symbol name]" | c++filt
.
For example, the problem I'm running into can be clarified with the command echo "_ZN3ros9PublisherD1Ev" | c++filt
, which outputs ros::Publisher::~Publisher()
, the destructor for a ros publisher. I've also had the missing symbol _Py_ZeroStruct
, but c++filt
can't parse it.