ROS中/odom,/map,/base_link几个坐标系的含义:从ROS的REP105严谨介绍

这两日看lego-loam,其中的坐标系定义很混乱。
在lego-loam的一个issue中,作者指出他坐标系定义是完全按照ROS的REP103和105的建议的。
然后又看到了关于/odom, /map, /base_link 几个坐标系的含义的说明,因此整理一下。

关于ROS的REP

关于REP:https://ros.org/reps/rep-0000.html

The REP contains the index of all ROS Enhancement Proposals, known as REPs. REP numbers are assigned by the REP Editor, and once assigned are never changed.

简单来说,REP是对ROS的一些提议,即某些人建议对这些问题这样操作。

REP103 测量和坐标系习惯

REP103: Standard Units of Measure and Coordinate Conventions

简要概括:
传感器坐标系采用:x-前,y-左,z-上
用于地理定位的短距离笛卡尔坐标系:东北天坐标系
光学传感器:z-前,x-右,y-下

REP105 移动机器人平台坐标系定义

REP105 Coordinate Frames for Mobile Platforms

移动机器人建议有这么几个坐标系:

  • /base_link:与移动机器人基座固连的坐标系,建议采用REP103的方式进行定义。
  • /odom:与world固定的一个frame

The coordinate frame called odom is a world-fixed frame. The pose of a mobile platform in the odom frame can drift over time, without any bounds. This drift makes the odom frame useless as a long-term global reference. However, the pose of a robot in the odom frame is guaranteed to be continuous, meaning that the pose of a mobile platform in the odom frame always evolves in a smooth way, without discrete jumps.
In a typical setup the odom frame is computed based on an odometry source, such as wheel odometry, visual odometry or an inertial measurement unit.
The odom frame is useful as an accurate, short-term local reference, but drift makes it a poor frame for long-term reference.

  • /map:z轴向上的、与world固定的一个frame

The coordinate frame called map is a world fixed frame, with its Z-axis pointing upwards. The pose of a mobile platform, relative to the map frame, should not significantly drift over time. The map frame is not continuous, meaning the pose of a mobile platform in the map frame can change in discrete jumps at any time.
In a typical setup, a localization component constantly re-computes the robot pose in the map frame based on sensor observations, therefore eliminating drift, but causing discrete jumps when new sensor information arrives.
The map frame is useful as a long-term global reference, but discrete jumps in position estimators make it a poor reference frame for local sensing and acting.

其中,关于/odom和/map两个坐标系的看起来很复杂,因此深入探究一下。

关于/odom和/map两个坐标系

核心区别:
odom坐标系是机器人移动过程中里程计(例如IMU、轮式编码器)参考的坐标系,其初始时刻一般设定为原点、无旋转。但由于数据存在错误(例如轮式编码器打滑)、或漂移(IMU的漂移),odom系下/base_link的坐标并不能直接用于导航,而是需要转到/map系下。

如果采用了其他定位系统(localization system),例如GPS数据,在map系下的坐标会发生纠正/校准/跳变。因此,可以认为,/odom系到/map系的变化通过定位系统不断纠正。即定位系统提供一个从 /map-> /odom 的 tf [2]。

所以,可以有以下一些理解:

  • 如果满足:1. 设定/odom初始时刻即为/map,即重合。且,2. 用于/odom定位的传感器没有漂移。则/odom和/map系一直是重合的。
  • 或者:如果传感器没有漂移,则/odom和/map永远差一个恒定的变化,即初始时刻的变化。/map的定义建议参考REP103,例如东北天。
  • 当然,也可以这么说:/odom+一些离散传感器(例如GPS)的数据(比如用KEF后),得到了/map下的坐标,因此/map下的位子变化是离散的,而/odom是连续的。

那么,/odom系有什么用呢?
[3]指出:如果你需要一个control system,一般需要对象是连续的,因此 /odom 系下的连续轨迹便于用于控制,而/map这种跳变的则不好处理。

其他坐标系:/world和/laser_link, /sensor_link

/world一般认为和/map一样[2]。
/laser_link 和 /sensor_link 是传感器的坐标系,一般依附于 /base_link 坐标系。

总的关系是:
/world 或 /map --> /odom --> /base_link --> /laser_link 或 /sensor_link

参考资料:

[1] CSDN的博客:ROS里基本坐标系的理解:map,odom,base_link,base_laser
但是这个资料中的表述有个问题:/map与/odom在初始时刻不一定是完全一致的。如果认为/odom的第一帧是就是/map,则初始时刻一致。
[2] https://airlab.deib.polimi.it/life-in-airlab/service-pages/resources/ros-howto/ros-components/
[3] https://www.reddit.com/r/ROS/comments/j9ao94/odom_frame_worldfixed_rep105/

你可能感兴趣的:(软件与库,SLAM,机器人)