# PV-LIO: FAST-LIO2's filter on a map of uncertain planes, built without ROS and measured

> Satyajit Ghana — Head of Engineering @ Inkers Technology
> canonical: https://ai.satyajit.si/articles/pv-lio
> date: 2026-11-21
> tags: slam, lidar, state-estimation, point-cloud, benchmarks, robotics

PV-LIO is a small repository that answers one question about FAST-LIO2: what if the filter knew
how much to trust each point? It keeps FAST-LIO2's IMU propagation, deskewing and iterated Kalman
update, and swaps the map. Instead of an ikd-Tree of points it keeps VoxelMap's hash of voxels,
each holding a plane with an error bar, and it weights every point-to-plane residual by how
uncertain that residual is, where FAST-LIO2 gives all of them one fixed variance.

I gave it the same test as [FAST-LIO2](/articles/fast-lio2-lidar-inertial-odometry), with one more
rule: no ROS anywhere. The article has two halves. First the mechanism, read from the code at the
commit I built and checked against the VoxelMap paper: how a return's noise becomes a covariance,
how a plane inherits one from its points, how voxels split, and where the weight enters the
update. Then the measurement: PV-LIO compiled with its ROS layer replaced, fed four public
sequences with independent ground truth, in three configurations, one of them an ablation that
removes the weighting and nothing else.

Where it landed: the repo's Hilti config is very good indoors (3.95 cm over a 38 m
basement walk), the wrong choice outdoors (8.7 GB of map after five minutes), and the weighting
that defines the method rescues one of four sequences and is matched or beaten by a constant
weight on the other three.

## FAST-LIO2 trusts every plane the same

In [FAST-LIO2](/articles/fast-lio2-lidar-inertial-odometry) a scan point becomes a residual like
this: move it into the world with the current pose, find its five nearest map points, fit a
plane, reject the fit if any of the five sits more than 0.1 m off it, and use the point's signed
distance to the plane. Every surviving residual enters the update with the same variance,
`LASER_POINT_COV`, 0.001 m² at the top of `laserMapping.cpp`: a 3.16 cm standard deviation for a
return from a wall a metre away and for one from a tree 60 m off, for a tight plane and for one
stretched across a corner.

That works, and it is cheap. But it folds two errors into one constant. The sensor's noise grows
with range: a tenth of a degree of bearing error is under 2 mm at 1 m and over 10 cm at 60 m. And
the plane is itself an estimate from noisy points.

[VoxelMap](https://arxiv.org/abs/2109.07082) (Chongjian Yuan, Wei Xu, Xiyuan Liu, Xiaoping Hong
and Fu Zhang, RA-L 2022, from the same HKU MaRS lab as FAST-LIO2) models both: a 3×3 covariance
per point, a 6×6 covariance per plane, and a residual weighted by the variance they give along the
normal. Both of its shipped configs run LiDAR-only (`imu_en: false`), with an older 18-dimensional
filter and no extrinsic in the state behind the switch. [PV-LIO](https://github.com/HViktorTsoi/PV-LIO),
by HViktorTsoi, puts that map under FAST-LIO2's IKFoM filter, adds the LiDAR-to-IMU extrinsic to
the covariance chain so it can be estimated online, and parallelises the map update. There is no
PV-LIO paper. What follows is read from the code at commit `494c27f` (23 July 2023) and checked
against VoxelMap's.

<RepoCard repo="HViktorTsoi/PV-LIO" />

## A return is a range and a direction

A spinning LiDAR measures a distance $d$ along a bearing $\boldsymbol\omega$ (a unit vector). Both
are noisy. VoxelMap's Eq. 1 writes the point as ${}^L\mathbf{p} = d\,\boldsymbol\omega$ and
perturbs each: $\delta_d \sim \mathcal N(0, \sigma_d^2)$ along the beam and a 2D bearing error
$\delta_{\boldsymbol\omega} \sim \mathcal N(\mathbf 0, \Sigma_{\boldsymbol\omega})$ in the plane
tangent to the unit sphere at $\boldsymbol\omega$. To first order

$$
\delta\,{}^L\mathbf{p} \;=\; \underbrace{\begin{bmatrix}\boldsymbol\omega & -d\,\lfloor\boldsymbol\omega\rfloor_\wedge \mathbf N(\boldsymbol\omega)\end{bmatrix}}_{\mathbf A}
\begin{bmatrix}\delta_d\\ \delta_{\boldsymbol\omega}\end{bmatrix},
\qquad
\Sigma_{{}^L\mathbf p} = \mathbf A \begin{bmatrix}\sigma_d^2 & \mathbf 0\\ \mathbf 0 & \Sigma_{\boldsymbol\omega}\end{bmatrix}\mathbf A^{\top},
$$

where $\mathbf N(\boldsymbol\omega)$ is a 3×2 orthonormal basis of the tangent plane and
$\lfloor\cdot\rfloor_\wedge$ the cross-product matrix. The covariance is an ellipsoid: thin along
the beam, with width $d$ times the bearing error across it. Close to the sensor the range term
dominates; far away the bearing term does.

The code is `calcBodyCov` in `include/voxel_map_util.hpp`: it builds exactly that $\mathbf A$ from the
point's direction and range and returns `direction * range_var * direction.transpose() + A * direction_var * A.transpose()`.
The config keys are named `ranging_cov` and `angle_cov`, but the function squares them, so they
are standard deviations: a metre and a degree. The repo's Hilti 2022 config (`hesai.yaml`) sets
0.01 m and 0.1°; its generic spinning-LiDAR config (`velodyne.yaml`) sets 0.04 m and 0.1°. With
0.1° of bearing noise a return at 1.08 m, the median range in the Hilti basement used below, is
uncertain by 0.19 cm across the beam; at 5.6 m, the median on the Oxford walk, by 0.98 cm; at
10 m by 1.75 cm.

What a point-to-plane residual sees is that ellipsoid projected on the plane's normal. If the
beam meets the surface at angle $\theta$ to the normal, the variance along the normal is
$\sigma_d^2\cos^2\theta + (d\sin\sigma_b)^2\sin^2\theta$. Head-on, only the range noise counts;
at a grazing angle, only the bearing noise, scaled by distance. Drag the range and the angle:

<PointNoise />

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/fig1-point-uncertainty.png?v=4674c4d872581632"
  alt="Left: a LiDAR at the origin with pose uncertainty (a green ellipse) measures a point; a blue patch of the unit sphere around the bearing shows the bearing noise delta-omega in the tangent plane and the depth noise delta-d along the beam. Right: the resulting point covariance drawn as a red ellipse at the end of the beam."
  caption="VoxelMap's point model: (a) depth noise along the beam and bearing noise in the tangent plane of the sphere, plus the pose uncertainty of the sensor; (b) the point covariance they produce in the world frame (VoxelMap paper, Figure 1)."
/>

## Into the world, pose and extrinsic included

The plane lives in the world frame, and the pose that moves the point there is uncertain too.
VoxelMap's Eq. 3 propagates both: with ${}^W\mathbf p = \mathbf R\,{}^L\mathbf p + \mathbf t$,

$$
\Sigma_{{}^W\mathbf p} = \mathbf R\,\Sigma_{{}^L\mathbf p}\,\mathbf R^{\top}
+ \mathbf R\lfloor{}^L\mathbf p\rfloor_\wedge\,\Sigma_{\mathbf R}\,\lfloor{}^L\mathbf p\rfloor_\wedge^{\top}\mathbf R^{\top}
+ \Sigma_{\mathbf t}.
$$

The middle term is a rotation error swinging the point round the sensor, so it also grows with
range. PV-LIO adds one more link. Its state, like FAST-LIO2's, holds the LiDAR-to-IMU rotation
and translation, so `transformLiDARCovToWorld` applies the same formula twice: LiDAR to IMU body
with the extrinsic's covariance (blocks 6 to 11 of the filter's `P`), then body to world with the
pose's (blocks 0 to 5). That is the "covariance propagation incorporating the LiDAR-IMU extrinsic
parameters" the README credits to a derivation by Xiaokai. With the extrinsic fixed, as in
`hesai.yaml`, those blocks stay at their initial 1e-5 and add almost nothing.

## A plane fitted from points is uncertain too

A voxel's plane comes from its points by PCA: the centre $\mathbf q$ is their mean, the normal
$\mathbf n$ is the eigenvector of their covariance $\mathbf A$ with the smallest eigenvalue
$\lambda_3$. Both are functions of the points, so the points' noise flows into them. VoxelMap
differentiates the eigen-decomposition (its Eq. 7): moving point $i$ changes the normal by

$$
\frac{\partial\mathbf n}{\partial\,{}^W\mathbf p_i}
= \mathbf U\begin{bmatrix}\mathbf F^{\mathbf p_i}_{1}\\ \mathbf F^{\mathbf p_i}_{2}\\ \mathbf F^{\mathbf p_i}_{3}\end{bmatrix},\quad
\mathbf F^{\mathbf p_i}_{m} = \begin{cases}\dfrac{({}^W\mathbf p_i - \mathbf q)^{\top}}{N(\lambda_3 - \lambda_m)}\left(\mathbf u_m\mathbf n^{\top} + \mathbf n\,\mathbf u_m^{\top}\right) & m\ne 3\\[4pt] \mathbf 0 & m = 3\end{cases},
\qquad
\frac{\partial\mathbf q}{\partial\,{}^W\mathbf p_i} = \tfrac1N\mathbf I,
$$

and the plane's 6×6 covariance is the sum over its points (Eq. 8):

$$
\Sigma_{\mathbf n,\mathbf q} = \sum_{i=1}^{N}\frac{\partial(\mathbf n,\mathbf q)}{\partial\,{}^W\mathbf p_i}\,\Sigma_{{}^W\mathbf p_i}\,\frac{\partial(\mathbf n,\mathbf q)}{\partial\,{}^W\mathbf p_i}^{\top}.
$$

The $\lambda_3 - \lambda_m$ in the denominator says a lot. A patch that is long and
wide (large $\lambda_1,\lambda_2$) pins its normal down; a narrow strip, where $\lambda_2$ is
close to $\lambda_3$, leaves the normal free to rock about the strip's axis. And the lever arm
$({}^W\mathbf p_i - \mathbf q)$ means far-off points tilt the normal more than central ones. The
normal and centre are correlated, since they come from the same points, so the code keeps the
full 6×6 block rather than two 3×3s. In `OctoTree::init_plane` this is a loop over the voxel's
points, `plane->plane_cov += J * points[i].cov * J.transpose()`, with `J` stacked from the two
derivatives.

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/fig2-plane-uncertainty.png?v=4206b27aa7e6b5d4"
  alt="A dashed rectangle labelled Plane containing about a dozen points, each drawn as a red ellipse of different size and orientation, with a blue arrow for the plane normal ending in a small patch of the sphere that shows the normal's uncertainty."
  caption="The plane model: every point in the voxel carries its own covariance, and together they set the uncertainty of the fitted normal (VoxelMap paper, Figure 2)."
/>

The uncertainty shrinks with every point added, and quickly. In VoxelMap's simulation (Figure 4)
the trace of the normal's covariance is near zero by about 50 points, which is the paper's case
for freezing a plane once it has enough. PV-LIO's code does the freezing with two counters from
the config, `max_cov_points_size` and `max_points_size`, both 1000 in every shipped config: after
1000 points a voxel stops refitting and drops its point list.

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/fig4-normal-convergence.png?v=1d6a7c95af696b53"
  alt="A curve of the trace of the normal-vector covariance against the number of points in the plane, from 0 to 200 points: it starts near 0.25, falls steeply over the first 20 points and is close to zero by about 50."
  caption="The normal's uncertainty falls quickly with the number of points in the plane, which is why a voxel can stop refitting once it is full (VoxelMap paper, Figure 4)."
/>

## Voxels that split until they are flat

A plane per voxel only works if each voxel holds something flat. A 1 m cell on a floor is a
plane; a 1 m cell round a door frame is not, and a size small enough for the door frame wastes
thousands of cells on the floor. VoxelMap's answer is a hash of root voxels with an octree in each
(`OctoTree::init_octo_tree`, `cut_octo_tree`). Once a voxel holds more than `layer_point_size`
points (5 at every layer in the shipped configs) it fits a plane. If the smallest eigenvalue is
under `plannar_threshold` it keeps it and stops. If not, it is cut into eight children and each
tries again, down to `max_layer`; a last-layer child that is still not flat holds no plane, and a
point landing there matches nothing.

`hesai.yaml` uses 0.25 m roots and `max_layer: 2`; `velodyne.yaml`, 1 m roots and `max_layer: 4`.
Both bottom out at 6.25 cm. The threshold is 0.01 m² in both, and it is a variance, so it accepts
points within roughly 10 cm of a plane: on a 0.25 m root that admits nearly anything, at 1 m it
is a real test. Here is the rule on a 2D slice, where a cut makes four children:

<AdaptiveVoxels />

The result is a map whose unit is a plane with an error bar. VoxelMap's Figure 6 colours them by
uncertainty on KITTI 00: large and certain on the road and walls, small and doubtful in clutter.

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/fig6-plane-uncertainty-map.jpg?v=ce0ce2fcee16e493"
  alt="Top: a top-down map of a KITTI city sequence made of thousands of small discs, mostly blue. Bottom: a zoom on one street showing discs of many sizes, blue on the road and walls and yellow to red on cars and vegetation."
  caption="Planes in VoxelMap's adaptive map of KITTI 00, coloured by the trace of their covariance from low (blue) to high (red), drawn as discs sized by the points' spread (VoxelMap paper, Figure 6)."
/>

PV-LIO's README shows the same kind of map on Hilti 2022 `exp11`:

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/pvlio-voxelmap-hilti-exp11.jpg?v=89121422470d88af"
  alt="A dark view of an indoor construction site mapped as many small coloured plane patches, with walls, floor and ceiling built from rectangles of different sizes."
  caption="PV-LIO's voxel map with its plane uncertainties on Hilti 2022 exp11 (PV-LIO README, doc/voxelmap.jpg)."
/>

## Match by probability, weigh by variance

Registration is where the two covariances meet. For a scan point at ${}^W\mathbf p$ (moved with
the current pose estimate), `BuildResidualListOMP` finds its root voxel by hash and walks the
octree under it (`build_single_residual`). At each plane it meets it computes the point-to-plane
distance $d = \mathbf n^{\top}({}^W\mathbf p - \mathbf q)$ and that distance's variance, from both
sources (VoxelMap Eq. 10 and 11):

$$
\sigma_d^2 = \mathbf J_{\mathbf n,\mathbf q}\,\Sigma_{\mathbf n,\mathbf q}\,\mathbf J_{\mathbf n,\mathbf q}^{\top} + \mathbf n^{\top}\Sigma_{{}^W\mathbf p}\,\mathbf n,
\qquad \mathbf J_{\mathbf n,\mathbf q} = \begin{bmatrix}({}^W\mathbf p - \mathbf q)^{\top} & -\mathbf n^{\top}\end{bmatrix}.
$$

A plane is a candidate only if the point projects within three plane radii of its centre (the
radius is the square root of the largest eigenvalue) and $|d| < 3\sigma_d$. Among the candidates
in the voxel's subtree, the one with the highest Gaussian density
$\sigma_d^{-1}\exp(-d^2/2\sigma_d^2)$ wins. If none passes, the code looks once in a neighbouring
root voxel; if that fails too, the point is dropped. FAST-LIO2 has no such gate: a plane either
fits its five neighbours to 0.1 m or it does not.

The weight is the other half. FAST-LIO2 calls `update_iterated_dyn_share_modified(LASER_POINT_COV, ...)`
with one scalar. PV-LIO calls `update_iterated_dyn_share_diagonal()`, which reads a per-residual
inverse variance from `ekfom_data.R`, filled in the observation model:

```cpp
// PV-LIO src/voxelMapping.cpp, observation_model_share
Eigen::Matrix<double, 1, 6> J_nq;
J_nq.block<1, 3>(0, 0) = point_world - ptpl_list[i].center;
J_nq.block<1, 3>(0, 3) = -ptpl_list[i].normal;
double sigma_l = J_nq * ptpl_list[i].plane_cov * J_nq.transpose();
M3D R_cov_Rt = s.rot * s.offset_R_L_I * cov_lidar * s.offset_R_L_I.conjugate() * s.rot.conjugate();
double R_inv = 1.0 / (sigma_l + norm_vec.transpose() * R_cov_Rt * norm_vec);
ekfom_data.R(i) = R_inv;
```

and the gain becomes $\mathbf K = (\mathbf H^{\top}\mathbf R^{-1}\mathbf H + \mathbf P^{-1})^{-1}\mathbf H^{\top}\mathbf R^{-1}$,
where FAST-LIO2's $\mathbf R^{-1}$ is the identity times 1000. A line left in the source,
`// ekfom_data.R(i) = 1.0 / LASER_POINT_COV;`, is FAST-LIO2's version commented out.

One detail I did not expect. The match gate uses the point's covariance in the world, pose
uncertainty included. The weight does not: `R_cov_Rt` rotates the bare sensor covariance
`cov_lidar` into the world and leaves the pose terms out, presumably because the pose error is
the thing the update is estimating and counting it again in the measurement noise would
double-count it. VoxelMap's paper writes the weight the same way (its Eq. 13 uses
$\Sigma_{{}^L\mathbf p}$, not $\Sigma_{{}^W\mathbf p}$).

So a residual against a big, well-sampled plane from a nearby head-on return gets a variance of
a few square millimetres and pulls hard; one against a small plane fitted to a few far points, at
a grazing angle, gets a variance of square centimetres and barely counts. FAST-LIO2 gives both
the same 0.001 m².

## The rest is FAST-LIO2

Everything round the map is FAST-LIO2's, down to file names: `IMU_Processing.hpp` propagates and
deskews, `use-ikfom.hpp` defines the same 23-dimensional state (position, attitude, extrinsic,
velocity, both biases, gravity on $S^2$), `esekfom.hpp` is IKFoM with the diagonal-R update added.
A scan is voxel-downsampled (`down_sample_size`, 0.2 m in `hesai.yaml`), each point gets its body
covariance, and the filter iterates up to 4 times. Then the scan goes into the map, in PV-LIO's
own `updateVoxelMapOMP`: new root voxels are created serially, and existing ones are updated in
parallel across the hash buckets, most certain points first.

What else the code does that is worth knowing before running it:

- **The map never forgets.** FAST-LIO2 deletes map outside a cube round the sensor. PV-LIO's
  `voxel_map` is an `unordered_map` that only grows; nothing in the source removes a voxel.
- **The neighbour lookup mixes units.** When a point finds no plane in its own root voxel, the
  fallback picks a neighbour by comparing `loc_xyz` (in voxel units) with `voxel_center_` (in
  metres). They agree only when `voxel_size` is 1; at 0.25 m the choice follows the sign of the
  coordinate, not the face the point is near. VoxelMap has the same lines. It costs matches near
  voxel faces, not correctness.
- **It is not maintained.** The last commit is from July 2023, and the README's to-do list starts
  with "Handle conditions where nMeasurements &lt; nDof".

## What the sources claim

PV-LIO publishes no numbers of its own. Its README is three animations and a picture: a 16-beam
RoboSense in a staircase walked with "crazy rotation", a Livox Avia in a long tunnel, and three
Hilti 2022 sequences, one of them beside FAST-LIO2.

<Video
  src="https://ai.satyajit.si/articles/pv-lio/stair-clip"
  poster="https://media.thesatyajit.com/ai/articles/pv-lio/stair-clip-poster.jpg?v=b58ae65fdd711ced"
  alt="A dark 3D view of a narrow stairwell being mapped: flights of stairs and landings appear in green and orange as the sensor turns and climbs."
  caption="PV-LIO on the README's RoboSense RS16 staircase_crazy_rotation sequence, the first 15 s of the author's animation (PV-LIO README, doc/stair.gif)."
/>

<Video
  src="https://ai.satyajit.si/articles/pv-lio/hilti15-clip"
  poster="https://media.thesatyajit.com/ai/articles/pv-lio/hilti15-clip-poster.jpg?v=67d7310c64458e23"
  alt="Two views of the same stairwell map side by side, labelled PV-LIO on the left and FAST-LIO2 on the right, each with a cyan trajectory through it; the lower part of the two maps differs."
  caption="The README's Hilti 2022 exp15 comparison, PV-LIO left and FAST-LIO2 right, the first 15 s of the author's animation. It is the author's run and settings, not mine (PV-LIO README, doc/hilti15.gif)."
/>

The numbers behind the method are VoxelMap's, measured on VoxelMap. Its closest test is Table V:
a Livox Avia with its IMU, FAST-LIO2's and Faster-LIO's downsampling switched off so all three see
every point. After a 485 m loop of a park the end-to-end error is 0.03 m for VoxelMap against
1.09 m for FAST-LIO2 and 0.88 m for Faster-LIO, at 8.1, 12.9 and 9.8 ms a scan. On a 3,490 m
mountain flight it is 6.9, 7.1 and 9.8 m: the gap closes when the scene stops being planes. On
KITTI the paper's ablation puts most of the gain on the probabilistic planes. With the plane
uncertainty zeroed, it says, VoxelMap is "at the same level of FAST-LIO2".

That is the testable claim. If the weights are what matter, PV-LIO with FAST-LIO2's constant weight
in their place should fall behind. So that is one of the variants I ran.

## Building it without ROS

PV-LIO is a catkin package. `voxelMapping.cpp` is one `main()` that subscribes to two topics,
spins, and publishes odometry, clouds and plane markers. Nothing in the estimator needs ROS, and I
did not want to rewrite the plumbing, because a rewrite is where a port drifts from the original.
So the C++ compiles as written and ROS is replaced underneath it:

- **A shim for the headers.** `ros/ros.h`, `sensor_msgs/Imu.h`, `tf/transform_broadcaster.h`,
  `visualization_msgs/MarkerArray.h`, even `<Python.h>` and `<openssl/md5.h>` (included, never
  called) resolve to one header of plain structs. Publishers do nothing. `NodeHandle::param` reads
  a flat file written from the repo's YAML and logs every key the code asked for.
- **An offline feeder behind `subscribe` and `spinOnce`.** Each `spinOnce` delivers one message in
  timestamp order: an IMU sample at its stamp, a scan at its last point's time. PV-LIO's own main
  loop runs unchanged, and since nothing is ever late, the trajectory does not depend on how fast
  the machine is.
- **Two compile-time constants become calls.** `ROOT_DIR` and the OpenMP count `MP_PROC_NUM`
  (upstream CMake sets 12 on any machine with more than 14 cores) read the environment.
- **A checked patch for outputs.** A per-scan timer, the pose at each scan's end time, the deskewed
  scan in the world frame, and two diagnostics. Each edit must match the source exactly once.

```bash
# systems/pv-lio: the build
git fetch --depth 1 origin 494c27f62f7333d6cc32c26dccaa8d8a971c2c2d && git checkout FETCH_HEAD
python3 patch.py src/PV-LIO                  # 8 anchored edits, all-or-nothing
cmake -S . -B build -DPVLIO_SRC=src/PV-LIO   # shim/include first on the include path
make -C build -j"$(nproc)"                   # conda-forge gcc, Eigen, PCL; no ROS anywhere
```

The first build failed on CMake, not on PV-LIO: it de-duplicated the two `-include` flags I passed
into one, and gcc read the shim header as a second source file.

## Measured on four sequences, without ROS

PV-LIO ran in the site's LIO shootout: every system on the same converted sequences, on the same
machine (the Blackwell box, an Intel i7-14700 with 28 hardware threads; its GPU is not used),
scored by the same script. The harness converts each ROS 1 bag once, with the pure-Python
`rosbags` library, into raw IMU samples and raw LiDAR sweeps with per-point times. Each system
writes the IMU pose at the end of every sweep. The score moves each pose into the reference's
frame, fits one SE(3) Umeyama alignment without scale, and reports ATE as the RMS position error
after it, with evo's RPE over every metre of path. Milliseconds per scan are the estimator's own
work, IMU propagation through the map update, from a separate serial pass on four threads pinned
to cores 0 to 3 with the rest of the box kept off them. Peak memory is `/usr/bin/time`'s.

The four sequences:

- **Hilti 2022 `exp14_basement_2`**, the basement from [the FAST-LIO2 article](/articles/fast-lio2-lidar-inertial-odometry):
  a handheld Hesai PandarXT-32, 38 m in 74 s, the median return 1.08 m away.
- **Oxford Spires `keble-college-03`**: a backpack Hesai QT64, 283 m round a college quad in
  286 s, median return 5.6 m.
- **Hilti 2022 `exp16_attic_to_upper_gallery_2`**, the hard one: 117 m in 200 s through the
  Sheldonian Theatre's attic and down and up two stairwells, median return 0.87 m. Exp14, exp16
  and exp18 are the only 2022 sequences with a dense public reference (see
  [the Hilti article](/articles/hilti-slam-dataset) for how it is made).

- **Newer College 2021 `park`**: a handheld Ouster OS0-128 on a 2.4 km loop through a park in
  26 minutes, start and end 0.4 m apart. PV-LIO ships no Ouster config, so its shipped run there
  is `velodyne.yaml`, the generic spinning-LiDAR one, and the fixed-weight run is that config
  with the weights fixed.

I ran three variants. **`hesai.yaml`** is the shipped config whose sensor matches: it is the
repo's Hilti 2022 config, and the Oxford rig is also a Hesai. **`velodyne.yaml`** is the other
shipped spinning-LiDAR config: 1 m roots, four layers, 0.4 m scan downsampling, 4 cm range noise,
and online extrinsic estimation on, as shipped. **Fixed weight** is `hesai.yaml` with one change:
every residual's weight replaced by FAST-LIO2's constant 1/0.001, everything else, the three-sigma
gate included, untouched. Only sensor facts were overridden: the extrinsic from the dataset's
calibration, the beam count and the scan rate.

<PvBench />

Trajectory error, ATE and then RPE per metre (translation, rotation):

| Run | Hilti exp14 | Oxford Spires | Hilti exp16 |
|---|---|---|---|
| PV-LIO, `hesai.yaml` (shipped) | 3.95 cm · 3.17 cm, 0.70° | 10.9 cm · 0.66 cm, 0.21° | **1.73 m** · 20.7 cm, 1.66° |
| PV-LIO, fixed weight | **3.89 cm** · 2.62 cm, 0.51° | **4.65 cm** · 0.65 cm, 0.22° | diverged (ATE 414 m) |
| PV-LIO, `velodyne.yaml` (shipped) | 7.28 cm · 4.96 cm, 1.01° | 4.71 cm · 0.92 cm, 0.23° | diverged |
| FAST-LIO2, shipped 0.5 m voxels (beast2) | 50.1 cm · 22.0 cm, 2.04° | 7.2 cm · 0.97 cm, 0.19° | not run |
| Super-LIO (beast2) | 9.3 cm · 4.8 cm, 0.79° | 8.0 cm · 1.5 cm, 0.19° | not run |

Cost on the Blackwell box, mean milliseconds per scan from the serial pass and peak memory:

| PV-LIO run | Hilti exp14 | Oxford Spires | Hilti exp16 |
|---|---|---|---|
| `hesai.yaml` | 8.6 ms, 506 MB | 48.3 ms, 8,718 MB | 17.5 ms, 2,139 MB |
| fixed weight | 8.4 ms, 506 MB | 48.0 ms, 8,768 MB | 14.4 ms, 2,461 MB |
| `velodyne.yaml` | **4.6 ms, 203 MB** | **25.6 ms, 1,651 MB** | 5.0 ms, 1,875 MB |

The FAST-LIO2 and Super-LIO rows are the FAST-LIO2 article's runs on beast2 (an Intel i7-6850K,
ROS 2 bag playback, an earlier harness with the same scoring rules), so their timing is not
comparable and is left out. The same-machine FAST-LIO2 row belongs to the shootout, whose
FAST-LIO2 build was still being fixed when these runs finished.

### The basement is no longer a problem

On Hilti exp14 the shipped config tracks to 3.95 cm over 38 m, at 8.6 ms a scan and 506 MB. In the
FAST-LIO2 article, on a different machine and harness, FAST-LIO2's shipped 0.5 m map managed 50.1
cm on this sequence and Super-LIO 9.3 cm. I would not put those three numbers in one ranking,
since the runs differ in more than the system. But the cause of FAST-LIO2's failure there was a
map with one point per half-metre cube in a room whose walls are a metre away, and PV-LIO's config
for this dataset uses 0.25 m voxels that each keep a plane fitted to up to 1,000 points. It never
has that problem. The 1 m `velodyne.yaml` is 7.28 cm on the same walk: worse, still fine.

The maps agree. The harness grids each map at 3 cm, finds the 1 m cells whose points form a
plane, and takes the RMS distance of those points to it. For walls that comes to 24.7 mm for
`hesai.yaml`, 25.2 mm for `velodyne.yaml` and 26.1 mm with fixed weights: the same room, equally
sharp, within a couple of millimetres.

<MapViewer
  scenes={[
    { label: "Hilti exp14", poster: "/articles/pv-lio/map-hilti14-default-oblique.jpg", posterAlt: "An oblique view of the basement point map coloured by height: a rectangular hall with a curved end and side rooms, walls in green and yellow, the floor in blue.", layers: [
      { label: "hesai.yaml", src: "/articles/pv-lio/map-hilti14-default.glb", note: "PV-LIO with hesai.yaml, ATE 3.95 cm, gridded at about 9 cm for the browser.", mb: "1.4 MB" },
      { label: "velodyne.yaml", src: "/articles/pv-lio/map-hilti14-velodyne.glb", note: "PV-LIO with velodyne.yaml, ATE 7.28 cm, in the same frame.", mb: "1.4 MB" } ] },
    { label: "Oxford Spires", poster: "/articles/pv-lio/map-spires-default-oblique.jpg", posterAlt: "An oblique view of a square college quad as a point map, buildings round all four sides coloured by height.", layers: [
      { label: "hesai.yaml", src: "/articles/pv-lio/map-spires-default.glb", note: "PV-LIO with hesai.yaml, ATE 10.9 cm, gridded at about 44 cm to fit the browser budget.", mb: "1.4 MB" },
      { label: "velodyne.yaml", src: "/articles/pv-lio/map-spires-velodyne.glb", note: "PV-LIO with velodyne.yaml, ATE 4.71 cm, in the same frame.", mb: "1.3 MB" } ] },
    { label: "Hilti exp16", poster: "/articles/pv-lio/map-hilti16-default-oblique.jpg", posterAlt: "An oblique view of the Sheldonian Theatre attic as a point map: a dense block of roof structure in red and orange with scattered points from the city outside.", layers: [
      { label: "hesai.yaml", src: "/articles/pv-lio/map-hilti16-default.glb", note: "PV-LIO with hesai.yaml, ATE 1.73 m, gridded at about 22 cm.", mb: "1.5 MB" } ] },
  ]}
  caption="The maps my runs built, moved into each dataset's reference frame and coloured by height. Each is every deskewed scan, decimated to about 8,000 points per scan by the harness, then gridded to fit a 2.5 MB file. Pick a sequence and a config, then load it."
/>

### Outdoors, the Hilti config costs memory and accuracy

The same `hesai.yaml` on the Oxford walk reaches 10.9 cm, and it is the worst of the three runs
there. The fixed-weight run, identical except for the weights, reaches 4.65 cm; `velodyne.yaml`,
4.71 cm. For scale, FAST-LIO2 reached 7.2 cm on this walk in the FAST-LIO2 article's run on beast2,
and the Spires paper's own Table 3 gives 0.11 m for Fast-LIO-SLAM.

The cost is the clearer result. A 0.25 m voxel grid over a 70 m quad, kept forever, is 413,869 root
voxels by the end, 305,656 of them holding a plane, and the process peaks at 8,718 MB. The scan
downsampling is 0.2 m, so 12,023 points a scan reach the update, and each one costs a covariance,
a hash lookup and a 6×6 product. That is 48.3 ms a scan. `velodyne.yaml` matches about half as many
points (5,938 a scan) against 23,762 root voxels, and needs 25.6 ms and 1,651 MB for a slightly
better trajectory.

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/spires-top-hesai-vs-velodyne.jpg?v=b49b28ba8e9031a5"
  alt="Two top-down plots of the Oxford quad map coloured by height, each with the reference path in black and the aligned estimate in red going round the quad and into a side building. Left, PV-LIO with hesai.yaml; right, with velodyne.yaml. Both paths sit on the reference; the left map is slightly thicker along the walls."
  caption="Oxford Spires from above: PV-LIO with hesai.yaml (left, ATE 10.9 cm) and velodyne.yaml (right, 4.71 cm), maps cut below 1.6 m, reference path in black, aligned estimate in red. Rendered by the shootout harness from my runs."
/>

The wall RMS on Spires is 43.0 mm for `hesai.yaml`, 37.5 mm for `velodyne.yaml` and 37.1 mm with
fixed weights. The `hesai.yaml` run's end drift (its last pose's error when the alignment is fitted
to the first 10 s only) is 0.391 m against 0.023 m and 0.021 m for the other two, so its error is
accumulated over the loop, not a fixed offset.

### The weights: no help on two sequences, the difference on the third

If VoxelMap's ablation carried over, the fixed-weight run would fall behind the shipped one. On
Hilti exp14 the two are within a millimetre (3.89 against 3.95 cm). On Spires the fixed weights are
better (4.65 against 10.9 cm). On exp16 both break on the same stretch, the climb back up to the attic:
the weighted run takes a 4 m jump and keeps tracking, while the fixed-weight run leaves the
reference at about 150 s and flies off (ATE 414 m on a 117 m walk). Three sequences, three different answers; the park loop below adds a fourth, a small loss.

I logged what the weights look like. Every 25th scan the patched build re-evaluated that scan's
residuals at the converged pose and printed about 120 of them with both terms:

<ResidualSpread />

Most residuals get a standard deviation near a centimetre: the median of plane and point together
is 1.08 cm on Hilti exp14 and 1.56 cm on Spires, against FAST-LIO2's fixed 3.16 cm, so the median
residual carries 8.6 times FAST-LIO2's weight in the basement and 4.1 times outdoors. 83% and 79%
of them sit below 3.16 cm. The point term is usually the larger one, and the plane term wins in
about a quarter of residuals: those are the ones on small or poorly sampled planes, out in a long
tail (the 90th percentile of the plane term is 15.6 cm on Hilti exp14). The spread is what the
mechanism is for: between the 5th and the 95th percentile, the weight changes by a factor of
2,461 in the basement and 233 outdoors.

My reading, which I have not tested separately: the weights have a second job. They rank the
residuals against each other, which is the point of the method. They also set how much the whole
scan counts against the IMU prediction, and at four to nine times FAST-LIO2's weight per residual
the shipped model trusts the LiDAR much more. In the attic and stairwells of exp16 that trust, and
the down-weighting of the poor planes, is what keeps the filter on; on an open quad where the
geometry is easy it seems to let small plane errors pull the pose about, and the end drift grows.
The fixed-weight run is not FAST-LIO2 either: it keeps PV-LIO's planes, its gate and its maps, so
it isolates the weighting and nothing else.

### Exp16 is still hard

1.73 m over 117 m is a failure by any standard but the other two variants'. It is one event, not a
slow drift: after the global alignment the error stays between about 0.4 and 1.1 m for the first
170 s, down the first stairwell, round the gallery and back up, then jumps to about 4.4 m within a
few seconds as the rig climbs back into the attic, and stays there. Something in that climb, close
walls and a few steps in view, broke the registration, and the filter never recovered.

<Figure
  src="https://media.thesatyajit.com/ai/articles/pv-lio/hilti16-top-hesai.jpg?v=d943b98487bb56ac"
  alt="A top-down plot of the Sheldonian Theatre attic map coloured by height, with the reference path in black and PV-LIO's aligned estimate in red inside the rounded attic, with short excursions where the stairwells are."
  caption="Hilti exp16 from above, PV-LIO with hesai.yaml (ATE 1.73 m), reference in black and aligned estimate in red. Rendered by the shootout harness from my run."
/>

`velodyne.yaml` diverges too, and it differs from `hesai.yaml` in more than its voxels: a 1 m
blind radius against 0.7 m, in a building where the median return is 0.87 m, and different IMU noise
settings. Over the run it matched 81 of 1,878 downsampled points a scan on average, against 5,938
of 6,190 on Spires, and it ends kilometres away. Which of those differences sank it I did not
isolate.

### The park loop: 2.4 km, and 11.6 GB

Newer College `park` is the long one: 15,722 sweeps from an Ouster OS0-128 over 26 minutes and
2.4 km, a loop where odometry alone has to hold up with nothing to close it. PV-LIO, with the
`velodyne.yaml` it falls back to on an Ouster, holds: **30.0 cm** ATE, 2.02 cm and 0.35° of RPE per
metre, and an end drift of 0.099 m when aligned on the first 10 s only. The fixed-weight run is
slightly better again, 27.5 cm, with the same RPE to two decimals. For scale, in the same shootout
Voxel-SLAM measured 24.2 cm on this loop and α-LiDAR, which is built on PV-LIO's code, 27.1 cm.

| Newer College park | ATE | RPE per metre | ms per scan* | peak memory |
|---|---|---|---|---|
| PV-LIO, `velodyne.yaml` (shipped) | 30.0 cm | 2.02 cm, 0.35° | 68.7 | 11,645 MB |
| PV-LIO, fixed weight | 27.5 cm | 2.05 cm, 0.34° | 68.3 | 11,657 MB |

\*From the parallel accuracy pass, three runs at once on four threads each. The serial timing pass
skips this sequence for time, so these are not comparable with the other sequences' milliseconds.

The cost is the map that never forgets, again. 128 beams at 0.4 m downsampling put 11,688 points a
scan into the update, 11,373 of them matched, and by the end the map holds 100,908 root voxels
with 332,901 planes across three layers (51,799, 134,163 and 146,939). The process peaks at
11,645 MB. Here the octree does work: a park has trunks, hedges and benches, and more planes sit
one and two cuts down than at the root.

The shipped run and the `velodyne.yaml` run are the same configuration on this sensor, run side by
side in the parallel pass, and they agree to every printed digit: ATE, RPE, end drift, matched
points, the octree census. The filter is deterministic under this feeder, which is what the
offline replay was for.

### The octree almost never splits

The log of the final maps settles a question the mechanism raises. With `hesai.yaml`, no voxel was
ever cut, on any sequence: all 21,306 root voxels of the basement map are leaves, 12,888 of them
planes. A 0.25 m voxel's points pass a 0.01 m² variance test before they could fail it, so the
adaptive part of the map is switched off by its own threshold, and PV-LIO is in effect a fixed
0.25 m grid of uncertain planes. With `velodyne.yaml` on the Hesai sequences the tree works as described, but not deeply:
on Spires, 17,806 planes at the root, 11,072 one cut down and 3,457 two cuts down, and none below,
though four layers are allowed. On Hilti exp14 it is 892, 1,097 and 196, and every node two cuts
down is a leaf. I did not trace why it stops there, but the numbers fit the threshold again: two
cuts down a cell is 0.25 m, the size at which the 0.01 m² test passes nearly everything.

## What I would use it for

For a handheld rig indoors, with a Hesai and a calibrated IMU, PV-LIO with the repo's
`hesai.yaml` is the best result I have measured on the Hilti basement: 3.95 cm at under 9 ms a
scan on four cores. Outdoors I would start from `velodyne.yaml`, not from the config named after
the sensor: on the Oxford walk it was as accurate as anything here at half the time and a fifth of
the memory.

I would not run it for long without changing the code. The map never forgets, and with 0.25 m
voxels it reached 8.7 GB in under five minutes of walking. A crop round the sensor, the way
FAST-LIO2 does it, is the first patch I would write. The neighbour lookup's unit mix is the second.

The idea the repo is named for, weighting each residual by its variance, is right in principle and
mixed in my runs: a tie, a loss, a save and a small loss on four sequences. That is not enough to say the
weights are wrong. It is enough to say they are not free accuracy, and that the variance model's
absolute scale, which also decides how far the LiDAR outweighs the IMU, matters as much as its
shape. The ranging and bearing noise in the configs are two hand-set numbers. I would want them
measured for the sensor before I trusted the weights more than FAST-LIO2's constant.

The same harness is running the rest of the field (FAST-LIO2 itself, Super-LIO, Point-LIO and
others) on these sequences and the same machine, and [Voxel-SLAM](/articles/voxel-slam), from the
same HKU lab as VoxelMap, builds a full SLAM system on adaptive voxel maps with loop closure and
bundle adjustment. Related reads here: [FAR-LIO](/articles/far-lio), which made the opposite choice (big voxels and
GICP covariances on a GPU), and [the Hilti datasets](/articles/hilti-slam-dataset), for how the
reference trajectories these numbers are scored against are made.

## What I ran and what I read

Read: the PV-LIO source at `494c27f` (`voxelMapping.cpp`, `voxel_map_util.hpp`, `esekfom.hpp`,
`IMU_Processing.hpp`, the configs), the VoxelMap paper (arXiv 2109.07082, RA-L 2022) and its code,
and FAST-LIO2's `laserMapping.cpp` for the constant it replaces. Every config value quoted is from
the YAML files; every claim about the mechanism is from a line of code I can point to.

Ran: PV-LIO built from that commit with conda-forge gcc 15.3, Eigen 3.4.0 and PCL 1.15.1, no ROS
package anywhere, on the Blackwell box, through the shootout harness: three variants on three
sequences, a parallel accuracy pass and a serial timing pass on four pinned cores, maps decimated
the harness's way. The patch adds outputs and two diagnostics; the fixed-weight variant changes one
line. The residual samples and the octree census come from those diagnostics.

Not run: online extrinsic estimation where a
config ships it off (only `velodyne.yaml` turns it on, and it stayed on there), and PV-LIO's own demo bags,
which are on Baidu Pan and Google Drive. The README's clips and the VoxelMap numbers are the
authors', not mine. FAST-LIO2's numbers on these sequences are from the FAST-LIO2 article's runs
on a different machine and harness; the same-machine rows belong to the shootout.
