Hi everyone,
I'm new using python in ROS but I've been developing robots solution for a little time in C++. The thing is that when you want to use a ROS C++ node you must configure CMakeLists.txt properly in order to built those nodes. The point is that, for what I've seen on ROS Tutorials, when you want to use a python node you does not have to make any configuration of this file: just compile and run on the command console chmod +x python_node_name.py
in order to make it an executable.
Is there a way to make python executable nodes automatically? Something similar to what you do when you configure CMakeLists.txt for a new C++ node.
On the other hand, I would like to know if it is compulsory to generate setup.py and when you must use it. Because when I use
chmod +x *.py
sentence I do not write any setup.py or init.py file.Finally, is it possible to call from ROS a python module that has been already compiled (for example a non ROS library to make a visual enviroment for an application)? If so, how?
Maybe, there are tutorial on the web that explains all that things but I haven't found any that make it clear to me. Thanks in advance for you help.
Originally posted by drodgu on ROS Answers with karma: 59 on 2019-09-24
Post score: 0
Original comments
Comment by gvdhoorn on 2019-09-24:
Just some high-level clarification: there is nothing really 'special' about using Python in ROS nodes. Just about everything you'd normally be able or would want to do with Python is possible.
Your questions 2 and 3 are essentially not ROS-related questions, but generic Python questions. I'm not writing this because we don't want to help you, but because you don't need to limit yourself "to ROS" related sites when looking for support.
Comment by drodgu on 2019-09-24:
Thank you @gvdhoorn, I know that it is not the best option to limit myself just to ROS related sites. But for me it is easier to ask here and make concept relation between all the answer and ROS. And I use this way to ask about this kind of doubts because it could be usefull for another beginner ROS user, I guess that everyone has pretty much the same doubts when they begin using ROS :)