【 rbx1翻译 第七章、控制移动基座】第二节、运动控制级别

7.2 Levels of Motion Control(运动控制级别)

可以在多个级别上控制移动机器人,这些级别中的绝大多数,ROS已经提供了相应的方法。 这些级别代表不同程度的抽象,从对电动机的直接控制开始,一直进行到路径规划和SLAM(同时定位和映射)。
Controlling a mobile robot can be done at a number of levels and ROS provides methods for most of them. These levels represent different degrees of abstraction, beginning with direct control of the motors and proceeding upward to path planning and SLAM (Simultaneous Localization and Mapping).

7.2.1 Motors, Wheels, and Encoders (电动机、车轮和编码器)

大多数运行ROS的差动驱动机器人都在驱动马达或车轮上使用编码器。相应的车轮每转一圈编码器就会记录一定数量的刻度(通常是几百个甚至数千个)。如果知道了车轮的直径及车轮之间的距离,那么编码器刻度可以转换为以米为单位的行进距离或以弧度为单位的旋转角度。 为了计算速度,只需将这些值除以两次测量之间的时间间隔即可。
Most differential drive robots running ROS use encoders on the drive motors or wheels. An encoder registers a certain number of ticks (usually hundreds or even thousands) per revolution of the corresponding wheel. Knowing the diameter of the wheels and the distance between them, encoder ticks can be converted to the distance traveled in meters or the angle rotated in radians. To compute speed, these values are simply divided by the time interval between measurements.

这种内部运动数据统称为里程计,在以后的日子里,我们将会看到,ROS会频繁的使用它。 如果您的机器人具有准确可靠的编码器,并且可以使用其他来源来增加车轮数据,那么它将大有帮助。 例如,因为iRobot Create的编码器在旋转过程中明显不准确,所以原始的TurtleBot使用单轴陀螺仪来提供机器人旋转运动的额外测量,
This internal motion data is collectively known as odometry and ROS makes heavy use of it as we shall see. It helps if your robot has accurate and reliable encoders but wheel data can be augmented using other sources. For example, the original TurtleBot uses a single-axis gyro to provide an additional measure of the robot’s rotational motion since the iRobot Create’s encoders are notably inaccurate during rotations.

重要的是要记住,无论使用了多少里程表数据源,世界上机器人的实际位置和速度都可能(可能会)与里程表报告的值不同。 差异程度将取决于环境条件和里程表来源的可靠性。
It is important to keep in mind that no matter how many sources of odometry data are used, the actual position and speed of the robot in the world can (and probably will) differ from the values reported by the odometry. The degree of discrepancy will vary depending on the environmental conditions and the reliability of the odometry sources.

7.2.2 Motor Controllers and Drivers (电机控制器和驱动器)

在最低运动控制级别,我们需要一个用于机器人电机控制器的驱动程序,该驱动程序可以使驱动轮按照期待的速度旋转,通常使用内部单位,例如每秒的编码器刻度或最大速度的百分比。 除了Willow Garage PR2和TurtleBot之外,核心ROS软件包不包括用于特定电机控制器的驱动程序。 但是,许多第三方ROS开发人员已经发布了一些更流行的控制器和/或机器人的驱动程序,例如Arduino,ArbotiX,Serializer,Element,LEGO®NXT和Rovio。 ( 如果想要获取更完整的支持列表,参阅Robots Using ROS. )
At the lowest level of motion control we need a driver for the robot’s motor controller that can turn the drive wheels at a desired speed, usually using internal units such as encoder ticks per second or a percentage of max speed. With the exception of the Willow Garage PR2 and TurtleBot, the core ROS packages do not include drivers for specific motor controllers. However, a number of third-party ROS developers have published drivers for some of the more popular controllers and/or robots such as the Arduino, ArbotiX, Serializer, Element, LEGO® NXT and Rovio. (For a more complete
list of supported platforms, see Robots Using ROS.)

7.2.3 The ROS Base Controller (ROS基本控制器)

在下一个抽象级别,以实际单位(例如米和弧度/秒)指定机器人的期望速度。 采用某种形式的PID控制也是很常见的。 PID代表“比例积分微分”,之所以这样命名,是因为PID控制算法校正车轮速度不仅根据实际速度和所需速度之间的差异(比例)误差,而且还根据随时间的微分和积分。 您可以在Wikipedia上了解有关PID控制的更多信息。 出于我们的目的,我们只需要知道控制器将尽力按照我们要求的方式移动机器人。
At the next level of abstraction, the desired speed of the robot is specified in real-world units such as meters and radians per second. It is also common to employ some form of PID control. PID stands for “Proportional Integral Derivative” and is so-named because the control algorithm corrects the wheel velocities based not only on the difference (proportional) error between the actual and desired velocity, but also on the derivative and integral over time. You can learn more about PID control on Wikipedia. For our purposes, we simply need to know that the controller will do its best to move the robot in the way we have requested.

驱动程序和PID控制器通常组合在一个称为基本控制器的单个ROS节点内。 基本控制器必须直接在连接到电机控制器的计算机上运行,并且通常是启动机器人时启动的第一个节点之一。 Gazebo中还可以模拟许多基本控制器,包括TurtleBot,PR2和Erratic。
The driver and PID controller are usually combined inside a single ROS node called the base controller. The base controller must always run on a computer attached directly to the motor controller and is typically one of the first nodes launched when bringing up the robot. A number of base controllers can also be simulated in Gazebo including the TurtleBot, PR2 and Erratic.

基本控制器节点通常在 /odom 话题上发布里程计数据,并在 /cmd_vel 话题上监听运动命令。 同时,控制器节点通常(但并非总是)发布从 /odom 框架到基本框架(/ base_link或/ base_footprint)的转换。 我们之所以说“不总是”,是因为某些机器人(例如TurtleBot)使用robot_pose_ekf程序包来组合车轮里程表和陀螺仪数据,以获得对机器人位置和方向的更准确估算。 在这种情况下,是robot_pose_ekf节点发布了从/ odom到/ base_footprint的转换。 (robot_pose_ekf软件包实现了扩展卡尔曼过滤器,您可以在上面链接到的Wiki页面上了解到。)
The base controller node typically publishes odometry data on the /odom topic and listens for motion commands on the /cmd_vel topic. At the same time, the controller node typically (but not always) publishes a transform from the /odom frame to the base frame—either /base_link or /base_footprint . We say “not always” because some robots like the TurtleBot, uses the robot_pose_ekf package to combine wheel odometry and gyro data to get a more accurate estimate of the robot’s position and orientation. In this case, it is the robot_pose_ekf node that publishes the transform from /odom to /base_footprint . (The robot_pose_ekf package implements an Extended Kalman Filter as you can read about on the Wiki page linked to above.)

一旦我们的机器人有了基本控制器,ROS便提供了我们需要的工具,这些工具可以从命令行或其他基于更高级别计划的ROS节点来发布运动命令。 在此级别上,基本控制器与硬件之间的关系就消失了:我们的编程可以完全专注于使用现实世界的单位来设定期望的线速度和角速度,并且我们编写的任何代码都可以在具有ROS接口的任何基本控制器上工作 。
Once we have a base controller for our robot, ROS provides the tools we need to issue motion commands either from the command line or by using other ROS nodes to publish these commands based on a higher level plan. At this level, it does not matter what hardware we are using for our base controller: our programming can focus purely on the desired linear and angular velocities in real-world units and any code we write should work on any base controller with a ROS interface.

7.2.4 Frame-Base Motion using the move_base ROS Package (使用move_base ROS软件包进行基于帧的运动)

在下一个抽象层次上,ROS提供了move_base程序包,该程序包使我们可以指定机器人相对于某个参考系的目标位置和方向。 然后move_base将尝试将机器人移至目标,同时避开障碍物。 move_base软件包是一个非常复杂的路径规划器,在为机器人选择要遵循的路径时,将里程计数据与本地和全局花费图结合在一起。 它还根据我们在配置文件中设置的最小值和最大值自动控制线速度和角速度以及加速度。
At the next level of abstraction, ROS provides the move_base package that allows us to specify a target position and orientation of the robot with respect to some frame of reference; move_base will then attempt to move the robot to the goal while avoiding obstacles. The move_base package is a very sophisticated path planner and combines odometry data with both local and global cost maps when selecting a path for the robot to follow. It also controls the linear and angular velocities and accelerations automatically based on the minimum and maximum values we set in the configuration files.

7.2.5 SLAM using the gmapping and amcl ROS Packages (使用gmapping和amcl ROS软件包的SLAM)

在更高的层次上,ROS使我们的机器人可以使用SLAM gmapping软件包创建其环境的地图。 使用激光扫描仪可以最好地完成映射过程,但也可以使用Kinect或Asus Xtion深度相机完成模拟激光扫描。 如果您拥有TurtleBot,则TurtleBot 的meta-package包含执行SLAM所需的所有工具。
At an even higher level, ROS enables our robot to create a map of its environment using the SLAM gmapping package. The mapping process works best using a laser scanner but can also be done using a Kinect or Asus Xtion depth camera to provide a simulated laser scan. If you own a TurtleBot, the TurtleBot meta-package includes all the tools you need to do SLAM.

一旦获得了环境图,ROS就会提供amcl软件包(自适应蒙特卡洛定位),用于根据机器人的当前扫描和里程计数据自动定位机器人。 这使操作员可以指向并单击地图上的任何位置,而机器人将在避免障碍的同时找到自己的出路。 (要获得关于SLAM的数学基础的出色介绍,请查看Sebastian Thrun关于Udacity的在线人工智能课程。)
Once a map of the environment is available, ROS provides the amcl package (adaptive Monte Carlo localization) for automatically localizing the robot based on its current scan and odometry data. This allows the operator to point and click on any location on a map and the robot will find its way there while avoiding obstacles. (For a superb introduction to the mathematics underlying SLAM, check out Sebastian Thrun’s online Artificial Intelligence course on Udacity.)

7.2.6 Semantic Goals (语义目标)

最后,在最高抽象层次上,在语义上指定运动目标,例如“去厨房为我带来啤酒”,或者简单地为“为我带来啤酒”。 在这种情况下,必须分析语义目标并将其转换为一系列动作。 对于需要机器人移动到特定位置的动作,可以将每个位置传递到本地化和路径规划级别以进行实施。 尽管超出了本卷的范围,但还有许多ROS软件包可用于完成此任务,包括smach,behavior trees,executive_teer 和 Knowrob。 (smach 和 behavior trees都在ROS By Example系列的第2卷中进行了介绍。)
Finally, at the highest level of abstraction, motion goals are specified semantically such as “go to the kitchen and bring me a beer”, or simply, “bring me a beer”. In this case, the semantic goal must be parsed and translated into a series of actions. For actions requiring the robot to move to a particular location, each location can be passed to the localization and path planning levels for implementation. While beyond the scope of this volume, a number of ROS packages are available to help with this task including smach , behavior trees , executive_teer , and knowrob . (Both smach and behavior trees are covered in Volume 2 of the ROS By Example series.)

7.2.7 Summary (总结)

总而言之,我们的运动控制层次结构如下所示:
In summary, our motion control hierarchy looks something like this:
在这里插入图片描述
在本章和下一章中,我们将学习如何使用这些级别的运动控制。 但是,在我们了解move_base,gmapping和amcl提供的更强大的功能之前,我们需要从基础开始。
In this chapter and the next, we will learn how to use these levels of motion control. But before we can understand the more powerful features provided by move_base , gmapping and amcl , we need to start with the basics.

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值