国内清华的安装源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
设置key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
更新apt
sudo apt update
sudo apt install ros-melodic-desktop-full
配置环境变量,方便在任意 终端中使用 ROS
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
安装构建依赖的相关工具
sudo apt install python-rosdep
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
###解决rosdep update问题
.先打开资源备份路径:https://gitee.com/zhao-xuzuo/rosdistro,打开 rosdistro/rosdep/sources.list.d/20-default.list文件留作备用(主要是复用URL的部分内容:gitee.com/zhao-xuzuo/rosdistro/raw/master)。
![在这里插入图片描述](https://img-blog.csdnimg.cn/e90f98acda714972a58fb4a2145be063.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3oxODcyMzg1,size_16,color_FFFFFF,t_70#pic_center)
2.进入"/usr/lib/python3/dist-packages/" 查找rosdep中和raw.githubusercontent.com相关的内容,调用命令:
find . -type f | xargs grep "raw.githubusercontent"
![在这里插入图片描述](https://img-blog.csdnimg.cn/d2385f452d5b4a6d9647ef124ab1de3f.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3oxODcyMzg1,size_16,color_FFFFFF,t_70#pic_center)
3.修改相关文件,主要有: ./rosdistro/__init__.py、./rosdep2/gbpdistro_support.py、./rosdep2/sources_list.py 、./rosdep2/rep3.py。可以使用sudo gedit命令修改文件:
文件中涉及的 URL 内容,如果是:raw.githubusercontent.com/ros/rosdistro/master都替换成步骤1中准备的gitee.com/zhao-xuzuo/rosdistro/raw/master即可。
修改完毕,再重新执行命令:
sudo rosdep init
rosdep update
自用笔记-ROS_melodic安装
最新推荐文章于 2023-08-29 09:11:42 发布