← Back to Insights

Controlling a ROS2 LiDAR Scan Pipeline from a Phone

Handheld LiDAR scanners built for geotechnical and mining work are self-contained, processor, battery, IMU, and control app in one unit. They work well. This is a different approach: open-source hardware, a custom control interface, and a laptop in a backpack.

3 ROS2 processes managed
1.5s Dashboard refresh rate
WiFi Phone hotspot connection
0 Native apps required

The problem with a laptop in a backpack

Established handheld scanners, the GeoSLAM ZEB family, Leica BLK2GO, NavVis M6, are self-contained: processor, battery, and IMU in one unit, paired with a dedicated mobile app. They carry a significant price, but the operator experience is clean. Everything is in one hand, or clipped to a vest.

A research-grade alternative is to pair a Livox Mid-360 with a laptop running ROS2 and FAST-LIO2. The scanner connects via a long M12 Ethernet cable handling both data and power. The laptop goes in a backpack. It is lighter and substantially cheaper than a commercial all-in-one, but it needs the tether, and it needs an operator interface.

Managing three separate ROS2 processes, the Livox driver, FAST-LIO2, and the rosbag recorder, from a terminal while navigating a decline or a drive with a scanner trailing behind is not practical. That is the problem this addresses.

What was built

A small web application that runs directly on the laptop and exposes the full scan pipeline through a browser interface. The laptop joins the phone's mobile hotspot over WiFi; from that point, any browser on the phone connects to a local dashboard served from the laptop, no native app, no Bluetooth pairing, no additional software on the phone side.

Start

Launches Livox driver, FAST-LIO2, and rosbag recorder in sequence with correct timing between each process

Stop

Sends a clean SIGINT shutdown to each process in order, bag data is written properly, not truncated

Live status

Process health, elapsed scan time, current bag file name, and recording size, updated every 1.5 seconds

LiDAR rate

Live Hz check on the /livox/lidar topic confirms data is flowing from the sensor, not just that processes are running

The dashboard updates status independently of whether the scan pipeline is healthy, if a process dies mid-scan, the status panel reflects it within 1.5 seconds. If the phone loses the hotspot connection and reconnects, the scan continues uninterrupted on the laptop; the dashboard simply picks up where it left off.

How the dashboard looks in use

A typical active scan session shows the following in the browser:

Status ● RECORDING
Elapsed 4m 32s
Bag size 1,847 MB
Livox driver running
FAST-LIO2 running
Bag recorder running
LiDAR rate 10.2 Hz

What comes next

This is the first phase. The dashboard currently provides process control and scan health monitoring. The next step is adding a live point cloud preview directly in the browser, a periodically-refreshed render from the FAST-LIO2 output, so coverage can be checked on the phone mid-scan without pulling the laptop out of the bag or stopping the recording. That removes the last reason to physically access the machine during a session.

Further out, the intent is to run the web interface as a systemd service that starts on boot, so the laptop is scan-ready from power-on with no terminal interaction required at the site.

Stack

The backend is a Python Flask application managing subprocess handles for each ROS2 process. The frontend is plain HTML and JavaScript, no framework, no build step, mobile-optimised for one-thumb use with large touch targets. The whole thing is around 300 lines of code. The ROS2 stack underneath it is ROS2 Humble on Ubuntu 22.04, with Livox SDK2, livox_ros_driver2, and a community ROS2 port of FAST-LIO2.

Commercial handheld scanners solve the operator experience problem well, and they are the right tool for many workflows. This setup trades that polish for openness, the full ROS2 pipeline is accessible, configurable, and extensible in ways a closed system is not.

The control interface is a small piece of that. Getting the pipeline to a point where it disappears into the background, where the operator just walks and the data accumulates, is the goal.

That is the kind of workflow infrastructure TerraIO is building toward.