Ask Your Question
0

When is setup.py necessary?

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

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 -0600

mgruhler gravatar image

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

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 imageloubohan ( 2018-05-29 04:23:35 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 280 times

Last updated: May 29 '18