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