【 rbx1翻译 第七章、控制移动基座】第七节、我们到达了吗?用里程表走向远方

7.7 Are We There Yet? Going the Distance with Odometry (我们到达了吗?用里程表走向远方)

当我们要求机器人以一定速度运动或旋转时,我们如何知道它实际上在按照我们的要求进行操作? 例如,如果我们发布“Twist”消息以使机器人以0.2 m / s的速度向前移动,我们如何知道该机器人并没有以0.18 m / s的速度前进? 实际上,我们如何知道两个车轮都以相同的速度行驶?
When we ask our robot to move or rotate at a certain speed, how do we know that it is actually doing what we asked? For example, if we publish a Twist message to move the robot forward at 0.2 m/s, how do we know that the robot isn’t really going 0.18 m/s? In fact, how do we know that both wheels are even traveling at the same speed?

如本章前面所述,机器人的基本控制器节点使用里程表和PID控制将运动请求转换为真实速度。 此过程的准确性和可靠性取决于机器人的内部传感器,校准过程的准确性以及环境条件。 (例如,某些表面可能会使轮子略微打滑,这会弄乱编码器数量与行进距离之间的映射。)
As we explained earlier in this chapter, the robot’s base controller node uses odometry and PID control to turn motion requests into real-world velocities. The accuracy and reliability of this process depends on the robot’s internal sensors, the accuracy of the calibration procedure, and environmental conditions. (For example, some surfaces may allow the wheels to slip slightly which will mess up the mapping between encoder counts and distance traveled.)

可以通过外部测量机器人的位置和/或方向来补充机器人的内部里程计。 例如,可以将壁挂式视觉标记(例如基准)与ROS软件包ar_pose,ar_kinect或ar_track_alvar一起使用,以对房间内的机器人进行相当准确的定位。 类似的技术还有使用视觉特征匹配的方法,而无需人工标记(ccny_rgbd_tools,rgbdslam,RTABMap),还有另外一种软件包(laser_scan_matcher)则使用激光扫描匹配。 除了其他形式的里程表外,室外机器人还经常使用GPS来估计位置。
The robot’s internal odometry can be supplemented with external measures of the robot’s position and/or orientation. For example, one can use wall-mounted visual markers such as fiducials together with the ROS packages ar_pose , ar_kinect or ar_track_alvar to provide a fairly accurate localization of the robot within a room. A similar technique uses visual feature matching without the need for artificial markers ( ccny_rgbd_tools , rgbdslam , RTABMap ), and yet another package ( laser_scan_matcher ) uses laser scan matching. Outdoor robots often use GPS to estimate position in addition to other forms of odometry.

为了本书的目的,我们将使用术语“里程表”来表示内部位置数据。 但是,无论如何测量里程,ROS都会提供一种消息类型来存储信息,即nav_msgs / Odometry。 里程表消息类型的缩写定义如下所示:
For the purposes of this book, we will use the term “odometry” to mean internal position data. However, regardless of how one measures odometry, ROS provides a message type to store the information; namely nav_msgs/Odometry . The abbreviated definition of the Odometry message type is shown below:

Header header
string child_frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/TwistWithCovariance twist

在这里,我们看到Odometry消息由Header,child_frame_id 字符串和两个二级子消息组成,一个子消息用于PoseWithCovariance,一个子消息用于TwistWithCovariance。【Covariance:协方差】
Here we see that the Odometry message is composed of a Header , a string identifying the child_frame_id , and two sub-messages, one for PoseWithCovariance and one for TwistWithCovariance .

要查看定义的扩展版本,请运行以下命令:
To see the expanded version of the definition, run the command:

rosmsg show nav_msgs/Odometry

显示如下:
which should yield the following output:

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

PoseWithCovariance二级子消息记录了机器人的位置和方向,而TwistWithCovariance组件则为我们提供了线速度和角速度。 pose和twist都可以辅以协方差矩阵,该矩阵可以测量各种测量方法中的不确定度。
The PoseWithCovariance sub-message records the position and orientation of the robot while the TwistWithCovariance component gives us the linear and angular speeds as we have already seen. Both the pose and twist can be supplemented with a covariance matrix which measures the uncertainty in the various measurements.

Header和child_frame_id定义了我们用来测量距离和角度的参考坐标系。 它还为每条消息提供了时间戳,因此我们不仅知道我们在哪里,而且在什么时间。 按照惯例,ROS中的里程测量方法使用 /odom作为父坐标系ID,使用 /base_link(或/ base_footprint)作为子坐标系ID。 虽然 /base_link坐标系对应于机器人的实际物理位置,但 /odom坐标系由封装在里程表数据中的平移和旋转定义。 这些转换使机器人相对于 /odom坐标系移动。 如果我们在RViz中显示机器人模型并将fixed frame设置为 /odom坐标系,则机器人的位置反映了机器人认为其相对于其起始位置的位置。(/base_link代表机器人的实际位置,/odom的坐标原点为机器人的起始位置,代表机器人相对于初始位置的移动)
The Header and child_frame_id define the reference frames we are using to measure distances and angles. It also provides a timestamp for each message so we know not only where we are but when. By convention, odometry measurements in ROS use /odom as the parent frame id and /base_link (or /base_footprint ) as the child frame id. While the /base_link frame corresponds to a real physical part of the robot, the /odom frame is defined by the translations and rotations encapsulated in the odometry data. These transformations move the robot relative to the /odom frame. If we display the robot model in RViz and set the fixed frame to the /odom frame, the robot’s position will reflect where the robot “thinks” it is relative to its starting position.

你可能感兴趣的:(rbx1书籍,ROS机器人学习)