• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D20-Oct-20212.5 KiB5547

plot_results.pyH A D20-Oct-20212.7 KiB8154

pose_graph_3d.ccH A D20-Oct-20217.1 KiB175104

pose_graph_3d_error_term.hH A D20-Oct-20215.6 KiB13246

types.hH A D20-Oct-20213.8 KiB11555

README.md

1Pose Graph 3D
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
11The example also illustrates how to use Eigen's geometry module with Ceres'
12automatic differentiation functionality. To represent the orientation, we will
13use Eigen's quaternion which uses the Hamiltonian convention but has different
14element ordering as compared with Ceres's rotation representation. Specifically
15they differ by whether the scalar component q_w is first or last; the element
16order for Ceres's quaternion is [q_w, q_x, q_y, q_z] where as Eigen's quaternion
17is [q_x, q_y, q_z, q_w].
18
19This package defines the necessary Ceres cost functions needed to model the
203-dimensional pose graph optimization problem as well as a binary to build and
21solve the problem. The cost functions are shown for instruction purposes and can
22be speed up by using analytical derivatives which take longer to implement.
23
24
25Running
26-----------
27This package includes an executable `pose_graph_3d` that will read a problem
28definition file. This executable can work with any 3D problem definition that
29uses the g2o format with quaternions used for the orientation representation. It
30would be relatively straightforward to implement a new reader for a different
31format such as TORO or others. `pose_graph_3d` will print the Ceres solver full
32summary and then output to disk the original and optimized poses
33(`poses_original.txt` and `poses_optimized.txt`, respectively) of the robot in
34the following format:
35```
36pose_id x y z q_x q_y q_z q_w
37pose_id x y z q_x q_y q_z q_w
38pose_id x y z q_x q_y q_z q_w
39...
40```
41where `pose_id` is the corresponding integer ID from the file definition. Note,
42the file will be sorted in ascending order for the ```pose_id```.
43
44The executable `pose_graph_3d` expects the first argument to be the path to the
45problem definition. To run the executable,
46```
47/path/to/bin/pose_graph_3d /path/to/dataset/dataset.g2o
48```
49
50A script is provided to visualize the resulting output files. There is also an
51option to enable equal axes using ```--axes_equal```.
52```
53/path/to/repo/examples/slam/pose_graph_3d/plot_results.py --optimized_poses ./poses_optimized.txt --initial_poses ./poses_original.txt
54```
55