rosdep update command use
This method can skip the sudo rosdep init initialization command setting. The premise is that after ros is installed, rosdep update is to install some dependent libraries, such as Cartographer, ORB-SLAM and other algorithms that need to use some dependent libraries, which must be installed. If It is not necessary, just use ros general dependencies, do not need rosdep update
The key points are repeated: (because everyone is wrong)
Record the storage address of rosdistro, for example /home/LiFeiHong/rosdistro
, change it to your own , and the /home/你用户名/rosdistro
following changes are made in this way. If LiFeiHong appears in the last error report, it means that your path is wrong; in addition, this solution is tested in 18.04 and 16.04. There is no problem, the 20.04 Ubuntu version may need to be correct path python2.7改成python3.0
.
1. First clone the contents of the following warehouse to the local
Method 1: Download rosdistro directly from
csdn resources
Method 2:
git clone https://github.com/ros/rosdistro.git
Method 3:
If the git clone speed is slow, you can directly copy https://github.com/ros/rosdistro.git to the web page to download, the speed will be improved,
but you need to remember to change the download package name rosdistro-master to rosdistro
Record the storage address of rosdistro. For example, /home/LiFeiHong/rosdistro
if it is changed to your own /home/user/rosdistro
, it user
indicates the user name. The following changes are made in this way.
2. Modify the /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
file
cd /usr/lib/python2.7/dist-packages/rosdep2
sudo gedit rep3.py
Note: If you can't go to the rosdep2 folder, search for rep3.py directly in the usr folder. You can find the corresponding path, the following method is the same.
Replace REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml' with the REP3_TARGETS_URL = 'file:///home/LiFeiHong/rosdistro/releases/targets.yaml'
replaced /home/LiFeiHong which is the storage address of the first clone content
3. Modify the /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
file
cd /usr/lib/python2.7/dist-packages/rosdistro
sudo gedit __init__.py
Replace DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml' in the original file with the DEFAULT_INDEX_URL = 'file:///home/LiFeiHong/rosdistro/index-v4.yaml'
replaced /home/LiFeiHong, which is the storage address of the first clone content
4. Configuration 20-default.list
file
If you look at the /etc/ros/rosdep/sources.list.d path, there is already a 20-default.list file (the reason why sudo rosdep init has been run before), just skip 4.1
the step and run the 4.2 step, -- -------------------======
4.1
, create a folder sources.list.d, and generate a 20-default.list file
sudo mkdir -p /etc/ros/rosdep/sources.list.d
Generate 20-default.list
cd /etc/ros/rosdep/sources.list.d
sudo touch 20-default.list
The /etc/ros/rosdep/sources.list.d/20-default.list file has been generated here-------------------======
4.2. Open the 20-default.list file and modify the content to the following code, note that the content /home/LiFeiHong is modified to your own record path
sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list
Change the content to:
# os-specific listings first
yaml file:///home/LiFeiHong/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/LiFeiHong/rosdistro/rosdep/base.yaml
yaml file:///home/LiFeiHong/rosdistro/rosdep/python.yaml
yaml file:///home/LiFeiHong/rosdistro/rosdep/ruby.yaml
gbpdistro file:///home/LiFeiHong/rosdistro/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
Note that the yaml file://
fixed format /home...
represents the file directory, so it isyaml file:///
5. Last Direct
rosdep update
Give the cartographer simple installation tutorial
link: https://blog.csdn.net/weixin_44023934/article/details/95006421