How LiDAR sees a room

Each laser ray measures the first surface it meets. Move the scanner to reveal hidden faces, then compare a floor map with 3D voxels.

Browser walkthrough·Beginner·4 min read
Take the first scan

Reveal the room

Scan once, then move around the crate to see behind it.

Or click open floor to reposition. Drag to orbit.

0 scans · 0 returns

Geometric sensor simulation with known positions. Nav2 and SLAM are covered in the follow-on lesson.

Requirements and learning goals

Before you start

  • A browser with WebGL
  • No robot or installation required

You will be able to

  • Explain why a laser stops at the first visible surface
  • Distinguish free, occupied, and unknown space
  • Compare a planar scan with a 3D voxel view

A sensor measures distance along many directions. In a time-of-flight sensor, a light pulse travels to a surface and back. Its round-trip time gives a range. Combining each range with its beam direction locates the measured surface relative to the sensor.

Here, the browser intersects rays with the actual room geometry. The returns drive the visible map. This ideal sensor omits noise, reflectivity, glass, and timing effects. You can move it around the crate and observe what becomes visible.

Try it

  1. Press Scan room. The highlighted beam meets the near side of the crate. Its range is 1.60 m.
  2. Inspect the floor. Green cells have been traversed by a beam; amber cells contain a return. Dark cells have no observation yet.
  3. Press Move to the other side, then scan again. The opposite face of the crate becomes visible and the map gains observations.
  4. Select Try a 3D scanner. This starts a fresh scan with five elevation angles. Orbit the scene to inspect the occupied cubes.
  5. Move and scan again. Compare which heights are observed from the two positions.

You can also click open floor to reposition the scanner. This action relocates it for an experiment; it does not command a navigation controller. The table and crate remain solid constraints on placement.

Check the expected results

The initial sensor position is x = −2 m, y = 0.6 m, z = 0 m. The crate's near face is at x = −0.4 m. A beam pointing in positive x therefore measures 1.6 m. It cannot also see the wall behind that crate.

Checkpoint 1 of 2

The scanner moves back to x = −3 m at the same height and z. Its beam still points in positive x toward the crate's near face at x = −0.4 m. What range does that beam report?

Commit to an answer. Every choice explains itself.

A planar scan contains 120 directions at one height. It sees a horizontal slice, not every surface in the room. A raised tabletop may be invisible to that slice. Changing to the 3D scanner emits 600 rays across five elevation angles. Cubes represent 20 cm cells containing actual returns, rather than filled-in furniture volumes.

The floor map uses 20 cm cells and samples beam traversal every 5 cm. It is a simple occupancy demonstration, without probabilistic updates or dynamic clearing. Missing observations stay unknown. A cell without a point is not automatically free. After enough scans, the display retains the latest 4,800 rays to keep the exercise responsive.

Checkpoint 2 of 2

After the first scan, a patch of floor behind the crate is still dark. What do you know about those cells?

Commit to an answer. Every choice explains itself.

Where SLAM and Nav2 fit

This exercise knows every scanner position exactly. must estimate motion and map the surroundings together. In a workflow, a planar sensor commonly publishes LaserScan on /scan; SLAM Toolbox builds a map, while AMCL can against an existing map. Nav2 mapping and localization

combines map and sensor information in for planning and control. Its voxel layer maintains height information and projects it into a 2D costmap. A visible voxel model does not mean the robot plans arbitrary flying trajectories. Nav2 voxel layer

The following lesson runs Gazebo, SLAM Toolbox, and Nav2 on your computer. This browser exercise does not run those packages.

Troubleshooting

If placement is rejected, choose a floor point away from the crate, table, and walls. Moving alone does not add observations; press Scan room afterward. Changing scanner type clears the accumulated view so planar and multilevel observations are not mixed. Reset returns to the original 1.60 m example.

A sparse voxel view is expected. A ray measures a visible surface, not the solid interior or every hidden face. Scan from another position to reveal more.

Can you do each of these?

  • Explain why a laser stops at the first visible surface
  • Distinguish free, occupied, and unknown space
  • Compare a planar scan with a 3D voxel view

0 of 2 checkpoints solved. Try checkpoint 1

Previous: Replan from where the robot is now
All lessons in this topic
  1. 1. Give the robot enough room to fit
  2. 2. Find a shortest route through free cells
  3. 3. Keep more than one possible robot position
  4. 4. Replan from where the robot is now
  5. 5. How LiDAR sees a room
  6. 6. Map a room and navigate to a goal

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.