Ubuntu18.04의 ROS 시스템에서 sudo rosdep init 및 rosdep update 실패를 해결하는 방법 (실제 테스트는 매우 유용합니다!)

1. sudo rosdep init 입력 시 sudo: rosdep: command not found 문제 발생

해결 방법: 해당 패키지를 설치합니다.

sudo apt-get install python-rosdep

2. sudo rosdep init를 입력하고 ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list 웹사이트가 다운되었을 수 있습니다.

해결책: 이전에 설치된 패키지 제거

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

3. rosdep 업데이트를 통해 /etc/ros/rosdep/sources.list.d에서 소스 목록 데이터 읽기 https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml 조회 ://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml 오류: 소스 목록 로드 오류: ('읽기 작업 시간 초과',)

솔루션: 일부 기능을 수정하십시오.

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

파일을 연 후 Ctrl+F를 눌러 download_rosdep_data 함수를 찾아 함수의 첫 줄에 추가합니다.

url="https://ghproxy.com/"+url

동일한 방식으로 /usr/lib/python2.7/dist-packages/rosdistro/__init__.py에서 DEFAULT_INDEX_URL을 수정합니다.

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

파일을 연 후 Ctrl+F를 눌러 DEFAULT_INDEX_URL을 찾아 다음과 같이 변경합니다.

DEFAULT_INDEX_URL = 'https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'

이제 rosdep update를 다시 입력하면 작동합니다!

추천

출처blog.csdn.net/m0_74923682/article/details/129405081