Robot maps sometimes come out bent, with duplicated walls or sections that don’t line up. I built this editor to correct those problems without having to collect all the sensor data again.

Cartographer estimates a robot’s path while building a map from its sensor measurements. This is called simultaneous localisation and mapping, or SLAM. It joins small local maps, called submaps, into a larger map. Poor measurements, unsuitable settings or difficult surroundings, such as long featureless corridors, can leave those submaps misaligned.

The editor lets you move and rotate submaps by hand. You can fix a few key sections in place and let the optimiser adjust the others, rather than correcting every section individually. The optimiser uses Levenberg-Marquardt least-squares optimisation, implemented in JavaScript, to reduce disagreement between the connected parts of the map.

Once the alignment looks right, export the corrected .pbstream file and run Cartographer’s assets writer with your original sensor recording to rebuild the point cloud - the collection of measured 3D points.

Launch Cartographer SLAM Trajectory Editor

Things to know

  1. Your .pbstream is parsed, edited, optimised and rewritten in your browser. The file is not uploaded to a server.
  2. The editor is designed for 2D trajectories; I haven’t tested it with 3D trajectories. Large .pbstream files can be slow to work with or exceed the browser’s available memory.

If you’re working with GLIM and Ouster LiDARs, I also have a note on the correct T_lidar_imu transform: the documented one is missing a 180-degree rotation.

View on GitHub