![](/style/images/good.png)
![](/style/images/bad.png)
Ubuntu18.04 ROS安装完整
source link: https://blog.51cto.com/u_15723398/5488508
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
参考来源:
(12条消息) Ubuntu18.04安装ROS_PanJie_的博客-CSDN博客_ubuntu18.04安装ros
(12条消息) rosdep update 超时失败2021最新解决方法_WGH无疆的博客-CSDN博客_rosdep update 超时
1.添加源
Ctrl+Alt+T打开终端,Ctrl+Shift+V粘贴输入指令,回车,然后输入密码
![Ubuntu18.04 ROS安装完整_rosdep init解决](https://s2.51cto.com/images/202207/8351465258c34b3de29429664521a3c6cea983.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
2.添加密钥
![Ubuntu18.04 ROS安装完整_rosdep init解决_02](https://s2.51cto.com/images/202207/36cf87b5439276c210c498acf53e6278bd7aef.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
3.1更新软件源
![Ubuntu18.04 ROS安装完整_rosdep init解决_03](https://s2.51cto.com/images/202207/43e94f8242577c5d370140a7c07c4010937a22.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
如果出现上面这种情况,即更新中有错误,应该是网络问题,可以换个网络再更新一次
![Ubuntu18.04 ROS安装完整_ROS安装_04](https://s2.51cto.com/images/202207/28d0b0a39349c215b962411c36fe62df584347.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
3.2安装桌面完整版(建议在网速较好的情况下安装)
![Ubuntu18.04 ROS安装完整_ubuntu_05](https://s2.51cto.com/images/202207/b7963ee5588bfa9a28b912f859fedd8ee954b7.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
如果下载未成功可以多下载几次
![Ubuntu18.04 ROS安装完整_rosdep update问题解决_06](https://s2.51cto.com/images/202207/981a360331758c48d321079470fff68ccaa838.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
4.设置环境变量
5.安装rosinstall
![Ubuntu18.04 ROS安装完整_rosdep update问题解决_08](https://s2.51cto.com/images/202207/243504547d64464b2e989058fce970b52b4a4a.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
6.安装rosdep
6.1安装rosdep
6.2初始化rosdep
rosdep init报错问题
![Ubuntu18.04 ROS安装完整_ROS安装_09](https://s2.51cto.com/images/202207/5329afb78293d3f669f714a1687c6c123383ea.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
解决方案:
查询raw.githubusercontent.com的IP地址并复制下来
![Ubuntu18.04 ROS安装完整_ubuntu_10](https://s2.51cto.com/images/202207/9976a070503e559052f1200565d16e68486ba3.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
打开终端输入
将ip 与网址粘贴在第三行
![Ubuntu18.04 ROS安装完整_ROS安装_11](https://s2.51cto.com/images/202207/195cc2087e5dcb902b675180f66c3c4359d28d.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
重新输入rosdep init
若出现以下错误
![Ubuntu18.04 ROS安装完整_ubuntu_12](https://s2.51cto.com/images/202207/a96040c61e784ebffb71948be3f58bd8c039c3.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
输入以下命令
再输入rosdep init
![Ubuntu18.04 ROS安装完整_rosdep init解决_13](https://s2.51cto.com/images/202207/44850da419d1e12f7aa511a9613fd284d042a2.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
6.3更新rosdep
出现错误多输入几次,也可以换网络
rosdep update有效解决方法
一直报错可使用以下方法:
①打开/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
将url="https://ghproxy.com/"+url加入到download_rosdep_data()函数中
![Ubuntu18.04 ROS安装完整_ubuntu_15](https://s2.51cto.com/images/202207/593958b814d50b32c7457510899ec9ae0a9ee7.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
②在以下文件中将https://ghproxy.com/添加到https://raw.githubusercontent.com前
/usr/lib/python2.7/dist-packages/rosdistro/__init__.py
/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
/usr/lib/python2.7/dist-packages/rosdep2/rep3.py
/usr/lib/python2.7/dist-packages/rosdistro/manifest_provider/github.py
![Ubuntu18.04 ROS安装完整_ubuntu_16](https://s2.51cto.com/images/202207/67f446a27d3c55be6985787933c44c03fc8dba.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
![Ubuntu18.04 ROS安装完整_ubuntu_17](https://s2.51cto.com/images/202207/6534d8e07d44396ff78078ea77493545728b87.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
![Ubuntu18.04 ROS安装完整_ubuntu_18](https://s2.51cto.com/images/202207/f69ce026603b1d07c8f395d47b951826873953.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
![Ubuntu18.04 ROS安装完整_rosdep init解决_19](https://s2.51cto.com/images/202207/856383052d476fe53040522c8f8363487d1066.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
![Ubuntu18.04 ROS安装完整_rosdep init解决_20](https://s2.51cto.com/images/202207/b125dfa362a63aa12c580347e77d70ef91c5f5.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
![Ubuntu18.04 ROS安装完整_rosdep update问题解决_21](https://s2.51cto.com/images/202207/17042aa4511cb2513f9585fe686c7f6df6428e.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
③打开/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
在以下位置添加gbpdistro_url = "https://ghproxy.com/" + gbpdistro_url
![Ubuntu18.04 ROS安装完整_ROS安装_22](https://s2.51cto.com/images/202207/254f891646afd416a29754768a4c6db6e552ff.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
最后执行rosdep update能一次性过
没有ERROR就ok了
![Ubuntu18.04 ROS安装完整_ubuntu_23](https://s2.51cto.com/images/202207/81920490740de39ca9e026de5c091d5e7ab830.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
7.测试安装——小乌龟
打开一个终端,启动ROS Master:
![Ubuntu18.04 ROS安装完整_rosdep init解决_24](https://s2.51cto.com/images/202207/39017741630ffce9074101b21c44aa0c61a4b3.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
打开另一个终端,启动小海龟仿真器:
![Ubuntu18.04 ROS安装完整_rosdep init解决_25](https://s2.51cto.com/images/202207/a48d92345fc84af74fa656dd0640117e0870da.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
再打开一个终端,启动海龟控制节点
![Ubuntu18.04 ROS安装完整_ROS安装_26](https://s2.51cto.com/images/202207/b671fc8477a6c39f6d59239e0c49c7492fe1af.png?x-oss-process=image/watermark,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=,x-oss-process=image/resize,m_fixed,w_1184)
在最后一个终端内按上下左右键便可控制海龟运动
emmmmm前面涂了个寂寞
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK