SLAM Engineer

๐ŸŒˆ FAST-LIO๊ฐ€ ๋ง ๊ทธ๋Œ€๋กœ Fast ํ•œ ์ด์œ 


Illustrated Fast Kalman Gain Computation

  • Kalman Gain ๊ณ„์‚ฐ์—๋Š” matrix inversion ์ด ํฌํ•จ๋˜์–ด ์žˆ๋‹ค.
  • ๊ทผ๋ฐ Matrix inversion ์€ ๋น„์‹ธ๋‹ค.
  • FAST-LIO์˜ K ๊ณ„์‚ฐ ๊ณผ์ •์—์„œ์˜ Matrix ๋ชจ์–‘์„ ๊ทธ๋ฆผ์œผ๋กœ ๊ทธ๋ ค์„œ ์•Œ์•„๋ณด์ž.

๋Œ€์ƒ๋…์ž

  • ์ด ํฌ์ŠคํŠธ๋Š” FAST-LIO (code, paper v1) ๋ฅผ ํ•œ ๋ฒˆ ์ •๋„ ์ฝ์–ด๋ณด๊ณ  ๋Œ๋ ค๋ณธ ๋…์ž์—๊ฒŒ ์ ๋‹นํ•ฉ๋‹ˆ๋‹ค.

์†๋„๋ฅผ ๋น ๋ฅด๊ฒŒ ํ•˜๋ ค๋ฉด?

์ผ๋ฐ˜์ ์œผ๋กœ

  • ๋ชจ๋“  geometric optimization ์€ ๋‘ ๋‹จ๊ณ„๋กœ ๋‚˜๋‰œ๋‹ค๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
    1. Problem buildling
    2. Problem solving
  • Proboem building ์€ correspondences๋ฅผ ์ฐพ๊ณ  constraints ๋ฅผ ๋งŒ๋“œ๋Š” ๊ณผ์ •, Problem solving ์€ ๊ทธ constraints ๋ฅผ ๋ชจ๋‘ (๊ฑฐ์˜) ๋งŒ์กฑํ•˜๋Š” optimal solution์„ ์ฐพ๋Š” ๊ณผ์ •์„ ์˜๋ฏธํ•œ๋‹ค.
    • ์˜ˆ๋ฅผ ๋“ค์–ด ํ†ต์ƒ์ ์ธ least square optimization ์—์„œ
      • $A\delta x=b$ ๋ฅผ Gauss-newton ์œผ๋กœ ํ‘ธ๋Š” ๊ฒƒ์ด solving ๊ณผ์ •์ด๊ณ ,
      • ์ด๋ฅผ ์œ„ํ•œ $A$ matrix ์ž์ฒด๋ฅผ ๋งŒ๋“œ๋Š” ์ผ (๋ฐ ๊ทธ๊ฒƒ์„ ์œ„ํ•œ ๋ชจ๋“  ์•ž๋‹จ: e.g., ์ด๋ฏธ์ง€ ์ „์ฒ˜๋ฆฌ, ํŠน์ง•์  ๊ฒ€์ถœ, ํ”ผ์ฒ˜ ์ถ”์ถœ ๋“ฑ)์ด problem building ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋‹ค.

SLAM์—์„œ

  • FAST-LIO์™€ ๊ฐ™์€ LiDAR(or visual)-SLAM์—์„œ๋Š”
    • map ์˜ entity์™€ query measurement ์˜ entity ์‚ฌ์ด์˜ correspondence ๋ฅผ ์ฐพ๋Š” ๊ฒƒ์ด buildilng,
    • ๊ทธ ์‚ฌ์ด์˜ residual ์„ ์ตœ์†Œํ™”ํ•˜๋Š” solution์„ ์ฐพ๋Š” ๊ณผ์ •์ด solving ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๊ฒ ๋‹ค.

FAST-LIO์—์„œ

  • FAST-LIO์—์„œ๋Š” ๊ทธ๋ž˜์„œ ํฌ๊ฒŒ contribution์ด ๋‘ ๊ฐ€์ง€๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
    • Geometric optimization ์˜ ๋‘ ๋‹จ๊ณ„์— ๋Œ€ํ•˜์—ฌ ๊ฐ๊ฐ ์‹œ๊ฐ„๊ฐœ์„ ์„ ์œ„ํ•œ contributions์ด ์žˆ์—ˆ๋‹ค.
      1. ikd-tree ๋ฅผ ํ†ตํ•œ problem buildling ์‹œ๊ฐ„ ๊ฐœ์„ 
        • ์ฆ‰, map ๊ด€๋ฆฌ๋ฅผ ๋” ๋น ๋ฅด๊ฒŒ ํ•  ์ˆ˜ ์žˆ๊ณ , map์œผ๋กœ ๋ถ€ํ„ฐ correspondence ๋ฅผ ๋” ๋นจ๋ฆฌ retrieval ํ•ด์˜ฌ ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋‹ค.
          • ps. ์ดํ›„ faster-lio ๋‚˜ voxel-map ์—์„œ๋Š” kd-tree ๋ณด๋‹ค๋„ ๊ทผ๋ณธ์ ์œผ๋กœ ๋น ๋ฅธ hash map์„ ์ œ์•ˆํ•˜๊ธฐ๋„ ํ•˜์˜€๋‹ค. ์•„๋ฌดํŠผ ์ด๋Ÿฐ ๋…ธ๋ ฅ๋“ค์€ ๋ชจ๋‘ problem buildling ์‹œ๊ฐ„ ๋‹จ์ถ•์— ๊ธฐ์—ฌํ•˜๋Š” ์š”์†Œ๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
      2. Fast Kalman Gain computation ์„ ํ†ตํ•œ problem solving ์‹œ๊ฐ„ ๊ฐœ์„ 
        • ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ ์ด ํฌ์ŠคํŠธ์—์„œ ์ž์„ธํ•˜๊ฒŒ ์„ค๋ช…ํ•ด๋ณด๊ณ ์ž ํ•œ๋‹ค.

The Fast Kalman Gain

  • ๊ตฌ๊ธ€์—์„œ Kalman Gain ์ด๋ผ๊ณ  ๊ฒ€์ƒ‰ํ•ด๋ณด๋ฉด (ํ˜น์€ ์ด ์ž๋ฃŒ (2006 An Introduction to the Kalman Filter)๋ฅผ ๋ณด๋ผ), ํ†ต์ƒ์ ์ธ Kalman Gain ์€ ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ๋‹ค.
    • Slow K: $ \textbf{K} = \textbf{P}\textbf{H}^{\textbf{T}}(\textbf{H}\textbf{P}\textbf{H}^{T} + \textbf{R})^{-1}$
  • ๊ทธ๋Ÿฐ๋ฐ FAST-LIO์—์„œ ์‚ฌ์šฉํ•˜๋Š” Kalman Gain์€ ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ๋‹ค.
    • Fast K: $ \textbf{K} = (\textbf{H}^{T}\textbf{R}^{-1}\textbf{H}+\textbf{P}^{-1})^{-1}\textbf{H}^{T}\textbf{R}^{-1}$
  • ์ „์ž๋ฅผ slow K, ํ›„์ž๋ฅผ fast K ๋ผ๊ณ  ๋ถ€๋ฅด์ž.
  • FAST-LIO ๋…ผ๋ฌธ์— ์˜ํ•˜๋ฉด ์•„๋ž˜ ์œ ๋„๊ณผ์ •์— ์˜ํ•ด fast ver์™€ slow ver ๋Š” ๋™์น˜๋ผ๊ณ  ํ•œ๋‹ค.

  • The slow version ์œผ๋กœ ๋ถˆ๋ฆฌ๋Š” $\textbf{K}$๋Š” Conventional ํ•œ Kalman filter ์˜ Gain form ์œผ๋กœ ์•„์ฃผ ์ž˜ ์•Œ๋ ค์ง„ ํ˜•ํƒœ์ธ๋ฐ, ๊ทธ๋ ‡๋‹ค๋ฉด ์ง€๊ธˆ๊นŒ์ง€ ๋ฌธ์ œ๊ฐ€ ๋งŽ์•˜๋‹จ๊ฑธ๊นŒ? ๊ทธ๊ฒŒ ์•„๋‹ˆ๋ผ๋ฉด, ์™œ slow version $\textbf{K}$๋Š” ํŠนํžˆ FAST-LIO์—์„œ slow ํ•  ์ˆ˜๋ฐ–์— ์—†์—ˆ์„๊นŒ? ์™œ ๊ทธ๋Ÿด์ง€ ์•Œ์•„๋ณด์ž.

Matrix-illustrated Fast Kalman Gain

  • Kalman gain ์˜ ์‹์— ์žˆ๋Š” $\textbf{H}$๋Š” residual ์˜ ๋ฏธ๋ถ„๊ฐ’ (jacobian) ์ด๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, visual SLAM์—์„œ, image feature ์— ๋Œ€ํ•ด์„œ๋Š” reprojection error ๋ฅผ ์ฃผ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•œ๋‹ค. r2live ์˜ ๋…ผ๋ฌธ appendix ์— ์ด ์‹์ด ์ž˜ ๋‚˜์™€์žˆ๋‹ค (eq S7 ์ฐธ๊ณ ).
  • ํ•˜๋‚˜์˜ residual ์— ๋Œ€ํ•œ $\textbf{H}$ (๊ทธ๋ž˜์„œ constraint $i$์— ๋Œ€ํ•œ residual ์ด๋ผ๊ณ  ํ•ด์„œ $\textbf{H}_i$ ์™€ ๊ฐ™์ด ์“ธ ์ˆ˜๋„ ์žˆ๊ฒ ๊ณ )๋Š” ํ•ญ์ƒ ์ด๋Ÿฐ ๋ชจ์–‘์ด๋‹ค.

    • cost (or called error, residual) ๋Š” ์ •์˜ํ•˜๊ธฐ ๋‚˜๋ฆ„์ด๋‹ค. image ์˜ feature point reprojection error ๋Š” ๋ณดํ†ต x๋กœ์˜ diff์™€ y๋กœ์˜ offset ์„ ๋ชจ๋‘ ์ธก์ •ํ•˜๋ฏ€๋กœ Dim(cost)=2 ๊ฐ€ ๋˜๊ฒ ๋‹ค (r2live ์˜ ๋…ผ๋ฌธ appendix ์— ์ด ์‹์ด ์ž˜ ๋‚˜์™€์žˆ๋‹ค (eq S7, S10 ์ฐธ๊ณ ).
    • ํ•œ ํŽธ, Dim(state)๋Š” ์šฐ๋ฆฌ๊ฐ€ ์•Œ๊ณ ์‹ถ์€ robot ์˜ ์ƒํƒœ๋ณ€์ˆ˜๋ฅผ ์˜๋ฏธํ•œ๋‹ค. ์•„์ฃผ ์ผ๋ฐ˜์ ์œผ๋กœ๋Š” rotation ๊ณผ translation ์ด๋ฏ€๋กœ =6 ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๊ฒ ๋‹ค.
      • rotation์€ error-state ์˜ ๊ฒฝ์šฐ minimal representation (i.e., tangent vector space) ๋กœ ํ‘œํ˜„๋˜๋ฏ€๋กœ rotation ์˜ dimension=3, translation์˜ dimension=3 (xyz) ํ•ด์„œ 6์ด ๋œ๋‹ค.
      • ๊ทธ๋ฆฌ๊ณ  ์ƒํ™ฉ์— ๋”ฐ๋ผ extrinsic ์ด๋‚˜ bias ๋“ฑ์„ ํฌํ•จํ•˜๋ฉด ๋” ๊ธธ์–ด์งˆ์ˆ˜๋„(6 ์ด์ƒ) ์žˆ๋‹ค. ํ•˜์ง€๋งŒ r2live ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด 6์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ๋Š”๋ฐ, ๊ทธ ์ด์œ ๋Š” ์•„๋งˆ๋„, residual ์—์„œ ์–ด์งœํ”ผ extrinsic ์ด๋‚˜ bias ๋“ฑ์„ ๊ณ ๋ คํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ (์ƒ์ˆ˜์ฒ˜๋ฆฌํ•˜๊ฑฐ๋‚˜ ์•„์˜ˆ term์ด ์—†๋Š” ๊ฒฝ์šฐ), ๊ทธ๋Ÿฐ state element ์— ๋Œ€ํ•œ Jacobian block์ด 0์ด๋˜๋ฏ€๋กœ ์–ด์งœํ”ผ ๊ทธ ๋ณ€์ˆ˜์กฐ์ ˆ์— ๊ธฐ์—ฌํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค (r2live ์˜ ๋…ผ๋ฌธ appendix ์˜ ์‹ S4 ์•„๋ž˜ H ์ฐธ๊ณ ).
  • ๊ทธ๋Ÿฐ๋ฐ a single image์—์„œ detect ๋˜๋Š” feature point ์˜ ๊ฐœ์ˆ˜๋‚˜, ํ˜น์€ a single lidar scan (e.g., 360 deg horizontal sweep during 0.1 sec) ์—๋Š” ํฌ์ธํŠธ๊ฐ€ ํ•˜๋‚˜๋งŒ ์žˆ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋‹ค. ์ด๋ฏธ์ง€์—๋Š” ์ˆ˜์‹ญ-์ˆ˜์ฒœ๊ฐœ์˜ ํ”ผ์ฒ˜๊ฐ€ ์กด์žฌํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ (์ด๋ฏธ์ง€ ์‚ฌ์ด์ฆˆ๋งˆ๋‹ค ๋‹ค๋ฅด๋‹ค), lidar ์—ญ์‹œ ํ†ต์ƒ์ ์œผ๋กœ ์ˆ˜์ฒœ๊ฐœ์˜ (downsampled) ํ”ผ์ฒ˜ ํฌ์ธํŠธ ๋ฅผ ๊ฐ€์ง„๋‹ค. ์ด๋Ÿฐ ํฌ์ธํŠธ ํ•˜๋‚˜ ํ•˜๋‚˜๋งˆ๋‹ค ์œ„์˜ residual block (i.e,. $\textbf{H}_i$ for $i=1,2,3,โ€ฆ,$ ์ˆ˜์‹ญ-์ˆ˜์ฒœ) ์ด ์กด์žฌํ•˜๊ฒŒ ๋œ๋‹ค.
    • ์ด๋ฅผ overdetermined system์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.
  • ๋”ฐ๋ผ์„œ the slow K: $ \textbf{K} = \textbf{P}\textbf{H}^{\textbf{T}}(\textbf{H}\textbf{P}\textbf{H}^{T} + \textbf{R})^{-1}$ ์˜ ์‹ ์•ˆ์— ์กด์žฌํ•˜๋Š” $\textbf{H}$์˜ ๋ชจ์–‘์€ ์•„๋งˆ ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ์„ ๊ฒƒ์ด๋‹ค.

  • ์ด์ œ ๊ฑฐ์˜ ๋‹ค ์™”๋‹ค. The slow $\textbf{K}$ ๋ฅผ ๊ณ„์‚ฐํ•˜๊ธฐ ์œ„ํ•ด ์šฐ๋ฆฌ๋Š” $(\textbf{H}\textbf{P}\textbf{H}^{T} + \textbf{R})^{-1}$ ๊ฐ€ ํ•„์š”ํ•˜๋‹ค.
    • ๊ทธ๋Ÿฐ๋ฐ ์ด matrix inversion ์˜ ๋น„์šฉ์€ ์–ผ๋งˆ์ผ๊นŒ? wikipedia ์— ๋”ฐ๋ฅด๋ฉด, $O(n^{2})$ ๋ณด๋‹ค๋„ ๋น„์‹ผ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.
    • ์ฆ‰, ์šฐ๋ฆฌ๋Š” slow kalman gain ์„ ๊ณ„์‚ฐํ•˜๊ธฐ ์œ„ํ•ด์„œ $\textbf{H}\textbf{P}\textbf{H}^{T}$ ์˜ shape ์— ์ œ๊ณฑ๋ฐฐ ์ด์ƒ์— ๋น„๋ก€ํ•˜๋Š” ๊ณ„์‚ฐ ๋น„์šฉ์„ ์น˜๋Ÿฌ์•ผ ํ•œ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ๊ทธ shape ์€ ์ ์œผ๋ฉด (image feature์˜ ๊ฒฝ์šฐ) ์ˆ˜๋ฐฑ, ๋งŽ์œผ๋ฉด (liar feature์˜ ๊ฒฝ์šฐ) ์ˆ˜์ฒœ ์ˆ˜๋งŒ ๊นŒ์ง€๋„ ์ปค์งˆ ์ˆ˜ ์žˆ๋‹ค.

  • ๊ทธ๋Ÿฐ๋ฐ ์ด์— ๋น„ํ•ด, FAST-LIO์—์„œ ์ œ์•ˆํ•œ fast kalman gain ์—์„œ inversionํ•ด์•ผ ํ•˜๋Š” ๋Œ€์ƒ์˜ ์ƒ๊น€์ƒˆ๋Š” ์ด๋Ÿฌํ•˜๋‹ค.

  • ํ›จ์”ฌ ์ž‘์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค!
    • slow K ์—์„œ inverse๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•  matrix ํฌ๊ธฐ๊ฐ€ ์ž‘๊ฒŒ ์žก์•„์„œ 60x60์ด๋ผ๊ณ  ๊ฐ€์ •ํ•˜๋ฉด (i.e., $n=60$), fast K ์—์„œ inverse ๋ฅผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•  square matrix ์˜ $n=6$ ๋Œ€๋น„ 10๋ฐฐ๊ฐ€ ํฌ๋‹ค. wiki ์— ๋”ฐ๋ฅด๋ฉด matrix inversion ์˜ time complexity ๋Š” $O(n^{2.373})$ ์ •๋„์ด์ง€๋งŒ ์–ด๋ฆผ์žก์•„ $O(n^{2})$ ๋ผ๊ณ  ํ•˜๋ฉด, 100๋ฐฐ์˜ ์‹œ๊ฐ„์ด ๋” ์†Œ์š”๋  ๊ฒƒ์œผ๋กœ ์˜ˆ์ธกํ•ด๋ณผ ์ˆ˜ ์žˆ๋‹ค.
  • ๊ณผ์—ฐ ์ง„์งœ ์ด๋งŒํผ ๋Š๋ ค์ง€๊ฒŒ ๋  ์ง€ ์ง์ ‘ ์‹คํ—˜์„ ํ†ตํ•ด์„œ ์•Œ์•„๋ณด์ž.

์‹คํ—˜

  1. ์‹คํ—˜ ์„ธํŒ…
    • ์‹คํ—˜์„ ์œ„ํ•ด r2live ์ฝ”๋“œ๋ฅผ ์ด์šฉํ•˜์˜€๋‹ค. ๊ทธ๋ฆฌ๊ณ  r2live github readme ์—์„œ ๊ณต๊ฐœ๋˜์–ด ์žˆ๋Š” ์ €์ž์˜ HKU ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์˜€๋‹ค. CPU๋Š” 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz ์„ ์ด์šฉํ•˜์˜€๊ณ , ํŠน๋ณ„ํžˆ core ์ œํ•œ์€ ํ•˜์ง€ ์•Š์•˜๋‹ค.
    • Time cost ์ธก์ •์„ ์œ„ํ•ด Faster-lio repository์— ์žˆ๋Š” timer class ๋ฅผ ๊ฐ€์ ธ์™”๋‹ค.
    • ๊ทธ๋ฆฌ๊ณ  conventional ํ•œ Kalman Gain ์ด ๊ตฌํ˜„๋˜์–ด ์žˆ์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— ์ง์ ‘ ๊ตฌํ˜„ํ•ด์ค€๋‹ค. ํฌ๊ฒŒ ์–ด๋ ต์ง€ ์•Š๋‹ค.
    • r2live ๋Š” lidar ์™€ visual ๊ธฐ๋ฐ˜์— ๊ฐ๊ฐ Kalman Gain ๊ณ„์‚ฐํ•˜๋Š” ๋ถ€๋ถ„์ด ์žˆ๋‹ค. ๊ทธ ์ค‘ ํŽธ์˜์ƒ visual part ์— ๋Œ€ํ•ด์„œ๋งŒ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•ด๋ณด์•˜๋‹ค (Kalman Filter ์ž์ฒด๋Š” abstract ํ•œ engine ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ฐœ๋…(Fast-lio๊ฐ€ fast kalman gain์„ ์ œ์•ˆํ•œ ๊ธฐ์—ฌ)์€ ๋™์ผํ•˜๋‹ค).
  2. ์‹คํ—˜ ๊ฒฐ๊ณผ
    • ์‹คํ—˜ ์ˆ˜ํ–‰ ๊ณผ์ • ๋ฐ ๊ฒฐ๊ณผ๋Š” ์•„๋ž˜ ๋น„๋””์˜ค์— ์ž์„ธํ•˜๊ฒŒ ๋‚˜์™€์žˆ๋‹ค.
      • ps. ์ด ์‹คํ—˜์„ reproduce ํ•ด๋ณด๋ ค๋ฉด:
        • docker/run ์— ์žˆ๋Š” repository์˜ volume ๊ฒฝ๋กœ๋ฅผ ๋ณธ์ธ์˜ ๊ฒƒ์œผ๋กœ ์ˆ˜์ •ํ•˜๊ธธ ๋ฐ”๋ž€๋‹ค. ๊ทธ๋ฆฌ๊ณ  demo.launch ํŒŒ์ผ์—์„œ fast version ์˜ kalman gain์„ ์‚ฌ์šฉํ• ์ง€ ๋ง์ง€ boolean param ์œผ๋กœ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜์˜€๋‹ค. docker ๋ฅผ ์ด์šฉํ•ด์„œ r2live ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๊ณผ์ •์— ๋Œ€ํ•ด์„œ๋Š” ๋‹ค๋ฅธ ๋น„๋””์˜ค <Running R2Live using Docker> ์—์„œ ์ž์„ธํ•˜๊ฒŒ ์†Œ๊ฐœํ•˜์˜€์œผ๋‹ˆ ์ฐธ๊ณ .
    • ์‹คํ—˜ ๊ฒฐ๊ณผ๋ฅผ ์ •๋ฆฌํ•ด๋ณด๋ฉด,
      1. ์œ„ ๋ฐ์ดํ„ฐ์…‹์— ๋Œ€ํ•ด, a single image ์—์„œ 50-100 ๊ฐœ ์ •๋„์˜ feature correspondences ๊ฐ€ ๋‚˜์˜จ๋‹ค.
      2. fast or slow ์–ด๋–ค ๋ฒ„์ „์˜ kalman gain์„ ์‚ฌ์šฉํ•˜๋“  accuracy ์ธก๋ฉด์—์„œ๋Š” ๊ฑฐ์˜ ๋™์ผํ•˜๊ฒŒ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ธ๋‹ค (TODO: ์‹ค์ œ๋กœ ๊ฐ™์€์ง€ K๊ฐ’ ์ฐ์–ด๋ณด๊ธฐ)
      3. fast version ์˜ kalman gain์„ ๊ณ„์‚ฐํ•˜๋Š” ์‹œ๊ฐ„์€ 0.026ms ์ •๋„๊ฐ€ ์†Œ์š”๋œ๋‹ค.
      4. slow version ์˜ kalman gain์„ ๊ณ„์‚ฐํ•˜๋Š” ์‹œ๊ฐ„์€ 2.6ms ์ •๋„๊ฐ€ ์†Œ์š”๋˜์—ˆ๋‹ค. ์•ฝ 100๋ฐฐ์˜ ์‹œ๊ฐ„์ด ์†Œ์š”๋œ ์…ˆ.
        • ์ด๋Š” ์•ž์„œ matrix inversion์˜ time complexity์— ๊ทผ๊ฑฐํ•ด์„œ ์œ ์ถ”ํ–ˆ๋˜ ๊ฒƒ๊ณผ ์œ ์‚ฌํ•œ magnitude of order ์ด๋‹ค.
  3. Lessons
    • image feature ์— ๋Œ€ํ•ด์„œ, state_dim=6 ์ด๊ณ , num_features=50-100 ์ด๋ฉด ์•ฝ 10๋ฐฐ์˜ size ๋กœ ๊ทผ์‚ฌํ•  ์ˆ˜ ์žˆ์—ˆ๊ณ , ์‹ค์ œ๋กœ ์ด์˜ ์ œ๊ณฑ๋ฐฐ ์ด์ƒ์˜ time cost ๊ฐ€ ๋ฐœ์ƒํ•จ์„ ํ™•์ธํ•˜์˜€๋‹ค.
    • ๊ทธ๋ฆฌ๊ณ  lidar feature ๋Š” ๋ณดํ†ต 1000-10000๊ฐœ ๊นŒ์ง€๋„ ๋ฐœ์ƒํ•œ๋‹ค. ํ˜„๋Œ€์˜ 3D ๋ผ์ด๋‹ค๊ฐ€ ์ฃผ๋Š” ํ•˜๋‚˜์˜ ์Šค์บ”์ด ์ˆ˜๋งŒ๊ฐœ์˜ ํฌ์ธํŠธ๋ฅผ ๊ฐ€์ง€๊ณ , ์ด๋ฅผ ์ ์ ˆํžˆ downsampling ํ•ด์„œ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ํ•˜๋”๋ผ๋„ ์ˆ˜์ฒœ๊ฐœ์˜ ํฌ์ธํŠธ๊ฐ€ ์กด์žฌํ•œ๋‹ค. 6000๊ฐœ(๊นŒ์ง€๋„ ํ•„์š”์—†์„ ์ˆ˜๋„ ์žˆ์ง€๋งŒ ๊ณ„์‚ฐ์˜ ํŽธ์˜์ƒ)๋ผ๊ณ  ๊ฐ€์ •ํ•˜๋ฉด state_dim=6 ์— ๋น„ํ•ด 1000๋ฐฐ์˜ size ๋ฅผ ๊ฐ€์ง€๋Š” matrix ๋ฅผ inversion ํ•ด์•ผ๋˜๊ฒŒ ๋œ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์ด๋ก ์ ์œผ๋กœ๋Š” ์ตœ์†Œ 1000 * 1000 ๋ฐฐ์˜ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆด ๊ฒƒ์ด๋ผ๊ณ  ์˜ˆ์ธกํ•ด๋ณผ ์ˆ˜ ์žˆ๊ฒ ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด (์œ„์™€ ๋™์ผํ•œ HW๊ธฐ์ค€) 0.026 * 1000 * 1000 = 26000ms = 26 sec ์œผ๋กœ์จ ์ด์ œ๋Š” real-time ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋œ๋‹ค. lidar scan์ด ๋ณดํ†ต 10hz๋ผ๊ณ  ๊ฐ€์ •ํ•˜๋ฉด (์‹ค์ œ๋กœ๋Š” front-end๋ฅผ ํฌํ•จํ•ด์„œ) 0.1s ๋‚ด์— update๊ฐ€ ๋˜์–ด์•ผ real-time์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค.
      • TODO: ๊ณผ์—ฐ ๊ทธ๋Ÿฌํ•œ์ง€ lidar ์˜ kalman gain์— ๋Œ€ํ•ด์„œ๋„ ์ง์ ‘ ์ธก์ • ํ•ด๋ณด์ž.
    • ๊ทธ๋ฆฌ๊ณ  ๋˜ ํ•˜๋‚˜ ๋ฌธ์ œ๊ฐ€ ๋  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์€, slow version K์—์„œ inversion ํ•˜๋Š” matrix ์˜ ํฌ๊ธฐ๋Š” feature correspondences์˜ ๊ฐœ์ˆ˜์— ์˜์กด์ ์ด๊ธฐ ๋•Œ๋ฌธ์—, time cost ๊ฐ€ scene ๋งˆ๋‹ค ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Š” ํŠน์ • ํ™˜๊ฒฝ์—์„œ ๋ฐœ์ƒํ•œ ์ ์€ time cost๋งŒ์„ ์ธก์ •ํ•˜์—ฌ ์ž์›์˜ upper bound ๋ฅผ ํ• ๋‹นํ•ด๋‘๋Š” ๊ฒฝ์šฐ, ํ™˜๊ฒฝ์ด ๋‹ฌ๋ผ์งˆ ๊ฒฝ์šฐ ๋ฌธ์ œ๊ฐ€ ๋  ์ˆ˜๋„ ์žˆ๋‹ค. ๋ฐ˜๋ฉด fast version K๋Š” ํ•ญ์ƒ 6x6 ์˜ inversion์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์†Œ์š”๋˜๋Š” ์‹œ๊ฐ„ ์—ญ์‹œ ๋งค image ๋งˆ๋‹ค ์œ ์‚ฌํ•จ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค (see the Timer::DumpIntoFile, ํ‰๊ท ์ด ์•„๋‹Œ ๋ชจ๋“  frames ์— ๋Œ€ํ•œ time cost ๊ฐ€ ๊ธฐ๋ก๋˜์–ด ์žˆ๋‹ค).

PS. ์žฌ๋ฏธ๋‚œ ์‚ฌ์‹ค๋“ค

  1. ์†๋„ ๊ฐœ์„ : ๊ทนํ•œ์˜ ๊นŽ๊ธฐ
    • r2live ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด
      K_1 = (H_T_H + (state_aft_integration.cov * CAM_MEASUREMENT_COV).inverse()).inverse();
      K   = K_1.block<DIM_OF_STATES, 6>(0, 0) * Hsub_T;
      
      • ์ด Kalman Gain ๊ตฌํ˜„์ด FAST-LIO์˜ ์‹20 ์—์„œ ์–ธ๊ธ‰ํ•œ ๊ฒƒ๊ณผ๋Š” ์•ฝ๊ฐ„ ๋‹ค๋ฅธ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
      • ์ฆ‰ size ๊ฐ€ ํฐ $\textbf{R}$ matrix ๋ฅผ ์ƒ์„ฑ์กฐ์ฐจ ํ•˜์ง€์•Š๊ณ  scalar ๊ฐ’์„ ๊ณฑํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋Œ€์ฒดํ•˜์˜€๋‹ค. ์ด๋Š” each measurements in a single image (or a single lidar scan) ์ด ๋™์ผํ•œ weight ๋ฅผ ๊ฐ€์ง„๋‹ค๊ณ  ๊ฐ€์ •ํ•  ๊ฒฝ์šฐ, $\textbf{R} = r\textbf{I}$ ์™€ ๊ฐ™์ด scaled identity ๋กœ ๊ฐ€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด ์‹์„ ์›๋ž˜ ์‹ $ \textbf{K} = (\textbf{H}^{T}\textbf{R}^{-1}\textbf{H}+\textbf{P}^{-1})^{-1}\textbf{H}^{T}\textbf{R}^{-1}$ ์— ๋Œ€์ž…ํ•˜๋ฉด ์œ„์˜ ์ฝ”๋“œ์™€ ๊ฐ™์ด $\textbf{R}$ matrix ๊ฐ€ ์‚ฌ๋ผ์ง„ ํ˜•ํƒœ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ๋‹ค.
  2. ์„ฑ๋Šฅ ๊ฐœ์„ : GICP ๋”ฐ๋ผํ•˜๊ธฐ
    • FAST-LIO์˜ ํ›„์†์ž‘์€ FAST-LIO2 ๋ผ๊ธฐ๋ณด๋‹ค๋Š”(FAST-LIO2๋Š” ๊ทธ๋ƒฅ ์ €๋„๋ฒ„์ „ ๋Š๋‚Œ..), VoxelMap ์ด๋ผ๊ณ  ์ƒ๊ฐํ•œ๋‹ค.
    • FAST-LIO์—์„œ๋Š” ๋‹จ์ˆœํ•œ point-to-plane loss (distance์— normal์ด ๊ณฑํ•ด์ง) ์„ ์‚ฌ์šฉํ•˜์˜€๋‹ค๋ฉด, VoxelMap์€ GICP-like Loss ๋ฅผ ์‚ฌ์šฉํ•˜์˜€๋‹ค. ์ฆ‰, per point ๋งˆ๋‹ค ๋‹ค๋ฅธ covariance ๋ฅผ ์ ์šฉํ•˜์˜€๋‹ค. ์žฌ๋ฐŒ๋Š” ๊ฒƒ์€ ๊ตฌํ˜„์ด๋‹ค. VoxelMap์˜ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด r2live ์˜ fast-lio๋ถ€๋ถ„๊ณผ ๊ฑฐ์˜ ๋™์ผํ•œ ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค. ๋Œ€์‹  fast-lio (r2live) ์™€ ๋‹ฌ๋ฆฌ $\textbf{H}^{T}\textbf{R}^{-1}$์„ ๋ช…์‹œ์ ์œผ๋กœ ๊ณ„์‚ฐํ•ด์ค€๋‹ค. ์ด ์—ญ์‹œ๋„ $\textbf{R}$์„ ๋ณ„๋„๋กœ ๋งŒ๋“ค์–ด์„œ ๊ณฑํ•˜๋Š”๊ฒŒ ์•„๋‹ˆ๋ผ MatrixXd Hsub_T_R_inv(6, effct_feat_num); ์™€ ๊ฐ™์ด $\textbf{H}^{T}\textbf{R}^{-1}$ ๋ผ๋Š” matrix ๋ฅผ ์•„์˜ˆ ์ฒ˜์Œ๋ถ€ํ„ฐ ์ƒ์„ฑํ•ด์„œ ๋‹ค๋ฃจ๊ณ  ์žˆ๋Š” ๊ฒƒ๋„ ์žฌ๋ฐŒ๋Š” ๋ถ€๋ถ„์ด๋‹ค. ์–ด์จŒ๊ฑฐ๋‚˜ VoxelMap์— ์™€์„œ๋Š” per-point ๋งˆ๋‹ค ๋‹ค๋ฅธ weight ๋ฅผ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๊ณ , ๊ทธ ๊ฒฐ๊ณผ ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด FAST-LIO์˜ ์‹20 ์—์„œ ์–ธ๊ธ‰ํ•œ fast kalman gain $ \textbf{K} = (\textbf{H}^{T}\textbf{R}^{-1}\textbf{H}+\textbf{P}^{-1})^{-1}\textbf{H}^{T}\textbf{R}^{-1}$ ๊ณผ ์ด์ œ ์™„๋ฒฝํžˆ format์ด ๋™์ผํ•ด์ง„ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

๊ฒฐ๋ก 

  • FAST-LIO๋Š” Kalman Gain์˜ ํ˜•ํƒœ๋ฅผ ์กฐ์ž‘ํ•จ์œผ๋กœ์จ problem solving ์‹œ๊ฐ„ ๊ฐœ์„ ์„ ์ด๋ฃจ์—ˆ๋‹ค.
  • ๊ธฐ์กด์˜ ์ž˜ ์•Œ๋ ค์ง„ K๊ฐ€ ํ•ญ์ƒ slow ํ•œ ๊ฒƒ์€ ์•„๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ low-level features์˜ geometric optimization ์„ ์ˆ˜ํ–‰ํ•˜๋Š” SLAM ๋ฌธ์ œ์—์„œ๋Š”, constraints ์˜ ๊ฐœ์ˆ˜๊ฐ€ ๋งค์šฐ ๋งŽ์€ overdetermined system ์ด ์ผ๋ฐ˜์ ์ด๋ฉฐ, ์ด ๊ฒฝ์šฐ K ๊ณ„์‚ฐ์ด slow ํ•ด์ง€๊ฒŒ ๋œ๋‹ค.
  • ๊ทธ ํ˜„์ƒ์„ ์ข€ ๋” ์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ฒŒ ๊ทธ๋ฆผ(matrix-illustrated)์œผ๋กœ ๊ทธ๋ ค๋ณด์•˜๋‹ค.
  • ๊ทธ๋ฆฌ๊ณ  ์‹ค์ œ๋กœ ๊ทธ๋Ÿฌํ•œ์ง€ ์ ์šฉ ์ „/ํ›„ ์‹คํ—˜์„ ์ˆ˜ํ–‰ํ•ด๋ณด์•˜๋‹ค.