← Back to all work

SLAM · Registration · Rust

mapr: a Rust library for 3D mapping and reconstruction

An independent R&D codebase for RGB-D SLAM (mapping from color-plus-depth cameras), point-cloud registration, pose-graph optimization, and surfel-based reconstruction — surfaces built from small oriented disks rather than a mesh.

Pose-graph optimisation closing accumulated drift A 272-keyframe camera loop around a room, drawn as four layers that can each be switched off in the key below. Odometry alone accumulates 217 mm RMSE of absolute trajectory error and visibly peels away from ground truth. After Levenberg-Marquardt pose-graph optimisation ties the graph together across 664 loop closures, the error falls to 14 mm and the estimate lies on ground truth.
A 272-keyframe camera loop from the TUM RGB-D freiburg1_room benchmark. Odometry alone accumulates 217 mm of absolute trajectory error — its deviation from ground truth once a best-fit rigid alignment is removed, so the number measures the trajectory’s shape rather than how well it happens to be pinned at one pose. Optimising the pose graph over 664 loop closures brings it to 14 mm in 6 Levenberg–Marquardt iterations. Those closures are thinned so they spread over the whole path instead of crowding wherever the camera lingered — a set of 1482 that leaves stretches untied does no better. Switch any layer off in the key to read them apart. Both the odometry and the closure measurements carry injected noise; the correction is mapr’s solver.

Challenge

Reconstruction work keeps returning to the same underlying ideas — camera models, ICP, pose graphs, surfels — but they usually live tangled inside application code, difficult to test in isolation and impossible to reuse.

Response

Designed a modular Rust workspace with reusable APIs for camera models, frames, point clouds, registration, optimization, and CPU/GPU computation. Implemented generic pose-graph optimization with measurement uncertainty carried correctly between reference frames via the SE(3) adjoint; bundle adjustment, the joint refinement of every pose and point at once, made tractable by exploiting the problem's sparse block structure through a Schur complement; outlier handling by robust losses under graduated non-convexity (start forgiving, progressively tighten); surfel fusion weighted by each measurement's uncertainty; and compute-kernels shared between CPU and GPU, cross-compiled to SPIR-V, the portable GPU bytecode.

Outcome

A library where the underlying geometry is explicit, testable, and reusable — nearly 800 tests and CI on stable Rust, validated against public and synthetic datasets.