【Ubuntu-ROS】ubuntu16.04(18.04)ROS安装配置与卸载
1. 查看是否已經(jīng)安裝ROS
打開一個(gè)terminal控制臺(tái),直行 roscore 命令,若控制臺(tái)有以下信息輸出,則表示ros已經(jīng)安裝了
... logging to /home/idriver/.ros/log/d23fdef6-e74e-11ea-bf67-54e1add314e0/roslaunch-idriver-hmj-5401.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.started roslaunch server http://idriver-hmj:38477/ ros_comm version 1.12.14SUMMARY ========PARAMETERS* /rosdistro: kinetic* /rosversion: 1.12.14NODESauto-starting new master process[master]: started with pid [5414] ROS_MASTER_URI=http://idriver-hmj:11311/setting /run_id to d23fdef6-e74e-11ea-bf67-54e1add314e0 process[rosout-1]: started with pid [5428] started core service [/rosout]2. 安裝ROS
按照以下步驟進(jìn)行安裝,參照
ubuntu 16.04/18.04安裝ros文檔
1. 添加國(guó)內(nèi)源
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’
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
2. 添加公鑰
sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key
3. 更新包索引
sudo apt update
4. 安裝ROS
18.04對(duì)應(yīng)版本
sudo apt install ros-melodic-desktop-full
16.04對(duì)應(yīng)版本
sudo apt-get install ros-kinetic-desktop-full
5. 初始化ROS
sudo rosdep init
rosdep update
【Q1】沒有rosdep解決辦法
sudo apt-get install python-rosdep
【Q2】無(wú)法rosdep ping raw.githubusercontent.com 解析為127
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
常見的解決方法:
修改hosts文件 ( sudo vim /etc/hosts)
199.232.68.133 raw.githubusercontent.com
【PS】如果持續(xù)報(bào)出 timeout 問題,并且已經(jīng)嘗試各種配置,那么可以確認(rèn),你的系統(tǒng)無(wú)法鏈接到更新的地址;我們使用gitee的地址來(lái)update吧,即舍棄 rosdep 初始化方法,擁抱rosdepc初始化,操作如下:
sudo pip3 install rosdepc
sudo rosdepc init
rosdep update
經(jīng)過以上一番折騰,應(yīng)該可以rosdep update了
6. 添加環(huán)境變量
ubuntu 18.04
echo “source /opt/ros/melodic/setup.bash” >> ~/.bashrc
source ~/.bashrc
ubuntu 16.04
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
source ~/.bashrc
7. 安裝相關(guān)基礎(chǔ)依賴
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
至此,ros安裝成功,可以使用運(yùn)行roscore進(jìn)行驗(yàn)證
8. 卸載 ROS
sudo apt-get purge ros-*
sudo rm -rf /etc/ros
sudo gedit ~/.bashrc
清除bashrc中配置的ros路徑
經(jīng)過以上步驟,完美卸載ROS
總結(jié)
以上是生活随笔為你收集整理的【Ubuntu-ROS】ubuntu16.04(18.04)ROS安装配置与卸载的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 最全JavaScript学习总结(Jav
- 下一篇: 【Ubuntu-Docker】ubunt