UNit 4 - Advanced Utilities 2

I am running through UNit 4 - Advanced Utilities 2
Ex 4.11
I’ve created Test_process.py in a couple of my_scripts folders but get the following error:

user:~/my_scripts$ rosrun move_bb8_pkg test_process.py
[rosrun] Couldn’t find executable named test_process.py below /home/user/my_scripts/move_bb8_pkg

I have also tried creating a folder as follows:

user:~/catkin_ws/src/linux_course_files/my_scripts$ rosrun move_bb8_pkg test_process.py

but get the following error

[rosrun] Couldn’t find executable named test_process.py below /home/user/catkin_ws/src/linux_course_files/move_bb8_pkg

any ideas where I should be creating the test_process.py file or if it is in the correct location, any idea why ros run will cannot find the executable? Thanks in advance

I think your problem is that your file test_process.py does not have execution permissions.

You need to go to the directory where your file is and then provide to it execution permissions with the command chmod +x

thanks @rtellez for the rapid response. I tried chmod +x.
And ran the rosrun as below;

user:~/my_scripts$ chmod +x test_process.py
user:~/my_scripts$ rosrun move_bb8_pkg test_process.py
[rosrun] Couldn’t find executable named test_process.py below /home/user/catkin_ws/src/linux_course_files/move_bb8_pkg

any advice would be welcome. I am wondering whether the folder I have created has RWX permissions

Hi @rossneya,

when you run “rosrun move_bb8_pkg test_process.py”, you are telling ROS to run a script named test_process.py that is expected to be found in a package named move_bb8_pkg.

By the first line you pasted:

user: ~/my_scripts$ chmod +x test_process.py

I can clearly see that your script is inside the folder /home/user/my_scripts , and the error says that it is expected to be in /home/user/catkin_ws/src/linux_course_files/move_bb8_pkg

Just moving your file to the correct folder should solve your problem.

1 Like

got it , thanks very much @ralves

user:~/catkin_ws/src/linux_course_files/move_bb8_pkg/src/my_scripts$ rosrun move_bb8_pkg test_process.py
[INFO] [1648072877.231876, 4304.122000]: Moving BB-8 forward!!
1 Like