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

Consequence of setup.py

asked 2018-06-25 01:57:53 -0500

JayDe gravatar image

Hi,

I am currently setting up my first python based node. I have included a setup.py into my project and added the "catkin_python_setup()" macro in my CMakeLists.txt. I am now wondering, what the consequence of this is. Or, said differently, where can I see the result of adding setup.py and the macro?

I have checked the $PYTHONPATH and found that my python package can be found in /path_to_workspace/devel/lib/python2.7/dist-packages/mypackage. Am I right that this folder has been generated by catkin when running setup.py? Are the modules of my package mypackage made available through /path_to_workspace/devel/lib/python2.7/dist-packages/mypackage/__init__.py?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-06-25 10:15:30 -0500

pgorczak gravatar image

Correct! As long as you're using the devel space, catkin generates the file you mentioned via a cmake macro. When it is imported at runtime, it adds your source files (src/...) to the Python module path. As a consequence, you don't have to re-build your workspace unless you change setup.py itself.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-06-25 01:57:53 -0500

Seen: 122 times

Last updated: Jun 25 '18