ROS初探--意义、基本模块
顾虑就使我们都变成了懦夫,使得那果断的本色蒙上了一层思虑的惨白的容颜,本来可以做出伟大的事业,由于思虑就化为乌有了,丧失了行动的能力。-----哈姆雷特
ROS: Robot Operating System. 全球网站:http://www.ros.org/
Q&A: https://answers.ros.org/questions/
介绍安装、使用方法的wiki: http://wiki.ros.org/
The Robot Operating System (ROS) is a flexible framework for writing robot software. It is a collection of tools, libraries, and conventions that aim to simplify the task of creating complex and robust robot behavior across a wide variety of robotic platforms.
Why? Because creating truly robust, general-purpose robot software is hard. From the robot's perspective, problems that seem trivial to humans often vary wildly between instances of tasks and environments. Dealing with these variations is so hard that no single individual, laboratory, or institution can hope to do it on their own.
As a result, ROS was built from the ground up to encourage collaborative robotics software development. For example, one laboratory might have experts in mapping indoor environments, and could contribute a world-class system for producing maps. Another group might have experts at using maps to navigate, and yet another group might have discovered a computer vision approach that works well for recognizing small objects in clutter. ROS was designed specifically for groups like these to collaborate and build upon each other's work, as is described throughout this site.
ROS的一些功能模块:
http://www.ros.org/core-components/
1)Robot Description Language
Another common robotics problem that ROS solves for you is how to describe your robot in a machine-readable way. ROS provides a set of tools for describing and modeling your robot so that it can be understood by the rest of your ROS system, including tf, robot_state_publisher, and rviz. The format for describing your robot in ROS is URDF (Unified Robot Description Format), which consists of an XML document in which you describe the physical properties of your robot, from the lengths of limbs and sizes of wheels to the locations of sensors and the visual appearance of each part of the robot.
Once defined in this way, your robot can be easily used with the tf library, rendered in three dimensions for nice visualizations, and used with simulators and motion planners
看来可以写URDF格式的文件来描述自己的机器人,然后ROS的其他模块可以解析读取,并做建模,仿真。2)Standard Robot Messages
Years of community discussion and development have led to a set of standard message formats that cover most of the common use cases in robotics. There are message definitions for geometric concepts like poses, transforms, and vectors; for sensors like cameras, IMUs and lasers; and for navigation data like odometry, paths, and maps; among many others. By using these standard messages in your application, your code will interoperate seamlessly with the rest of the ROS ecosystem, from development tools to libraries of capabilities.
ROS对机器人的各种消息的格式做了统一的规定,如果个人在开发自己的机器人模块时,也使用这种格式,那么自己开发的模块可以与现成的ROS其他功能模块很好地对接。
3)Robot Geometry Library
A common challenge in many robotics projects is keeping track of where different parts of the robot are with respect to each other. For example, if you want to combine data from a camera with data from a laser, you need to know where each sensor is, in some common frame of reference. This issue is especially important for humanoid (美 [ˈhjuməˌnɔɪd] )robots(人形机) with many moving parts. We address this problem in ROS with the tf (transform) library, which will keep track of where everything is in your robot system.
Designed with efficiency in mind, the tf library has been used to manage coordinate transform data for robots with more than one hundred degrees of freedom and update rates of hundreds of Hertz. The tf library allows you to define both static transforms, such as a camera that is fixed to a mobile base, and dynamic transforms, such as a joint in a robot arm. You can transform sensor data between any pair of coordinate frames in the system. The tf library handles the fact that the producers and consumers of this information may be distributed across the network, and the fact that the information is updated at varying rates.
tf库是个好东西啊,看来可以直接用它来进行机械臂各个关节的相对位置控制。 总之,tf的作用是可以统一协调机器人的各个组成部分,应该是将他们放在各个坐标系中,然后进行坐标转换。 至于,tr对相机玩位置信息的处理,我没有用过,还没有概念。4)Preemptable(抢占式) Remote Procedure Calls
While topics (anonymous publish/subscribe) and services (remote procedure calls) cover most of the communication use cases in robotics, sometimes you need to initiate a goal-seeking behavior, monitor its progress, be able to preempt it along the way, and receive notification when it is complete.
ROS provides actions for this purpose. Actions are like services except they can report progress before returning the final response, and they can be preempted by the caller. So, for example, you can instruct your robot to navigate to some location, monitor its progress as it attempts to get there, stop or redirect it along the way, and be told when it has succeeded (or failed). An action is a powerful concept that is used throughout the ROS ecosystem.
该部分讲的时机器人控制中的通信策略,提出了一种特殊的功能:当发送一个指令后,可以追踪指令的执行状态,并可以取消指令,牛掰!
补充::点击打开链接
" 观察者(Observer)模式是对象的行为型模式,又叫做发表-订阅(Publish/Subscribe)模式、模型-视图(Model/View)模式、源-收听者(Source/Listener)模式或从属者(Dependents)模式。 当某件事情发生时,有多个应用需要知道该事件发生并作出相应的反映。
Solution: Enable listening applications to subscribe to specific messages. Create a mechanism that sends messages to all interested subscribers. The three variations of the Publish/Subscribe pattern you can use to create a mechanism that sends messages to all interested subscribers are List-Based Publish/Subscribe, Broadcast-Based Publish/Subscribe, and Content-Based Publish/Subscribe.
内核中使用的notification 机制就是基于List-Based Publish/Subscribe(将观察者都放到一个链表中)。“
5)Diagnostics--- 故障诊断
ROS provides a standard way to produce, collect, and aggregate diagnostics about your robot so that, at a glance, you can quickly see the state of your robot and determine how to address issues as they arise.
6)Pose Estimation, Localization, and NavigationROS also provides some "batteries included" capabilities that help you get started on your robotics project. There are ROS packages that solve basic robotics problems like pose estimation, localization in a map, building a map, and even mobile navigation.
Whether you are an engineer looking to do some rapid research and development, a robotics researcher wanting to get your research done in a timely fashion, or a hobbyist looking to learn more about robotics, these out-of-the-box capabilities will help you do more, with less effort.
一句话,提供了 姿态估计,定位,导航,现成的工具包或方案,帮助开发着快速实现想法。7)Tools,Command-Line Tools
强大的开发,调试工具!也可以用命令行,远程登陆ROS,全部用强大的命令行来完成工作。
8)rviz ------强大的数据可视化工具,包括消息,camera信息可视化。
Perhaps the most well-known tool in ROS, rviz provides general purpose, three-dimensional visualization of many sensor data types and any URDF-described robot.
rviz can visualize many of the common message types provided in ROS, such as laser scans, three-dimensional point clouds, and camera images. It also uses information from the tf library to show all of the sensor data in a common coordinate frame of your choice, together with a three-dimensional rendering of your robot. Visualizing all of your data in the same application not only looks impressive, but also allows you to quickly see what your robot sees, and identify problems such as sensor misalignments or robot model inaccuracies.
9)rqtROS provides rqt, a Qt-based framework for developing graphical interfaces for your robot.