參考定義見:backpack_3d.lua
Local map frame是一次slam過程中的原點。但是現在cartographer支持Incremental mapping。global map是整個地圖的原點,local map是每一次建圖的原點。
map_frame = “map”:cartographer中使用的全局坐標系,最好保持默認,否則ROS的Rviz不認識其它的定義,導致無法可視化建圖過程。
tracking_frame=”base_link”:機器人中心坐標系,其它傳感器數據都是以這個為基礎進行插入的,它是整個SLAM系統的核心坐標系;cartographer_ros里面有個tf_bridge的類就是專門用來查詢其它坐標系到此坐標系的轉換關系。
published_frame = “base_link”
odom_frame = “odom” :published_frame與odom_frame配合使用,如果參數provide_odom_frame = true 那么最后可視化時,發布的轉換消息是從 published_frame->odom_frame->map_frame, 也即cartographer內部計算出了未經回環檢測的局部圖坐標到優化后的全局圖坐標之間的轉換關系並發布了出來。在跑官網的二維背包例子時,在map坐標周圍一直跳動的odom就是這個玩意。

1.3 ROS坐標系規范
ROS坐標系規范:REP (定義了坐標系命名規范及各自的含義)
base_link (機器人底盤坐標系)
The coordinate frame called base_link is rigidly attached to the mobile robot base. The base_link can be attached to the base in any arbitrary position or orientation; for every hardware platform there will be a different place on the base that provides an obvious point of reference.
base_laser
激光雷達的坐標系,與激光雷達的安裝點有關,其與base_link的tf為固定的。
odom (用於短期局部參考)
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 (用於長期全局參考)
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.
earth (用於多個機器人的場景)
The coordinate frame called earth is the origin of ECEF.
This frame is designed to allow the interaction of multiple robots in different map frames. If the application only needs one map the earth coordinate frame is not expected to be present. In the case of running with multiple maps simultaneously the map and odom and base_link frames will need to be customized for each robot. If running multiple robots and bridging data between them, the transform frame_ids can remain standard on each robot if the other robots’ frame_ids are rewritten.
If the map frame is globally referenced the publisher from earth to map can be a static transform publisher. Otherwise the earth to map transform will usually need to be computed by taking the estimate of the current global position and subtracting the current estimated pose in the map to get the estimated pose of the origin of the map.
In case the map frame’s absolute positon is unknown at the time of startup, it can remain detached until such time that the global position estimation can be adaquately evaluated. This will operate in the same way that a robot can operate in the odom frame before localization in the map frame is initialized.
坐標系間的關系
每個坐標系只有一個父坐標系,可以有多個子坐標系
坐標系間的樹形結構如下所示:
earth --> map --> odom --> base_link
對於只有一個機器人的環境,在起始位置,map與odom坐標系是重合的。隨着時間的推移是不重合的,而出現的偏差就是里程計的累積誤差。那map–>odom的tf怎么得到?就是在一些校正傳感器合作校正的package比如gmapping會給出一個位置估計(localization),這可以得到map–>base_link的tf,所以估計位置和里程計位置的偏差也就是odom與map的坐標系偏差。所以,如果你的odom計算沒有錯誤,那么map–>odom的tf就是0.
Axis Orientation (坐標軸方向)
In relation to a body the standard is:
x forward
y left
z up

