I am new with ROS, just started few days ago basically. I have one question regarding my workspace and packages.
Let's say I created my workspace catkin_ws
and I cloned in src
folder git repository. That git repository have multiple packages. Each package has some dependencies (i.e. other packages that he depends on). There is big probability that I will not have all of those dependencies installed and that I will need to install some.
Let's say that I have run now catkin_make
in my catkin_ws
directory. Because I do not have specific packages (i.e. dependencies) installed, error will be generated. At this point I am confused. I found three ways of dealing this problem, and I will describe them now and possible issues:
Cloning git repository of that specific dependency (i.e. package) that is missing into the
src
folder of my workspace.- This would mean that I would have to clone every git repository for every dependency that I am missing, and this can go nested. So in my opinion this solution is not optimal.
Installing each specific dependency (i.e. package) that is missing into using
apt-get
.- Also this would require to install every dependency that is missing manually, and also this can go nested.
- But all dependencies that are needed for certain ros project are given by manufacturer so I could simple install them in one go.
Installing all missing dependencies using
rosdep
as follows:rosdep install --from-paths src --ignore-src -r -y
from my workspace foldercatkin_ws
- So this command would go to my src folder, look at each package's
package.xml
file and install dependencies that are missing (theoreticaly). - But apparently even if I run this command, and then
catkin_make
there are still some dependencies missing that cannot be installed with this command. Then I applied 1st method and it worked.
- So this command would go to my src folder, look at each package's
Also is it better to install dependencies in my workspace rather than in system directory /opt/ros/noetic/share
? But I do not know how to install them in my workspace using method number 3 (rosdep
). Even though I run that command in my workspace folder dependencies are installed in system directory.
Also I did not used method number 2 so far, because I wanted to try to install dependencies in my workspace, and this method number 2 is installing somewhere else I suppose, but not in my directory obviously.
Can someone explain me these things, and tell me is my understanding of this correct? Can you tell me also how to install dependencies in most secure and convenient way.
All these things I was experimenting when I tried to run gmapping
SLAM with turtlebot3
.