Efficient LiDAR Odometry for Robots
Efficient LiDAR Odometry for Robots
Fig. 2. LiDAR odometry architecture. Our system first retrieves a relative transform between two temporally-adjacent scans of times k and k − 1 through
scan-to-scan (S2S) matching with RANSAC outlier rejection and an optional rotational prior from IMU. This initial estimate is then propagated into the world
frame and used as the initialization point for our secondary GICP module for scan-to-map optimization (S2M), which scan-matches the current point cloud
Pk with a derived submap Sk consisting of scans from nearby and boundary keyframes. The output of this is a globally-consistent pose estimate which is
subsequently checked against several metrics to determine if the current pose should be stored as a new keyframe.
In this letter, we present our Direct LiDAR Odometry [10] or learned networks [11] and might consist of planes [5],
(DLO) algorithm, a high-speed and computationally-efficient lines and edges [4], [6], or ground points [2]. These works
frontend localization solution which permits the direct use of aim to translate insights gained from visual odometry (VO)
dense point cloud scans without significant preprocessing. The techniques into the 3D domain. However, adding this step
main contribution of this work is a custom speed-first pipeline increases computational overhead and risks discarding data
which accurately resolves robot egomotion in real-time using points which could help with better correspondence matching
minimally-preprocessed LiDAR scans and an optional IMU for odometry accuracy. Alternatively, direct methods attempt
on consumer-grade processors. A key insight of our work to align dense point clouds but must heavily downsample to
is the link between algorithmic speed and accuracy, and achieve computational tractability [12], [13]. More recently,
our approach is comprised of three core innovations. First, a recursive filtering framework, e.g. Kalman filter, has been
an adaptive keyframing system which efficiently captures proposed [14], [15] to achieve real-time performance but at
significant environmental information through a novel spa- the potential expense of estimation accuracy.
ciousness metric. Second, a fast keyframe-based submapping A second stage immediately following scan alignment
approach via convex optimization which generates permissive between adjacent clouds has been shown to reduce global
local submaps for global pose refinement. Third, NanoGICP, drift by increasing pose estimation consistency with previous
a custom iterative closet point solver for lightweight point past scans [3], [13]. In the scan-to-map stage, a scan-to-
cloud scan-matching with data structure recycling to elim- scan transformation is further refined by aligning the current
inate redundant calculations. Our method has been exten- point cloud with an existing in-memory map; this submap is
sively evaluated in numerous challenging environments on typically derived by retrieving nearby map points within some
computationally-limited robotic platforms as part of Team radius of the robot’s current position. However, this search in
CoSTAR’s research and development efforts for the DARPA “point-space” can quickly explode in computational expense
Subterranean Challenge, and we have open-sourced our code due to the sheer number of operations needed to retrieve the
for benefit of the community1 . nearest neighbor data points. While there exists techniques
to mitigate this such as only incrementally storing map data
Related Work at keyed locations [6], this search still involves thousands of
calculations which can increase overall processor load and
LiDAR-based odometry is typically cast as a nonlinear
hence the potential to drop frames.
optimization problem to calculate a best-fit homogeneous
transform that minimizes the error across corresponding, i.e., To address these issues, our DLO algorithm is built around
matching, points and/or planes between two point clouds. a “speed-first” philosophy to permit the use of minimally-
Since correspondences are not known a priori, techniques preprocessed point clouds and provide accurate pose esti-
such as the iterative closest point (ICP) algorithm [8] or mates even for robots with limited computational resources
other variants like Generalized ICP (GICP) [9] have become (Fig. 2). The key contribution of our work lies in how we
the standard to align two point clouds; however, searching efficiently derive our submap for global refinement in scan-
over all data points can be computationally costly. Feature- to-map matching. That is, rather than extracting points within
based methods attempt to extract and use only the most a local vicinity of a robot’s current position as most works
salient points before scan-matching to reduce computation. do, DLO instead searches in keyframe-space by associating a
Such features are found either via manually tuned methods scan’s set of points with its corresponding keyframe position.
The submap is subsequently constructed by concatenating the
1 [Link] lidar odometry clouds from a subset of historic keyframes derived from nearby
CHEN et al.: DIRECT LIDAR ODOMETRY: FAST LOCALIZATION WITH DENSE POINT CLOUDS 3
keyframes and those which make up the convex hull; this Algorithm 1: Direct LiDAR Odometry
provides the current scan with both nearby and distant points W W
1 input: Pk , X̂k−1 ; initialize: X̂k−1 = I or gravityAlign()
in the submap to anchor to. In addition, a custom GICP solver W
2 output: X̂k , Mk
enables extensive reuse of data structures across multiple 3 while Pk 6= ∅ do
solver instantiations to eliminate redundant operations across // preprocessing
the two-stage process. Our system also optionally accepts 4 P̄k ← preprocessPoints(Pk ) ;
5 computeAdaptiveParameters(P̄k ) ;
an initialization prior from an IMU in a loosely-coupled // initialization
fashion to further improve accuracy during aggressive rota- 6 if k = 0 then
tional motions. The reliability of our approach is demonstrated 7 Tkt1 , Ckt1 ← NanoGICP1 .build(P̄k ) ;
W
through extensive tests on several computationally-limited 8 Kk ← updateKeyframeDatabase(X̂k−1 , P̄k ) ;
9 continue;
robotic platforms in multiple challenging environments. This 10 end
work was part of Team CoSTAR’s research and development // prior
L B L
efforts for the DARPA Subterranean Challenge in support of 11 if IMU then X̃k ← X̃k ; else X̃k ← I ;
// scan-to-scan
NASA Jet Propulsion Laboratory’s Networked Belief-aware 12 Tks1 , Cks1 ← NanoGICP1 .build(P̄k ) ;
Perceptual Autonomy (NeBula) framework [16], in which 13
L L
X̂k ← NanoGICP1 .align(Tks1 , Tkt1 , Cks1 , Ckt1 , X̃k ) ;
DLO was the primary state estimation component for our fleet W W L
14 X̃k ← X̂k−1 X̂k ;
of autonomous aerial vehicles (Fig. 1A). // scan-to-map
W
15 Qk ← getKeyframeNeighbors(X̂k−1 , Kk ) ;
W
II. M ETHODS 16 Hk ← getKeyframeHulls(X̂k−1 , Kk ) ;
17 Sk ← Qk ⊕ Hk ;
A. Notation
18 if Sk 6= Sk−1 then Tkt2 ← NanoGICP2 .build(Sk ) ; else
A point cloud, P, is composed of a set of points p ∈ P with Tkt2 ← Tk−1
t2
;
Cartesian coordinates pi ∈ R3 . We denote L as the LiDAR’s Tk ← Tk ; Cks2 ← Cks1 ; Ckt2 ← N
s2 s1 S
P
19 n Ck,n ;
W W
coordinate system, B as the robot’s coordinate system located 20
s2 t2 s2
X̂k ← NanoGICP2 .align(Tk , Tk , Ck , Ckt2 , X̃k ) ;
at the IMU frame, and W as the world coordinate system // update keyframe database and map
W
which coincides with B at the initial position. Note that in 21 Kk ← updateKeyframeDatabase(X̂k , P̄k ) ;
22 Mk ← Mk−1 ⊕ {Kk \ Kk−1 } ;
this work we assume L and B reference frames coincide. // propagate data structures
Submap, covariance, and kdtree structures are denoted as S, C 23 Tkt1 ← Tks1 ; Ckt1 ← Cks1 ;
W
and T , respectively. We adopt standard convention such that 24 return X̂k , Mk
x points forward, y points left, and z points upward, and 25 end
our work attempts to address the following problem: given
adjacent point clouds scans Pk and Pk−1 at time k, estimate an SE(3) transformation, which translates to the robot’s 6-
W
the robot’s current pose X̂k ∈ SE(3) and map Mk in W. DOF motion between consecutive LiDAR acquisitions. This
process is typically performed in two stages, first to provide a
B. Preprocessing best instantaneous guess, which is subsequently refined to be
more globally consistent with previous keyframe locations.
Our system assumes an input of 3D point cloud data
gathered by a 360◦ LiDAR such as an Ouster OS1 (20Hz) 1) Scan-to-Scan: In the first stage, the scan-to-scan match-
L
or a Velodyne VLP-16 (10Hz). To minimize information loss ing objective is to compute a relative transform X̂k between
s t t s
from the raw sensor data, only two filters are used during a source Pk and a target Pk (where Pk = Pk−1 ) captured in
preprocessing: first, we remove all point returns that may be L where
L
X̂k = arg min E XL s t
from the robot itself through a box filter of size 1m3 around k Pk , Pk . (1)
XL
the origin. This is especially important if an aerial robot’s k
propellers (Fig. 1A) or protective guards (Fig. 1B) are in the The residual error E from GICP is defined as
LiDAR’s field of view. The resulting cloud is then sent through N −1
L>
X
a 3D voxel grid filter with a resolution of 0.25m to lightly E XL P
k k
s
, P t
k = d>
i C t
k,i + X L s
C X
k k,i k di , (2)
downsample the data for subsequent tasks while maintaining i
dominate structures within the surrounding environment. Note such that the overall objective for this stage is
that in this work we do not correct for motion distortion since
N −1
non-rigid transformations can be computationally burdensome, L X
L>
X̂k = arg min d>
i
t
Ck,i + XL s
k Ck,i Xk di , (3)
and we directly use the dense point cloud rather than extracting XL
k i
features as most works do. On average, each cloud contains
∼10,000 points after preprocessing. for N number of corresponding points between point clouds
Pks and Pkt , where di = pti − XL s s s t t
k pi , pi ∈ Pk , pi ∈ Pk , ∀i, and
s t
Ck,i and Ck,i are the corresponding estimated covariance ma-
C. Scan Matching via Generalized-ICP trices associated with each point i of the source or target cloud,
LiDAR-based odometry can be viewed as the process of respectively. As will be further discussed in Section II-D, we
resolving a robot’s egomotion by means of comparing suc- can initialize the above objective function with a prior supplied
cessive point clouds and point clouds in-memory to recover by external sensors in an attempt to push the convergence
4 IEEE ROBOTICS AND AUTOMATION LETTERS. PREPRINT VERSION. ACCEPTED JANUARY, 2022
B
towards a global minimum. That is, for Eq. (3), if a prior X̃k
is available by means of IMU preintegration, we can set the
L B
initial guess X̃k = X̃k to create a loosely-coupled system. If
a prior is not available however, the system reverts to pure
L
LiDAR odometry in which X̃k = I and relies solely on point
cloud correspondence matching for this step.
2) Scan-to-Map: After recovering an initial robot motion
estimate, a secondary stage of scan-to-map matching is per-
formed and follows a similar procedure to that of scan-to-
scan. However, rather than computing a relative transform
between two instantaneous point clouds, the objective here
is to further refine the motion estimate from the previous step
to be more globally-consistent by means of matching with a
local submap. In other words, the task here is to compute an
W
optimal transform X̂k between the current source cloud Pks
and some derived submap Sk such that
W Fig. 3. Keyframe-based submapping. A comparison between the different
X̂k = arg min E XW s
k Pk , Sk . (4) submapping approaches, visualizing the current scan (white), the derived
XW
k submap (red), and the full map (blue). (A) A common radius-based submap-
ping approach of r = 20m retrieved in point cloud-space. (B) Our keyframe-
After similarly defining the residual error E from GICP as in based submapping approach, which concatenates a subset of keyed scans and
Eq. (2), the overall objective function for scan-to-map is helps anchor even the most distant points in the current scan (green box)
during the scan-to-map stage.
M −1
W
W>
X
X̂k = arg min d>
j C S
k,j + X W s
C X
k k,j k dj , (5) qk+1 = qk + ( 21 qk ⊗ ω k )∆t. Here, qk is initialized to identity
XW
k j prior to integration, ∆t is the difference in time between IMU
for M number of corresponding points between point cloud Pks measurements in seconds, and only gyroscopic measurements
and submap Sk , where Ck,jS
is the corresponding scan-stitched found between the current LiDAR scan and the previous one
covariance matrix for point j in the submap as defined later in are used. Note that we are only concerned with a rotational
Section II-F. Eq. (5) is initialized using the propagated result prior during IMU preintegration and leave the retrieval of a
from scan-to-scan in the previous section from L to W, i.e. translational prior via the accelerometer for future work. The
W W L resulting quaternion of this propagation is converted to an
X̃k = X̂k−1 X̂k , so that this prior motion can be compared
SE(3) matrix with zero translational component to be used
against historical map data for global consistency. The output B
W as X̃k , the scan-to-scan prior.
of this stage X̂k is the final estimated robot pose used for
downstream modules.
We note here that a key innovation of this work is how E. Fast Keyframe-Based Submapping
we derive and manage our submap for this stage. Whereas
previous works create a submap by querying the locality of A key innovation of this work lies in how our system
each individual point in a stored map, we associate scans to manages map information and derives the local submap in
keyframes and search rather in keyframe-space to stitch point scan-to-submap matching for global egomotion refinement.
clouds together and create Sk . The implications of this include Rather than working directly with point clouds and storing
a far faster and more consistent generation of a local submap, points into a typical octree data structure, we instead keep a
which is additionally more permissive as compared to a radius- history of keyframes to search within, in which each keyframe
based search and will be further discussed in Section II-E. is linked to its corresponding point cloud scan in a key-
value pair. The resulting local submap used for scan-to-submap
matching is then generated by concatenating the corresponding
D. Optimization Prior point clouds from a subset of the keyframes, rather than
Eq. (3) describes the scan-to-scan nonlinear optimization directly retrieving local points within some radius of the
problem and can be initialized with a prior to reduce the robot’s current position.
chances of converging into a sub-optimal local minima. This The implication of this design choice is twofold: first,
prior represents an initial guess of the relative motion between by searching in “keyframe-space” rather than “point cloud-
two LiDAR frames and can come from integrating angular space,” a much more computationally tractable problem is
velocity measurements from an inertial measurement unit obtained. Radius-based searches within a cumulative point
(IMU). More specifically, angular velocity measurements ω̂ k cloud map can require distance calculations against hundreds
is defined as ω̂ k = ω k + bω ω
k + nk measured in B with of thousands of points — a process that quickly becomes
ω
static bias bk and zero white noise nω k for convenience. infeasible even with an incremental octree data structure.
After calibrating for the bias, a relative rotational motion of Searching against keyframes, however, typically involves only
the robot’s body between two LiDAR frames can be com- a few hundred points even after long traversals and provides
puted via gyroscopic propagation of the quaternion kinematics much more consistent computational performance, reducing
CHEN et al.: DIRECT LIDAR ODOMETRY: FAST LOCALIZATION WITH DENSE POINT CLOUDS 5
TABLE I
S UMMARY OF DATA S TRUCTURE R ECYCLING
Element Scan-to-Scan Scan-to-Map
reuse from S2S
Tksource build −−−−−−−−→
Tktarget source
Tk−1 build when Sk 6= Sk−1
reuse from S2S
Cksource compute −−−−−−−−→
PN S
Cktarget source
Ck−1 n Ck,n
system requires eight total elements to successfully perform kdtree data structures, which are subsequently used for point
scan-to-scan and scan-to-map matching. This includes kdtrees cloud correspondence matching by FastGICP. In practice, data
Tk used to search for point correspondences and covariance structure sharing is performed between two separate NanoG-
matrices Ck for GICP alignment for both source and target ICP instantiations with different hyperparameters — one to
clouds in each scan-matching process. target each scan-matching problem — and done procedurally
Out of the four required kdtrees data structures, only two as detailed in Algorithm 1.
need to be built explicitly. That is, the tree for the source
(input) cloud Tksource can be built just once per scan acquisition
III. R ESULTS
and shared between both modules (as the same scan is used
for both sources). For the scan-to-scan target tree Tktarget , this A. Component Evaluation
is simply just the previous iteration’s scan-to-scan source tree To investigate the impact of our system’s components,
source
Tk−1 and thus can be propagated. The scan-to-map target tree including keyframe-based submapping, submap normal ap-
needs to be built explicitly, but since the submap is derived proximation, and the reuse of data structures, we compare each
from a set of keyframes, this build only needs to be performed component with its counterpart using the Alpha Course dataset
when the set of selected keyframes via our kNN and convex from the Urban circuit of the DARPA Subterranean Challenge.
hull strategy changes from one iteration to the next, such that This dataset contains LiDAR scans from a Velodyne VLP-16
Sk 6= Sk−1 . Otherwise, the data structure can just be reused sensor, in addition to IMU measurements from a VectorNav
again for additional computational savings. Point covariances VN-100, collected across 60 minutes in an abandoned power-
Ck needed for GICP, on the other hand, only need to be plant located in Elma, WA which contains multiple perceptual
computed once per scan aquisition, and its data can be shared challenges such as large or self-similar scenes (Fig. 5). For
directly in the other three instances. these component-wise evaluations, data was processed using
3) Dual NanoGICP: To facilitate the cross-talking between a 4-core Intel i7 1.30GHz CPU.
scan-matching modules, we developed NanoGICP, a custom it- 1) Keyframe-Based Submapping: We compared the abso-
erative closest point solver which combines the FastGICP [17] lute pose error (APE), processing time, and CPU load across
and NanoFLANN [18] open-source packages with additional three submapping schemes, including: radius-based (r = 10m),
modifications for data structure sharing as described before. In keyframe-based with a 1m static threshold, and keyframe-
particular, NanoGICP uses NanoFLANN to efficiently build based with adaptive thresholding. For keyframe-based variants,
CHEN et al.: DIRECT LIDAR ODOMETRY: FAST LOCALIZATION WITH DENSE POINT CLOUDS 7
TABLE III
C OMPARISON ON B ENCHMARK DATASETS
Alpha Course (757.4m) Beta Course (631.5m) CPU Usage
Method APE [m] ME [m] APE [m] ME [m] No. of Cores
max mean std rmse max mean std rmse max mean
BLAM [12] 3.44 1.01 0.94 0.43 3.89 2.27 0.89 1.27 1.14 0.93
Cartographer [19] 5.84 2.91 1.60 1.05 2.64 1.37 0.67 0.31 1.75 0.88
LIO-Mapping [5] 2.12 0.99 0.51 0.45 1.60 1.18 0.22 0.61 1.80 1.53
LOAM [10] 4.33 1.38 1.19 0.60 2.58 2.11 0.44 0.99 1.65 1.41
LOCUS [13] 0.63 0.26 0.18 0.28 1.20 0.58 0.39 0.48 3.39 2.72
DLO 0.40 0.18 0.06 0.19 0.50 0.16 0.09 0.19 0.92 0.62