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

When is setup.py necessary?

asked 2018-05-28 03:16:42 -0500

loubohan gravatar image

Sorry if this is a basic question.

I am working through the ROS tutorials on the wiki and some external sites written in python and I confused about when I need follow the procedures for python packages, such as creating a setup.py file and having catkin_python_setup() in my CMakeLists.txt file as explained here: http://docs.ros.org/kinetic/api/catki...

In the wiki tutorial on writing a simple publisher and subscriber in python ( http://wiki.ros.org/rospy_tutorials/T... ), I can use catkin_make to build my nodes and run them without any python-specific modifications to my package or CMakeList

I am running ROS Kinetic on Ubuntu 16.04 LTS inside VMWare Workstation 12 on an HP Elitebook 840-G3.

Thank you very much.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-29 02:38:50 -0500

mgruhler gravatar image

updated 2018-05-29 02:40:54 -0500

catkin_python_setup() and the Setup.py are needed if you want to install the Python scripts/modules that you program. They basically define how to copy things from your workspace to the place where you want to install.

You also Need that if you write a module in pkg A and want to use/Import it in pkg B.

The tutorials work because there you just execute the script directly in your workspace. There is no Installation involved.

For modules, however, it is mandatory.

edit flag offensive delete link more

Comments

Thank you very much!

loubohan gravatar image loubohan  ( 2018-05-29 04:23:35 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-05-28 03:14:38 -0500

Seen: 1,022 times

Last updated: May 29 '18