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
添加以下内容保存即可
199.232.28.133 raw.githubusercontent.com
151.101.228.133 raw.github.com
5、安装rosinstall
sudo apt-get install python-rosinstall
6、添加ros环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
完成了