On-Manifold Optimization: Local Parameterization

Last updated on November 26, 2023 pm

Overview

Manifold Space vs Tangent Space

Jacobian w.r.t Error State

Jacobian w.r.t Error State vs True State

According [1] 2.4,

The idea is that for a $x \in N$ the function $g(\delta) := f (x \boxplus \delta)$ behaves locally in $0$ like $f$ does in $x$. In particular $|f(x)|^2$ has a minimum in $x$ if and only if $|g(\delta)|^2$ has a minimum in $0$. Therefore finding a local optimum of $g$, $\delta = \arg \min{\delta} |g(\delta)|^2$ implies $x \boxplus \delta = \arg \min{\xi} |f(\xi)|^2$.

where

ESKF [2] 6.1.1: Jacobian computation

  • $x_t$: true state
  • $x$: normal state
  • $\delta x$: error state

lifting and retraction:

the quaternion term

Least Squares on a Manifold [3]

Local Parameterization in Ceres Solver [4] [5] [6] [7] [8]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class LocalParameterization {
public:
virtual ~LocalParameterization() = default;
virtual bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const = 0;
virtual bool ComputeJacobian(const double* x, double* jacobian) const = 0;
virtual bool MultiplyByJacobian(const double* x,
const int num_rows,
const double* global_matrix,
double* local_matrix) const;
virtual int GlobalSize() const = 0;
virtual int LocalSize() const = 0;
};

Plus

Retraction

ComputeJacobian

global w.r.t local

参考 [9]

$r$ w.r.t $x_{L}$

ceres::CostFunction 处提供 residuals 对 Manifold 上变量的导数

则 对 Tangent Space 上变量的导数

Sub Class

  • QuaternionParameterization
  • EigenQuaternionParameterization

自定义 QuaternionParameterization

参考 [7]

Summary

  • QuaternionParameterization 的 Plus 与 ComputeJacobian 共同决定使用左扰动或使用右扰动形式

Quaternion in Eigen

1
2
3
4
5

Quaterniond q1(1, 2, 3, 4); // wxyz
Quaterniond q2(Vector4d(1, 2, 3, 4)); // xyzw
Quaterniond q3(tmp_q); // xyzw, double tmp_q[4];
q.coeffs(); // xyzw

Quaternion in Ceres Solver

  • order: wxyz
  • Ceres Solver 中 Quaternion 是 Hamilton Quaternion,遵循 Hamilton 乘法法则
  • 矩阵 raw memory 存储方式是 Row Major

Reference


On-Manifold Optimization: Local Parameterization
https://cgabc.xyz/posts/cfb7b6d6/
Author
Gavin Gao
Posted on
September 4, 2022
Licensed under