1Pose Graph 2D
2----------------
3
4The Simultaneous Localization and Mapping (SLAM) problem consists of building a
5map of an unknown environment while simultaneously localizing against this
6map. The main difficulty of this problem stems from not having any additional
7external aiding information such as GPS. SLAM has been considered one of the
8fundamental challenges of robotics. A pose graph optimization problem is one
9example of a SLAM problem.
10
11This package defines the necessary Ceres cost functions needed to model the
122-dimensional pose graph optimization problem as well as a binary to build and
13solve the problem. The cost functions are shown for instruction purposes and can
14be speed up by using analytical derivatives which take longer to implement.
15
16Running
17-----------
18This package includes an executable `pose_graph_2d` that will read a problem
19definition file. This executable can work with any 2D problem definition that
20uses the g2o format. It would be relatively straightforward to implement a new
21reader for a different format such as TORO or others. `pose_graph_2d` will print
22the Ceres solver full summary and then output to disk the original and optimized
23poses (`poses_original.txt` and `poses_optimized.txt`, respectively) of the
24robot in the following format:
25
26```
27pose_id x y yaw_radians
28pose_id x y yaw_radians
29pose_id x y yaw_radians
30...
31```
32
33where `pose_id` is the corresponding integer ID from the file definition. Note,
34the file will be sorted in ascending order for the `pose_id`.
35
36The executable `pose_graph_2d` has one flag `--input` which is the path to the
37problem definition. To run the executable,
38
39```
40/path/to/bin/pose_graph_2d --input /path/to/dataset/dataset.g2o
41```
42
43A python script is provided to visualize the resulting output files.
44```
45/path/to/repo/examples/slam/pose_graph_2d/plot_results.py --optimized_poses ./poses_optimized.txt --initial_poses ./poses_original.txt
46```
47