A MATLAB library for pose graph optimization (PGO), rotation averaging, and related geometric computations on manifolds.
This library provides tools for solving optimization problems in robotics and computer vision, particularly focusing on:
- Pose Graph Optimization (PGO): Optimizing robot trajectories from relative pose measurements
- Rotation Averaging: Estimating absolute rotations from relative rotation measurements
- Geometric Computations: Lie group operations, manifold optimization, and matrix utilities
Run setup.m to initialize the library:
setupThis will:
- Import Manopt (if available) for manifold optimization
- Add all subdirectories to the MATLAB path
Dependencies:
- MATLAB (tested with recent versions)
- Manopt (optional but recommended for optimization functions)
Solve full pose graph optimization problems.
Estimate absolute rotations from relative rotation measurements.
Low-level rotation operations and conversions.
Operations for translation estimation and alignment.
Combined rotation and translation operations.
Generate synthetic datasets for testing and benchmarking.
Specialized matrix operations for graph and optimization problems.
Efficient solvers for structured linear systems.
Interface with g2o format.
Helper functions for GTSAM integration.
General utility functions.
% Generate synthetic PGO problem
options.num_rows = 5;
options.num_columns = 5;
options.deg_stddev = 3; % 3 degrees rotation noise
options.t_stddev = 0.1; % 0.1m translation noise
[measurements, true_pose] = simulate_single_grid_pgo(options);
% Solve using Gauss-Newton
R_init = eye(3, 3*numel(measurements.vertices));
t_init = zeros(3, numel(measurements.vertices));
[R_opt, t_opt] = pgo_gauss_newton(measurements, R_init, t_init);
% Evaluate cost
cost = evaluate_pgo_cost(measurements, R_opt, t_opt);
fprintf('Final cost: %.4f\n', cost);% Extract rotation measurements
rot_measurements.edges = measurements.edges;
rot_measurements.R = measurements.R;
rot_measurements.kappa = measurements.kappa;
% Solve rotation averaging
[R_avg, info] = rotation_averaging_gauss_newton(rot_measurements);
% Compute error
cost = evaluate_rotation_averaging_cost(rot_measurements, R_avg);% Load dataset
[measurements, poses_gt] = load_from_g2o('dataset.g2o');
% Solve
[R_opt, t_opt] = pgo_gauss_newton(measurements, poses_gt.R, poses_gt.t);
% Save results
write_to_g2o('output.g2o', measurements, R_opt, t_opt);Yulun Tian (yulunt@umich.edu)
See individual files for licensing information.
This repo built on the awesome implementations from the following prior work:
- Manopt: www.manopt.org
- g2o format: github.com/RainerKuemmerle/g2o
- SE-Sync: Rosen et al., "SE-Sync: A certifiably correct algorithm for synchronization over the special Euclidean group" github.com/david-m-rosen/SE-Sync