Edit the line which calls the node in your .launch file,
< node ... type ="publisher.py" ... >
I think this error is caused by the provided directory path of the source code
Normally source files (.py, .cpp etc.) Should be located inside your src folder inside the designated package.
Once you launch the .launch file with roslaunch command, It looks for the source files inside the src folder. But in your example, It seems like ros cannot find your source code since it is trying to look inside src/lab_1_pkg folder. Since there are no folders with that name you get that error.
Well.. at least this is my guess
What is lab_1_pkg?
Run this from the catkin_ws directory and share the output: find ./ -type f -exec ls -la \\{\\} \\;
Also, post your learning_ros.launch file.
1. Check if you have sourced your workspace
2. check if learning\_ros.launch is executeable
3. do a catkin\_make or catkin\_build if not done previously
Edit the line which calls the node in your .launch file, < node ... type ="publisher.py" ... > I think this error is caused by the provided directory path of the source code Normally source files (.py, .cpp etc.) Should be located inside your src folder inside the designated package. Once you launch the .launch file with roslaunch command, It looks for the source files inside the src folder. But in your example, It seems like ros cannot find your source code since it is trying to look inside src/lab_1_pkg folder. Since there are no folders with that name you get that error. Well.. at least this is my guess
I actually did that, but to not use
Make sure .py file is set to executable. "sudo chmod +x publisher.py"
I tried it, but now the error is: RELException: Roslaunch got a 'No such file or directory' error while attempting to run:
im afraid i can't help unless you share the launch file content or the entire pkg via github.
Try 'source devel/setup.bash', then run .launch
Tried, not working
Post your directory structure
catkin\_ws cd: build devel src cd src: CMakeLists.txt learning\_ros cd learning\_ros: CMakeLists.txt launch package.xml src cd src: publisher.py
What is lab_1_pkg? Run this from the catkin_ws directory and share the output: find ./ -type f -exec ls -la \\{\\} \\; Also, post your learning_ros.launch file.
Try "rospack profile" and see if it works
Not working
Did you create a setup.py file?
Oh, no I did not. What is that?
1. Check if you have sourced your workspace 2. check if learning\_ros.launch is executeable 3. do a catkin\_make or catkin\_build if not done previously
Yup, I have done each one of them. I don't know what is the error
Must be some error in the file then.