If you are interested in completing this tutorial but have no experience with laser scanners, please see the following tutorial SICK LMS Tutorial.
First, let's assume that we have a SICK laser scanner mounted to an unmanned aerial vehicle (UAV). The UAV is flying in cruise mode which implies that it's flying in a straight line with roll and pitch angles equal to zero (i.e. the laser scanner is looking straight down). Also, let's assume the UAV is flying through some hallway or tunnel where it remains centered through the passageway. The figure below shows this scenario (note: the flight path of the UAV, and therefore the scanner, is along the y axis which is perpendicular to the page).

In the first example, we are going to simulate measurements from the laser scanner by assuming a flat ground plane. These measurements are contained in the variable laserData and have a 10 degree resolution. This is significantly less than an actual scan from a laser sensor (e.g. SICK has a 0.5 degree resulution). This might cause straight lines to appear sloped.
laserData = [10.00,10.15,10.64,11.55,13.05,13.05,11.55,10.64,10.16,10.00,10.16,10.64,11.55,13.05,13.05,11.55,10.64,10.15,10.00]
laserData represents a single scan at time (t). At the next time step (t+1), another scan is taken and since we assumed the UAV will remain in the center of the tunnel, the data from the laser scanner is the same for all scans (assuming a symmetric tunnel). During each of these scans, the UAV position must also be recorded. We previously said that the UAV was flying at cruise speed which means that it should move the same amount between time steps in the y direction. Therefore, if the UAV is flying at 1 m/s at an altitude of 10 meters and we're acquiring laser data at 3 Hz, then the position of the UAV (xr,yr,zr) should be initialized with the following code:
xr = 0; yr = [0, 0.33, 0.66, ... , 5]; zr = 10;
With the acquired UAV position and laser data, a Digital Surface Model (DSM) or terrain map can be obtained. Looking at the figure above, the laser data can be transformed to the global frame using the following equations
x = xr + rho*cos(theta); y = yr; z = zr - rho*sin(theta);
where rho is the distance measured by the laser scanner and theta is the angle. The robot, or UAV, position is denoted by xr, yr, and zr. Using these relationships, a plot showing the DSM can be obtained (download Matlab code).

In this example, we're going to assume that our ground plane is no longer flat. There is a 3 meter object that is now protruding out from the surface as seen in the figure below.

The laser data (fabricated) for this new environment is given as:
laserData = [10.00,10.15,10.64,11.55,13.05,13.05,11.55,10.64,7.11,7.00,7.11,10.64,11.55,13.05,13.05,11.55,10.64,10.15,10.00];
With the same position data, the terrain map created for this scenario is shown below. As in the case above, the low resolution of our simulated laser scanner (i.e. one measurement every ten degrees instead of 0.5 degrees) causes the straight edges on the sides of the building to appear sloped.

In this example, we're going to use actaul laser data acquired with a Hokuyo laser scanner mounted to our hardware-in-the-loop test rig. The test rig is used to simulate real flight conditions during which data from the laser scanner is acquired. The laser data is used along with the position of the laser scanner to create a map of the terrain. The matlab code and data can be downloaded here.
     
This tutorial was created by B. Green: home page