cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.03k stars 2.24k forks source link

Need a theoretical explanation about the Cartographer's file, especially the function CairoPaintSubmapSlices and the function PaintSubmapSlices. #1923

Open BlueBirdHouse opened 1 year ago

BlueBirdHouse commented 1 year ago

Need a theoretical explanation about the Cartographer's file submap_painter.cc, especially the function CairoPaintSubmapSlices and the function PaintSubmapSlices.

I understand that a big map contains a lot of sub-maps. The two functions mentioned above try to paste sub-maps together so we can get a complete map.

There is a ROS message called submap_list that contains a field called pose. The pose seems like indicate the origin of the sub-map in the word coordinate. We can consider it as a transformation matrix T1. Additionally, there also has a field called the slice_pose of texture. We can get it by calling the service SumbapQuery. It seems can change the pixel coordinate of the submap to the local coordinate of the submap. Let's consider it T2. But, what we want is the pixel coordinate of the complete map. By knowing this, we can paste the pixels of the sub-map into a big complete map.

I know the function CairoPaintSubmapSlices and the function PaintSubmapSlices can do the job; however, I cannot understand exactly how.

By the way, there can be a lot of textures in the response of the service SumbapQuery. Why do we only want the first texture? What is the usage of the other textures?

There are two fields of submap_version. One is in the message of submap_list; the other is in the response of the service SumbapQuery. What is the difference between the two versions?

I try to read the code; however, it uses a lot of Cairo library. It will be much easier if I have a theoretical explanation about how the sub-maps are been merged.