【Ubuntu20.04+ros-noetic】乐成+多种踩坑问题办理
一、装ROS的一般步骤1、添加安装ROS的软件源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
2、添加密钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
https://i-blog.csdnimg.cn/direct/ce850fbdfe804bbfad3b4d453f49dd32.png#pic_center
3、更新软件源
更新前面添加的ROS软件源,否则会找不到安装包(E: 无法定位软件包 ros-noetic-desktop-full),更新软件源即可:
sudo apt update
https://i-blog.csdnimg.cn/direct/cf06f8e56ddc4f309c6af32e42649225.png#pic_center
4、安装ROS
根据Ubuntu的差别版本选择差别版本的ROS,20.04对应的是noetic版本
执行该指令的时间有点长。
sudo apt install ros-noetic-desktop-full
https://i-blog.csdnimg.cn/direct/c7cec710fef947aa95bd050fdeda1cd9.png#pic_center
5、初始化rosdep
这一步很考验网络质量,最好是科学上网;
大概没有乐成就多试几次
sudo rosdep init
rosdep update
(2)若出现如下问题:ERROR: cannot download default sources list from……,
https://i-blog.csdnimg.cn/direct/a3eb5ed786ad48a982a13d13aef2e481.png#pic_center
办理方法如下详见 本文之后,世上再无rosdep更新失败问题!如果有…小鱼就…,
给上文概括一下,按序次,只要不行就执行下一条指令:
sudo pip install rosdepc
sudo pip3 install rosdepc
sudo apt-get install python3-pip
sudo pip install rosdepc
然后替换rosdep为rosdepc
sudo rosdepc init
rosdepc update
执行效果截图:
https://i-blog.csdnimg.cn/direct/6dc3f57641e44d54bca5609a02c261f3.png#pic_center
https://i-blog.csdnimg.cn/direct/f97148d6abc04f56813b24cf69146259.png#pic_center
6、导入环境变量
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7、测试roscore
roscore
出现如下报错:
https://i-blog.csdnimg.cn/direct/632365d53d244ada9ce1f81fb0b2e6ec.png#pic_center
按提示执行:
#按提示后面会报错:sudo apt install python3-roslaunch
sudo apt-get install ros-noetic-roslaunch
#纠正后的
又出错:
https://i-blog.csdnimg.cn/direct/90f644a3ad8c4b1f820f464e224585ae.png#pic_center
按提示执行:
sudo apt install python3-roslaunch --fix-missing
如果sudo apt install python3-roslaunch,重新执行roscore
出现如下报错:
https://i-blog.csdnimg.cn/direct/cef9b80896ab4592a19db053eccf2fce.png#pic_center
重新安装roslaunch:
sudo apt-get install ros-noetic-roslaunch
https://i-blog.csdnimg.cn/direct/f1517a141acc4f5e9430b260bd38be6d.png#pic_center
运行roscore
,乐成!!!!!
https://i-blog.csdnimg.cn/direct/d7f52f74c5574151b8c453cb6d0245bd.png#pic_center
二、问题总结:
1、ERROR: cannot download default sources list from……
见本文一5(2)
2、Command ‘roscore
’ not found,but can be installed with:
sudo apt-get install ros-noetic-roslaunch
3、Resource not found: roslaunch
若按提示安装python3-roslaunch会出现如下错误,按 2 的方法安装
https://i-blog.csdnimg.cn/direct/cef9b80896ab4592a19db053eccf2fce.png#pic_center
三、参考文章
本文之后,世上再无rosdep更新失败问题!如果有…小鱼就…
一站式办理Ubuntu20.04安装ROS的问题
【ROS】在 Ubuntu 20.04 安装 ROS 的具体教程
sudo rosdep init找不到下令或失败办理办法
Resource not found: roslaunch的办理方法
ros wiki官网:Ubuntu install of ROS Noetic
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]