ROSRUN command not running properly.
I write a Python script inside the src and code_pkg folder but when i run the rosrun command then following error occured.
robotics@robotics-PC:~/catkin_ws/src/code_pkg$ rosrun code_pkg robot.py [rospack] Error: package 'code_pkg' not found
did you run catkin_make and source devel/setup.sh?
First move to "catkin_ws" folder. Then as @plutotx mentioned, run
from that folder. next run
and finally
try this and post the output you get
@KalanaR what is the function of Catkin_ make and Source devel/setup.bash Further i run this but not succeded same eroor occurred
when you are writing in C++ , catkin_make compiles the code and generate required build and devel folders. devel/setup.bash file holds the details about the packages you created inside "catkin_ws". what happens when you source it is, you load all the path variables and other stuff to your terminal (this is what i understand, please correct me if im wrong). which are required to locate your nodes.
when you are writing in python, catkin_make creates build and devel folders but does not compile anything. but again devel contains required paths and other stuff like in C++ case.
this is from rospy tutorial here
*We use CMake as our build system and, yes, you have to use it even for Python nodes. This is to make sure that the autogenerated Python code for messages and services is created. Go to your catkin workspace and run catkin_make:
@HASSAN ISMAIL can you post the terminal output including the commands you used. (may be a image)