前言
系统环境是Ubuntu 16.04,每完成一大步,将会把系统的完整镜像(VM Ware导出的虚拟机)发布到Github与Gitee,供使用。因为安装环境,本身是很耗费时间的,安装过程亦参考了网上很多的文章,踩了很多的坑,本系列旨在填坑,让后来人可以集中精力做实际的开发、学习。
每步会有步骤说明,命令的输出如果太多,就省略不再贴出来。
使用的设备是 Livox Horizon + 大华(Dahua) DH-IPC-HFW2433M-LED
安装ROS
ROS 官方安装步骤(需科学上网)
ningdr@ubuntu:~$ echo ===========第一步===========
ningdr@ubuntu:~$ 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] password for ningdr:
ningdr@ubuntu:~$ echo ===========第二步===========
ningdr@ubuntu:~$ sudo apt update
....... 输出省略.........
Reading package lists... Done
Building dependency tree
Reading state information... Done
181 packages can be upgraded. Run 'apt list --upgradable' to see them.
ningdr@ubuntu:~$ echo ===========第三步===========
ningdr@ubuntu:~$ sudo apt install ros-kinetic-desktop-full
....... 输出省略.........
The following packages will be upgraded:
libcurl3 libcurl3-gnutls libfreetype6 libglib2.0-0 libglib2.0-bin libgssapi-krb5-2 libjasper1 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 libssl1.0.0 libtiff5 libudev1 libx11-6 libx11-xcb1 udev
17 upgraded, 864 newly installed, 0 to remove and 164 not upgraded.
Need to get 466 MB of archives.
After this operation, 2,458 MB of additional disk space will be used.
....... 这里输入y,等待下载安装.........
Do you want to continue? [Y/n] y
ningdr@ubuntu:~$ echo ===========第四步===========
ningdr@ubuntu:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
rosdep update
ningdr@ubuntu:~$
ningdr@ubuntu:~$ echo ===========第五步===========
# 报错的话切换一下科学上网的节点
ningdr@ubuntu:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/ningdr/.ros/rosdep/sources.cache
ningdr@ubuntu:~$
ningdr@ubuntu:~$ echo ===========第六步===========
ningdr@ubuntu:~$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
ningdr@ubuntu:~$ source ~/.bashrc
ningdr@ubuntu:~$
ningdr@ubuntu:~$ echo ===========第七步===========
ningdr@ubuntu:~$ sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
ningdr@ubuntu:~$ echo ===========第八步===========
ningdr@ubuntu:~$ printenv | grep ROS
ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/opt/ros/kinetic/share
ROS_MASTER_URI=http://localhost:11311
ROS_PYTHON_VERSION=2
ROS_VERSION=1
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
ningdr@ubuntu:~$
至此,ROS 安装成功
完整系统镜像,点我下载(解压后登录密码见README.md)