melodic vs noetic python nodes: executable or not?

asked 2021-11-05 10:22:30 -0500

ticotico gravatar image

updated 2021-11-11 03:31:12 -0500

Hi

When using python nodes in ROS, I noticed the following:

  • In melodic, the nodes need to be changed to executables (chmod +x)
  • In noetic, the nodes don't need to be executables (chmod not needed)

Is there an explanation for that? A python2 vs python3 story? Thx!

--- More info / how to reproduce: ---

  • clone/download from here
  • run talker node (executable by default): rosrun rospy_tutorials talker.py
  • command line question:

[rosrun] You have chosen a non-unique executable, please pick one of the following:

1) /home/usr/workspaces/getting_started/devel/share/rospy_tutorials/001_talker_listener/talker.py

2) /home/usr/workspaces/getting_started/src/ros_tutorials/rospy_tutorials/001_talker_listener/talker.py

It seems like noetic also discovers the executable in the src folder and then complains about having two executables. This does not happen in melodic and can be avoided in noetic by making the python file non-executable. So should the policy be that python files in the src folder are non-executable in noetic? But then melodic complains about not finding any executable at all. Any idea on how to solve this issue?

edit retag flag offensive close merge delete

Comments

I'm not dismissing your experience, but I'm pretty sure nothing has changed between Melodic and Noetic wrt this.

Could you please check again?

And then add output of ls -al /path/to/your/node for both cases.

And please also add:

  • is this in install space or devel?
  • does your CMakeLists.txt use catkin_install_python(..)?
gvdhoorn gravatar image gvdhoorn  ( 2021-11-05 10:34:13 -0500 )edit
  • ls -al: once with x and once without x
  • devel space
  • yes, using catkin_install_python(...) (basically cloned the repo)
ticotico gravatar image ticotico  ( 2021-11-05 12:05:27 -0500 )edit

anyone? to me that sounds like a pretty basic/straightforward question that probably plenty of other people already stumbled upon when transitioning from melodic to noetic...thx!

ticotico gravatar image ticotico  ( 2021-11-17 07:40:26 -0500 )edit

anyone able to reproduce this? Would really appreciate it, thx!

ticotico gravatar image ticotico  ( 2021-11-26 03:02:52 -0500 )edit