1、更換源:
聽說TX2國內的源沒有做ros的,反正我更換清華源和科大的源都不能安裝,最后換回自帶的源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
2、設置最新的密鑰:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
3、安裝:
sudo apt-get update sudo apt-get install ros-melodic-desktop-full sudo apt-get install ros-melodic-rqt*
4、初始化ROS
sudo apt install python-rosdep sudo rosdep init rosdep update
如果出現下面情況,基本是網絡問題,換個網絡嘗試下(PS:我用手機熱點解決的):
ubuntu@ubuntu-d:~$ sudo rosdep init 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 Ubuntu直接在終端輸入
sudo gedit /etc/hosts
添加以下內容保存即可
151.101.84.133 raw.githubusercontent.com
5、安裝rosinstall
sudo apt-get install python-rosinstall
6、添加ros環境變量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
完成了