# 3D mapping using only a 2D Lidar

How can I map a 3D environment using only a 2D lidar? The lidar would be hand held and it would have 6 DoF. So if I move it in arbitrary motion in all 6DoF, I expect my algorithm to generate a 3D map of whatever part of the environment was visible to the lidar.

I've come across ways to use IMU, monocular camera or encoder motor for state estimation that is required for mapping, but I want a solution that doesn't require any other sensor except a 2D lidar like RPLidar.

I don't think what you're asking is possible with the state of the art sadly. You cannot, AFAIK, generate a 3D map from a hand held 2D LIDAR without any other sensors. It's a very interesting question you're raising but I think it's a research question :)

A LIDAR is going to give you a 2D laserscan/Pointcloud. That 2D data will not possible to extrapolate to 3D, at least not in a straight forward way:

Let say you want to something like ICP and match the laser scan onto each other building the map. Now you rotate your 2D laserscan by x degree along the yaw axis. Assuming in your environment walls are straight and vertical, the 2D laser scan will be slightly larger than the original 2D laser scan. How will ICP be able to tell you that this laser scan is the same as the one before but tilted since they do not have overlapping regions. And that's where lies the whole problem of using a 2D laser scan to build a 3D map. You wont have enough of those overlaping areas.

That said, not everything is lost and you can still make it. Here is my take on this:

• Start the lidar with a horizontal scan.
• Use the first scan and start building a 2D map.
• Extrapolate the map assuming all walls are verticals and infinite.
• Using ICP or other algorithms to match incoming scans to your virtual walls. Correct the walls if needed.
• To detect roofs, progressively match incoming scans to walls until you find a scan that can't be match onto your walls.
• Using those scan to build fake walls that are perpendicular to the closest walls in the environment, but passes by a certain number of laser points. Note on scan can create multiple fake walls.
• Start again using ICP against your artificial walls.
• After a lot of scans, you should have a 3D map of the environment.

See how this algo "fakes" overlapping regions and use the incoming scans to figure out which overlapping regions are the correct ones.

That is an already solved problem. As Squelsh mentioned CSIRO released its initial version in 2009 and their work is commercialized by GEOSLAM already.

One of a CMU student released a open source version of CSIRO's work, called LOAM. Unfortunately, he also commercialized his work and closed the original git. Good news is that many people have a copy of that already:) CSIRO's recent work combines IMU,2D LiDAR, camera, encoder and the related paper will be released soon at RAL.

This category of SLAM is called Continuous-time SLAM. If you are writing a paper, here is one of the latest CT-SLAM paper. Please, cite this:)

Also, check these videos 1, 2.

As the previous answers stated: You need an additional source of information to reconstruct the orientation of the scanner. Even if only roughly.

Do a Google search for "Zebedee scanner". The researchers from CSIRO implemented the scan registration in the most elegant way, IMHO. And they use a cheap IMU in their device.

If it was fixed: - You can place it vertically and define a rotating mechanism so it spins on itself and the 2D beam eventually maps the 3D surroundings.

If it is hand-held: - You will have to compute the transformation matrix from the origin to the new position of the camera (lidar in your case) and apply it to perform an image/laserScan registration, such that the sensed data gets mapped on the correct spatial coordinates.

If you are working with ROS and have an IMU, I am pretty sure there is a package that will be able to do the registration for you.

You can check the laser_geometry package in the ROS wiki: http://wiki.ros.org/laser_geometry

If not you will have to implement the registration by yourself and it is a task that requires time.