之前在笔记本上面安装ros的时候还挺顺利安装好了,但是往jetson-tx2上面安装时出现了几个错误,搜集了很多资料,安装了大半天才弄好,先记录下来。
1 安装ros
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
roscore
2 遇到问题
问题1: 执行sudo apt-get install ros-kinetic-desktop-full时出现错误:
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies:
cuda-runtime-9-0 : Depends: cuda-drivers (>= 384.00) but it is not installable
ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed
Depends: ros-kinetic-perception but it is not going to be installed
Depends: ros-kinetic-simulators but it is not going to be installed
Depends: ros-kinetic-urdf-tutorial but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
解决:
sudo apt-get update && sudo apt-get install -f && sudo dpkg --configure -a
问题2: 执行命令sudo rosdep init时提示错误:
ERROR: cannot download default sources list from: https://raw.github.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
解决:
是因为网络原因不能打开上面网址,所以无法得到下载的文件。所以我的处理方法是在另外一台有VPN的电脑上将这个网址打开,然后直接将内容保存到/etc/ros/rosdep/sources.list.d/20-default.list中。
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
OK,再执行sudo rosdep init时提示已经存在。