ROS 시스템의 rosdep 업데이트 시간 초과 문제를 해결하는 간단한 방법

rosdep 업데이트 명령 사용

이 방법은 sudo rosdep 초기화 ​​명령 설정을 건너뛸 수 있습니다. 전제는 ros가 설치된 후 rosdep update가 Cartographer, ORB-SLAM 및 일부 종속 라이브러리를 사용해야 하는 기타 알고리즘과 같은 일부 종속 라이브러리를 설치한다는 것입니다. 필요하지 않은 경우 ros 일반 종속성을 사용하고 rosdep 업데이트가 필요하지 않습니다.


요점은 반복됩니다 : (모두가 틀리기 때문에)

예를 들어 rosdistro의 저장 주소를 기록하고 /home/LiFeiHong/rosdistro이를 자신의 것으로 변경하면 /home/你用户名/rosdistro다음과 같이 변경됩니다.LiFeiHong이 마지막 오류 보고서에 나타나면 경로가 잘못되었음을 의미합니다. 또한 이 솔루션은 테스트를 거쳤습니다. 18.04 및 16.04에서 문제가 없습니다. 20.04 Ubuntu 버전은 올바른 경로여야 할 수 있습니다 python2.7改成python3.0.


1. 먼저 다음 웨어하우스의 내용을 로컬에 복제합니다.

방법 1:
csdn 리소스 에서 직접 rosdistro를 다운로드 합니다
. 방법 2:

git clone https://github.com/ros/rosdistro.git

방법 3: git 복제 속도가 느린 경우 다운로드할 웹 페이지에 https://github.com/ros/rosdistro.git
을 직접 복사 하면 속도가 향상 되지만 다운로드를 변경하는 것을 기억해야 합니다. 패키지 이름 rosdistro-master에서 rosdistro로

rosdistro의 저장 주소를 기록해 두십시오.예를 들어, /home/LiFeiHong/rosdistro
자신의 것으로 변경 하면 사용자 이름 /home/user/rosdistrouser나타냅니다.이러한 변경 사항은 다음과 같습니다.

2. /usr/lib/python2.7/dist-packages/rosdep2/rep3.py파일 수정

cd /usr/lib/python2.7/dist-packages/rosdep2 
sudo gedit rep3.py

참고: rosdep2 폴더로 이동할 수 없는 경우 usr 폴더에서 직접 rep3.py를 검색하십시오. 해당 경로를 찾을 수 있으며 다음 방법도 동일합니다.
REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'을 첫 번째 복제 콘텐츠의 저장 주소인 REP3_TARGETS_URL = 'file:///home/LiFeiHong/rosdistro/releases/targets.yaml'
교체 /home/LiFeiHong으로 바꿉니다.

3. /usr/lib/python2.7/dist-packages/rosdistro/__init__.py파일 수정

cd /usr/lib/python2.7/dist-packages/rosdistro
sudo gedit __init__.py

원본 파일의 DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'을 DEFAULT_INDEX_URL = 'file:///home/LiFeiHong/rosdistro/index-v4.yaml'
교체 /home/LiFeiHong으로 교체합니다. 이는 첫 번째 복제 콘텐츠의 저장 주소입니다.

4. 구성 20-default.list파일

/etc/ros/rosdep/sources.list.d 경로를 보면 이미 20개의 default.list 파일이 있습니다(sudo rosdep init가 이전에 실행된 이유) 4.1. 단계를 건너뛰고 4.2 단계, -----------------------======

4.1, sources.list.d 폴더를 만들고 20-default.list 파일을 생성합니다.

 sudo mkdir -p /etc/ros/rosdep/sources.list.d  

20-default.list 생성

cd /etc/ros/rosdep/sources.list.d  
sudo touch 20-default.list 

/etc/ros/rosdep/sources.list.d/20-default.list 파일이 여기에 생성되었습니다-----=======

4.2 20-default.list 파일을 열고 내용을 다음 코드로 수정합니다. /home/LiFeiHong 내용은 자신의 레코드 경로로 수정됩니다.

sudo gedit /etc/ros/rosdep/sources.list.d/20-default.list

내용을 다음과 같이 변경합니다.

# 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

yaml file://고정 형식 은 파일 디렉토리 /home...나타내므로yaml file:///

5. 라스트 다이렉트

rosdep update

지도 제작자에게 간단한 설치 튜토리얼
링크 제공: https://blog.csdn.net/weixin_44023934/article/details/95006421

추천

출처blog.csdn.net/weixin_44023934/article/details/121242176