ROS Navigation Stack

Table of Contents

1. 从不同层次控制机器人移动

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).

在 ROS 中,可以从不同的层次来控制机器人的移动,由低层到高层分别有:
(1) Motor Controllers and Drivers
(2) The ROS Base Controller (Proportional Integral Derivative, PID)
(3) Frame-Base Motion using the move_base ROS Package
(4) SLAM using the gmapping and amcl ROS Packages
(5) Semantic Goals

关于各个层次的说明,可参考:ROS by Example, Volume 1, for ROS Indigo, Chapter 7. Controlling A Mobile Base

总结:ROS 中控制机器人移动的不同层次可用图 1 表示。

ROS_nav_motion_control_hierarchy.png

Figure 1: ROS motion control hierarchy

2. move_base 包(Setup Navigation Stack)

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.

ROS_nav_stacks.gif

Figure 2: A high-level view of the move_base node and its interaction with other components

从图 2 可知,move_base 依赖于其它一些节点(图中蓝色节点),要使 move_base 正常工作,我们必须提供:
(1) 传感器的坐标(通过 tf 进行坐标转换,这样知道机器人的坐标就相当于知道传感器坐标了)。
(2) 里程计数据(常通过编写一个发布 nav_msgs/Odometry 信息的节点来实现)
(3) 导航传感器数据(常通过编写一个发布 sensor_msgs/LaserScan 或者 sensor_msgs/PointCloud 信息的节点来实现)。

参考:
http://wiki.ros.org/navigation/Tutorials/RobotSetup
http://blog.csdn.net/hcx25909/article/details/9334231

2.1. 里程计(odometry)数据

什么是“里程计(odometry)数据”?里程计数据是机器人到某一固定点的距离。在这里,它是机器人底盘到坐标系 odom 的距离。

用下面命令可以查看消息 nav_msgs/Odometry 的结构:

$ rosmsg show nav_msgs/Odometry
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string child_frame_id
geometry_msgs/PoseWithCovariance pose
  geometry_msgs/Pose pose
    geometry_msgs/Point position
      float64 x
      float64 y
      float64 z
    geometry_msgs/Quaternion orientation
      float64 x
      float64 y
      float64 z
      float64 w
  float64[36] covariance
geometry_msgs/TwistWithCovariance twist
  geometry_msgs/Twist twist
    geometry_msgs/Vector3 linear
      float64 x
      float64 y
      float64 z
    geometry_msgs/Vector3 angular
      float64 x
      float64 y
      float64 z
  float64[36] covariance

2.2. 导航传感器数据

要用 move_base 实现导航,需要发布传感器数据(sensor_msgs/LaserScan 或者 sensor_msgs/PointCloud)。这是不介绍。

参考:
http://www.cnblogs.com/zxouxuewei/p/5285677.html
http://blog.csdn.net/hcx25909/article/details/9470297
http://wiki.ros.org/navigation/Tutorials/SendingSimpleGoals

Author: cig01

Created: <2016-06-10 Fri>

Last updated: <2017-12-10 Sun>

Creator: Emacs 27.1 (Org mode 9.4)