Skip to main content
Explore ERDILRF

Press ↑↓ to move, Enter to open, Esc to close.

ROS 2 Laser Rangefinder Driver (erdi_lrf_driver)

erdi_lrf_driver is an open-source ROS 2 package that reads an ERDI UART laser rangefinder over a serial port and publishes sensor_msgs/msg/Range on the range topic. Clone it into your workspace, build with colcon, and start it with ros2 launch erdi_lrf_driver erdi_lrf.launch.py port:=/dev/ttyUSB0 model:=LRF3000A1. Source: github.com/ErdiTech/erdi_lrf_driver (MIT).

What it does

The driver supports both published ERDI serial protocol families: family A (55 AA command/response) and family B (free-running 5C frames). The serial codec is bundled in the package, so the only runtime dependency is pyserial (python3-serial). The reading can feed nav2, robot_localization, flight-controller companion bridges, or your own altitude and obstacle logic.

Install

cd ~/ros2_ws/src
git clone https://github.com/ErdiTech/erdi_lrf_driver.git
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
colcon build --packages-select erdi_lrf_driver
source install/setup.bash

Give your user access to the serial port first: sudo usermod -aG dialout $USER, then log out and in.

Run

ros2 launch erdi_lrf_driver erdi_lrf.launch.py port:=/dev/ttyUSB0 model:=LRF3000A1 rate:=10.0
# or run the node directly
ros2 run erdi_lrf_driver erdi_lrf_node --ros-args -p port:=/dev/ttyUSB0 -p model:=LRF1500H
ros2 topic echo /range

The launch file exposes the arguments port, model, baud, frame_id, rate and field_of_view. For a UART wired directly to a board header use that device name, for example the Jetson header UART described on the Jetson page. Make sure the module UART is 3.3 V TTL before connecting to a 3.3 V host, or use a USB-TTL adapter.

Parameters

Name Default Description
port /dev/ttyUSB0 Serial device
model LRF3000A1 Module model, for example LR1200E2, LRF3000A1, SPD1200N2, LRF100H, LRF1500H, LRF22VB
baud 0 0 uses the model’s documented default; SPD1200D03 has no safe default and needs an explicit value
frame_id erdi_lrf_link TF frame of the message header
rate 10.0 Polling rate in Hz
timeout 0.5 Serial read timeout in seconds
min_range / max_range 0.0 Metres; 0.0 takes the value from the model table
field_of_view 0.0 Full beam divergence in radians; 0.0 uses the per-model value, fallback 0.002
continuous false Stream continuously instead of one request per tick
acknowledge_protocol_hold false Needed for continuous on LRF1200A1 and LRF3000A1, whose manuals leave the continuous-reply function byte unresolved
topic range Output topic name

Published topic

The node publishes range as sensor_msgs/msg/Range with the sensor-data QoS profile. radiation_type is INFRARED. Out-of-range readings follow REP-117: -inf below the minimum range, +inf beyond the maximum or when the module reports no echo, and nan for an invalid measurement. The node closes the serial port when it shuts down.

Supported models

The model table in the package covers these ERDI modules (check each model page at erdilrf.com/models for its specifications):

  • Family A (polled, 115200 baud): LR1000E2, LR1000E4, LR1200E2, LR1200E4, LR1500E2, LR1500E4, LR2000E2, LR2000E4, LRF1200A1, LRF3000A1, SPD1200N0, SPD1200N2, SPD1200N4
  • Family B (free-running, 460800 baud): LRF50H, LRF100H, LRF200H, LRF300H, LRF600H, LRF1500H, LRF22VB, LRF50VB
  • SPD1200D03: its manual publishes no distance scaling, so the node refuses to publish a range in metres for it rather than inventing one.

Models with a published beam divergence in the repository table (LR1000E2/E4 0.009 rad, LR1200E2/E4 0.004, LR1500 and LR2000 E2/E4 0.006, LRF3000A1 0.01, SPD1200N0/N2/N4 0.0045) get it as the default field_of_view. The remaining models keep 0.002, so set field_of_view yourself for them.

Per-model pages

Each model has its own ROS 2 page at /lrf/<model>-ros2-driver/:

21 models have a ROS 2 page:

Tests and related repositories

Run colcon test --packages-select erdi_lrf_driver && colcon test-result --verbose. The suite includes ament_copyright, ament_flake8, ament_pep257 and a node test against a fake serial port, so no hardware is needed. Worked examples and wiring notes are in erdi-lrf-ros2-examples; the Python driver and protocol documents are in erdi-lrf-drivers.

Note on the package name: earlier releases used a different package name. The current name is erdi_lrf_driver; topics, parameters and the erdi_lrf_node executable are unchanged.

FAQ

Which message type does the driver publish?

sensor_msgs/msg/Range on the topic range, with sensor-data QoS and REP-117 handling for out-of-range values.

Do I need to set the baud rate?

Usually not. Leave baud at 0 and the driver uses the model’s documented default. Only SPD1200D03 needs an explicit value.

How do I get more than 10 Hz?

Raise the rate parameter within what your model supports, or use continuous mode where the model documents it. See the model page for the update rate of your module.

Where do I ask about a model that is not listed?

Write to tommy@erdimail.com with the model and your host setup.

Explore knowledge

Models mentioned in this article