1、ROS 简单介绍
在ROS的官方网站,对于ROS的介绍也算是很通俗易懂的:
What is ROS?
The Robot Operating System (ROS) is a set of software libraries and tools that help you build robot applications. From drivers to state-of-the-art algorithms, and with powerful developer tools, ROS has what you need for your next robotics project. And it's all open source.
ROS作为一个使用广泛的机器人操作系统框架,目前数百个研究团队和公司将其应用到机器人行业中。ROS是一个机器人软件平台,但不是唯一的;我个人觉得ROS更像一个机器人工具库,它的框架便于我们对它进行开发使用,提高了我们制作机器人的效率。
对于ROS的介绍,推荐一些优秀的博文:
基本上通过学习上述资料,你对ROS应该有一定的了解。根据我个人的意见,学习要多动脑、勤动手,学习ROS也一样,多去思考理解ROS程序的运行过程,对学习ROS事半功倍。
学习ROS第一步就是安装ROS,这个可以参阅:ROS Kinetic installation instructions
安装ROS需要依赖一个操作系统,我个人比较喜欢使用Ubuntu,我使用的一整套环境是:树莓派3 + Ubuntu Mate16.04,安装过程参照ROS官网的步骤。
安装成功后,可以使用rosdep命令测试一下。如果rosdep命令存在,即为安装成功。
2、ROS安装
ROS根据官网的文档安装,新手同学我们就推荐使用Ubuntu系统吧,毕竟用的人多,系统资源也比较丰富;不过要注意一点的是:对应版本的Ubuntu系统需要安装对应版本的ROS。
Ubuntu版本 | ROS版本 | 安装说明连接 |
Ubuntu Wily (15.10) Ubuntu Xenial (16.04 LTS) | ROS Kinetic Kame | http://wiki.ros.org/kinetic/Installation |
Ubuntu Trusty (14.04 LTS) | ROS Indigo | http://wiki.ros.org/indigo/Installation |
Ubuntu Artful (17.10) Ubuntu Bionic (18.04 LTS) | ROS Melodic Morenia | http://wiki.ros.org/melodic/Installation |
Ubuntu Zesty(17.04) Ubuntu Xenial (16.04 LTS) | ROS Lunar Loggerhead | http://wiki.ros.org/lunar/Installation |
Ubuntu Focal (20.04 LTS) | ROS Noetic Ninjemys | http://wiki.ros.org/indigo/Installation |
ROS安装过程中,会涉及到ROS包的下载,直接使用ROS的源,下载速度不是很理想,所以我们在决定安装ROS
的时候,先添加ROS的国内源,然后再进行进一步的安装,操作就跟着我的步骤走,应该问题不大:
我当前及其的系统是Ubuntu 20.04 LTS, 所以我安装的是 ROS Noetic Ninjemys!
第一步:替换国内源
# 命令1:添加源
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'
# 命令2:添加apt-key
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
第二步:安装
# 1、重新拉取包
sudo apt-get update
# 2、安装
sudo apt install ros-noetic-desktop-full
第三步:环境变量的配置
# 1、临时配置
source /opt/ros/noetic/setup.bash
# 2、写到.bashrc中
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
做完上面这些步骤,在命令终端中,输入ros,按tab键你就能看到一堆ros的命令了
新人安装,你想好好玩一玩ROS,我推荐你使用ubuntu系统,最好是一个独立的Ubuntu系统,而不是虚拟机;同时建议安装ROS的全部package,也就是:ros-noetic-desktop-full ,后续进一步深入了,你再移植到嵌入式系统中,定制化你想要的内容。
安装结束,探索开始……