Algorithm Search⌘K

Techniqueresearch

Switchable constraints

Also called switch variables for robust SLAM.

Gives each loop closure a switch variable that the optimizer can turn off, so false loop closures stop distorting the map.

Switchable constraints make the back end of a SLAM system robust to wrong loop closures. A loop closure detector sometimes says that two places are the same when they are not. One such edge in a pose graph can bend the whole map, because least squares gives a large error a large weight. Sünderhauf and Protzel give each loop closure edge a new variable sijs_{ij}, the switch. The error of the edge is multiplied by ψ(sij)\psi(s_{ij}), a function with values in [0,1][0, 1], and a prior term pulls each switch toward 1, the value "on". The optimizer then decides, together with the poses, how much to trust each loop closure. A wrong edge with a large error costs less when its switch goes toward 0 and the prior is paid instead. It is a heuristic. It does not guarantee that wrong edges are switched off or that right edges stay on, and the joint problem has more local minima than the original one.

In plain words

Each loop closure gets a dimmer. The solver can turn a dimmer down when that loop closure does not fit with the rest of the map, but each turn costs a small fixed price. A correct loop closure fits, so turning it down saves nothing, and it stays on. A wrong loop closure pulls hard against all the other measurements. Turning it down saves more than the price, so the solver turns it down and the map comes back into shape. The dimmers are found together with the poses by the same solver, so no separate step is needed to find the bad measurements.

When it applies

  • The problem is pose graph optimization or a factor graph problem with a least squares cost, solved by Gauss-Newton or a similar local method.
  • Some edges are doubtful, usually loop closures from appearance, and other edges are reliable, usually odometry.
  • The wrong edges are a minority, and the reliable edges together give a good first guess.
  • There is no time to check each loop closure separately, or the check needs the whole graph.

The template

Let OO be the odometry edges and LL the loop closure edges, with errors eij(X)e_{ij}(X) and information matrices Ωij\Omega_{ij}. Add one scalar switch sijs_{ij} for each loop closure and minimize jointly

∑(i,j)∈Oeij⊤Ωijeij+∑(i,j)∈Lψ(sij)2 eij⊤Ωijeij+∑(i,j)∈Lλ (1−sij)2.\sum_{(i,j) \in O} e_{ij}^\top \Omega_{ij} e_{ij} + \sum_{(i,j) \in L} \psi(s_{ij})^2\, e_{ij}^\top \Omega_{ij} e_{ij} + \sum_{(i,j) \in L} \lambda\, (1 - s_{ij})^2.
  1. Choose the switch function ψ\psi: a sigmoid, or the linear function ψ(s)=s\psi(s) = s with ss held in [0,1][0, 1].
  2. Choose the prior weight λ\lambda, the inverse variance of the switch prior. A small λ\lambda makes switches cheap to turn off; a large one makes the method close to plain least squares.
  3. Start every switch at 1 and the poses at the usual first guess, for example the odometry chain.
  4. Run the same nonlinear least squares solver on poses and switches together. The new variables are scalars, and each one touches only its own edge, so the sparsity of the problem stays almost the same.
  5. Read the final switches. A value near 0 marks a loop closure that the solver rejected.

The implied robust cost. With the linear switch, the switch of one edge with squared Mahalanobis error r2r^2 can be eliminated by hand. The term s2r2+λ(1−s)2s^2 r^2 + \lambda (1 - s)^2 is least at s=λ/(λ+r2)s = \lambda / (\lambda + r^2), and its value there is

ρ(r2)=λ r2λ+r2.\rho(r^2) = \frac{\lambda\, r^2}{\lambda + r^2}.

This is bounded by λ\lambda for any error, so one wrong edge can add at most λ\lambda to the cost. So switchable constraints with a linear switch act like a redescending M-estimator of the Geman-McClure type on each loop closure.

Classic examples

One pose and two loop closures. Pose x0=0x_0 = 0 is fixed. Odometry says x1=1x_1 = 1. Loop closure aa says x1=1.2x_1 = 1.2, and it is correct. Loop closure bb says x1=4x_1 = 4, and it is wrong. All weights are 1, the switches are linear, and λ=1\lambda = 1.

  • Plain least squares gives x1=(1+1.2+4)/3=2.067x_1 = (1 + 1.2 + 4) / 3 = 2.067. The wrong edge moves the pose by almost 1.
  • With switches, alternate between the best x1x_1 for fixed switches, x1=(1+1.2 sa2+4 sb2)/(1+sa2+sb2)x_1 = (1 + 1.2\,s_a^2 + 4\,s_b^2) / (1 + s_a^2 + s_b^2), and the best switches for fixed x1x_1, s=1/(1+r2)s = 1 / (1 + r^2). From x1=2.067x_1 = 2.067, the switches become sa=0.571s_a = 0.571 and sb=0.211s_b = 0.211, then x1=1.145x_1 = 1.145, then sa=0.997s_a = 0.997 and sb=0.109s_b = 0.109, then x1=1.117x_1 = 1.117. The process ends at x1=1.116x_1 = 1.116, sa=0.993s_a = 0.993 and sb=0.107s_b = 0.107, with the cost 0.913.

The wrong edge is mostly switched off, but not fully. The result 1.116 is close to, but not equal to, 1.1, the least squares answer without the wrong edge.

Pose graphs with added false loop closures. Sünderhauf and Protzel added many random false loop closures to standard pose graph data sets and showed that the switchable formulation still recovered the map in their experiments. These are measured results on those data sets, not a guarantee.

Variations

  • Dynamic covariance scaling. Agarwal and colleagues eliminated the switch in closed form and applied the result as a scale on the information matrix of each loop closure. This gives the same kind of bounded cost without extra variables.
  • Max-mixtures. Olson and Agarwal model each doubtful edge by a mixture of a narrow and a wide Gaussian, and take the most likely component in each step.
  • Consistency checks. RRR of Latif, Cadena and Neira, and pairwise consistency maximization, group loop closures that agree with each other and reject the rest before or during the optimization. Such checks can use RANSAC-like ideas.
  • Robust kernels. Huber, Cauchy and other M-estimators on loop closures work in a similar way, with a fixed kernel in place of a switch.
  • Certifiable robust methods. Later work combines outlier models with relaxations like those of SE-Sync, at a higher cost.

Pitfalls

  • A poor first guess. The joint problem is more nonconvex than the original. If odometry drift is large, a correct loop closure can also have a large error at the start, and its switch goes off. The map then keeps the drift.
  • The prior weight. With λ\lambda too large, wrong edges stay on. With λ\lambda too small, correct edges with a large error, which are the most useful ones, are switched off.
  • Many consistent wrong edges. Several wrong loop closures that agree with each other, for example from a repeated corridor, can win against the odometry. Switches cannot tell them from correct edges.
  • Partial switches. A switch that ends between 0 and 1 still pulls the map a little. Inspect the final switch values, and remove clearly rejected edges if the bias matters.
  • Odometry is trusted. The method assumes that the edges without switches are correct. A wrong odometry edge is not handled.

Exercises

  1. Show that min⁡ss2r2+λ(1−s)2\min_s s^2 r^2 + \lambda (1 - s)^2 is attained at s=λ/(λ+r2)s = \lambda / (\lambda + r^2), and that the minimum value is λr2/(λ+r2)\lambda r^2 / (\lambda + r^2).
  2. In the example with one pose, find the value of x1x_1 if the switches are fixed at sa=1s_a = 1 and sb=0s_b = 0. Explain why the result of the switched problem differs from it.
  3. Give a one-dimensional example with a first guess for which the alternating method switches off the correct loop closure.
  4. Explain why adding one scalar variable per loop closure keeps the information matrix sparse, and what new nonzero entries appear.

References

  1. Niko Sünderhauf and Peter Protzel, Switchable constraints for robust pose graph SLAM, IEEE/RSJ International Conference on Intelligent Robots and Systems, 2012, pages 1879 to 1884, the switch variable on each loop closure, the switch function, the switch prior, and the experiments with added false loop closures
  2. Niko Sünderhauf and Peter Protzel, Towards a robust back-end for pose graph SLAM, IEEE International Conference on Robotics and Automation, 2012, pages 1254 to 1261, the first form of the switchable constraints in a factor graph
  3. Cesar Cadena, Luca Carlone, Henry Carrillo, Yasir Latif, Davide Scaramuzza, Jose Neira, Ian Reid and John J. Leonard, Past, present, and future of simultaneous localization and mapping: toward the robust-perception age, IEEE Transactions on Robotics 32(6), 2016, pages 1309 to 1332, the discussion of robust back ends against wrong data association

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples