I am creating a new ros package inside the catkin_ws/src after creating any package I use the catkin_make command to build ros packages with new packages. But When I try to find my new package in the ros packages using rospack find command or rospacklist | grep [my_package], I can't find it and I see this error.
I am using Ros Melodic version on the Ubuntu 18.04.2 LTS.
mehmet@ABRA-A5-V6-1:~/catkin_ws/src$ ls
CMakeLists.txt graduation_tutorial tutorial
mehmet@ABRA-A5-V6-1:~/catkin_ws$ catkin_make
After this command.
mehmet@ABRA-A5-V6-1:~/catkin_ws/src$ rospack find tutorial
[rospack] Error: package 'tutorial' not found
I want to find and execute my own race packages. What Should I do for my Ros system?
I suspect you need to source your workspace. After you do a catkin_make
(or catkin build
if you're using the catkin_tools package) and it tells you it was successful, type in a terminal:
source ~/catkin_ws/devel/setup.bash
That will set some environment variables and make your packages in that workspace recognizable to the rest of the system. You should then be able to do
rospack find tutorial
and it should print the path to that package. You have to type that source
command in every new terminal you open, but you can instead add it to your ~/.bashrc
file so it is automatically sourced when you open a new terminal.