setting up your robot with tf(1)

1.转换配置

Many ROS packages require the transform tree of a robot to be published using the tf  software library. At an abstract level, a transform tree defines offsets in terms of both translation and rotation between different coordinate frames. To make this more concrete, consider the example of a simple robot that has a mobile base with a single laser mounted on top of it. In referring to the robot let's define two coordinate frames: one corresponding to the center point of the base of the robot and one for the center point of the laser that is mounted on top of the base. Let's also give them names for easy reference. We'll call the coordinate frame attached to the mobile base "base_link" (for navigation, its important that this be placed at the rotational center of the robot) and we'll call the coordinate frame attached to the laser "base_laser."
翻译:
许多ROS包需要机器人转换树用tf软件包来发布。在抽象层次来看,一棵转换树定义了不同的坐标系之间的转换和旋转的偏差。为了更具体,用一个例子如一个简单的机器人带有一个移动的躯干和一个简单的激光器在躯干的上面。为了更好区分,我们称这个躯干的坐标系为base_link(这个坐标系通常放在正中间),激光器的坐标系称作base_laser(这个坐标系通常激光器的正中心).
At this point, let's assume that we have some data from the laser in the form of distances from the laser's center point. In other words, we have some data in the "base_laser" coordinate frame. Now suppose we want to take this data and use it to help the mobile base avoid obstacles in the world. To do this successfully, we need a way of transforming the laser scan we've received from the "base_laser" frame to the "base_link" frame. In essence, we need to define a relationship between the "base_laser" and "base_link" coordinate frames
翻译:
这样来说,让我们假设我们有一些数据来自激光器正中间的前方,也就是说,我们有一些数据在base_laser坐标系上,现在假设我们想得到这些数据并利用它来帮助躯干移动来避开障碍物,这样的话,我们需要一种方式来将我们得到的base_laser数据转换给base_link框架,因此,我们需要在base_laser和base_link坐标系之间定义一种关系。(这段话说明的是,比如我们的机器人想用激光测距来使机器人避障,当激光器得到数据之后,怎样把相对的坐标位置转换给躯干,然后使躯干移动避障,这样就需要定义激光器和躯干也就是不同的frame之间要定义一种关系)

In defining this relationship, assume we know that the laser is mounted 10cm forward and 20cm above the center point of the mobile base. This gives us a translational offset that relates the "base_link" frame to the "base_laser" frame. Specifically, we know that to get data from the "base_link" frame to the "base_laser" frame we must apply a translation of (x: 0.1m, y: 0.0m, z: 0.2m), and to get data from the "base_laser" frame to the "base_link" frame we must apply the opposite translation (x: -0.1m, y: 0.0m, z: -0.20m).
翻译:
为了定义这种关系,假设我们知道激光器是在躯干的前方10cm和上方20cm,这样框架base_link和base_laser之间有一个转换偏差。如果要定义base_laser对应于base_link的数据,则需要添加一个转换关系(x: 0.1m, y: 0.0m, z: 0.2m),而要定义base_link对应与base_laser的数据,只需要添加一个转换关系 (x: -0.1m, y: 0.0m, z: -0.20m).
We could choose to manage this relationship ourselves, meaning storing and applying the appropriate translations between the frames when necessary, but this becomes a real pain as the number of coordinate frames increase. Luckily, however, we don't have to do this work ourselves. Instead we'll define the relationship between "base_link" and "base_laser" once using tf and let it manage the transformation between the two coordinate frames for us. 
翻译:
我们需要自己管理这种转换关系,意思是当需要的时候,我们要存储并条用合适的转换关系,但是这是一项很复杂很令人头痛的工作,尤其是当坐标系的数量增加时。幸运的是,我们不用自己做这件事了。我们只需要用tf将base_link和base_laser之间的关系定义一次,之后就让tf来帮我们管理这两个坐标系之间的转换微笑
To define and store the relationship between the "base_link" and "base_laser" frames using tf, we need to add them to a transform tree. Conceptually, each node in the transform tree corresponds to a coordinate frame and each edge corresponds to the transform that needs to be applied to move from the current node to its child. Tf uses a tree structure to guarantee that there is only a single traversal that links any two coordinate frames together, and assumes that all edges in the tree are directed from parent to child nodes
翻译:
为了用tf来定义和存储base_link和base_laser框架之间的关系,我们需要将它们添加进转换树。概念上来说,转化树上的每一个节点对应一个坐标系,每一条边对应从现在的节点到它子节点之间的转换。TF利用了树形结构来定义而且是单遍历的关系来将两个坐标系连接在一起,也即假设所有的边都是从父节点到子节点。

总的来说,就是定义了一个TF转换树,而且是单遍历的树,即关系是从父节点到子节点,tf定义和存储这棵关系树后,这样框架之间的关系就很明确了,tf会帮我们调用这些关系,比如当激光器测量到距离障碍物0.3米时,由关系树知道躯干距离障碍物为0.4米,这样就能使躯干决定是否移动来躲避障碍物了微笑
To create a transform tree for our simple example, we'll create two nodes, one for the "base_link" coordinate frame and one for the "base_laser" coordinate frame. To create the edge between them, we first need to decide which node will be the parent and which will be the child. Remember, this distinction is important because tf assumes that all transforms move from parent to child. Let's choose the "base_link" coordinate frame as the parent because as other pieces/sensors are added to the robot, it will make the most sense for them to relate to the "base_laser" frame by traversing through the "base_link" frame. This means the transform associated with the edge connecting "base_link" and "base_laser" should be (x: 0.1m, y: 0.0m, z: 0.2m). With this transform tree set up, converting the laser scan received in the "base_laser" frame to the "base_link" frame is as simple as making a call to the tf library. Our robot can use this information to reason about laser scans in the "base_link" frame and safely plan around obstacles in its environment.
翻译:
对一个简单例子,建立一个转换树,我们将创建两个节点,一个是base_link坐标系(父),一个是base_laser坐标系(子)。为了去创建节点的边,我们首先需要确定哪个节点是父节点,哪个是子节点。注意,父子节点的区分是很有必要的,因为 tf 假设所有的转换是从父节点到子节点的变换。这里我们以base_link作为父节点,因为其他的零件/传感器是附加在它上面的。他将很多传感器的base_laser坐标系转换到base_link坐标系。这意味着,这种连接base_link和base_laser的边的转换为(x: 0.1m, y: 0.0m, z: 0.2m)。在这种转换树建立以后,转换激光器的在base_laser的坐标到base_link坐标系就是一个简单的 tf 包的调用。机器人就能够利用这种信息,去安全有效的处理这种障碍物了。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值