Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!

Ilia Ovsiannikov Offers Simple Lidar Control with a New, Open Source Arduino LDS Library

Supporting a range of low-cost lidar sensors out of the box, this library delivers a unified API to make your life easier.

Gareth Halfacree
6 months agoSensors / Robotics

Maker Ilia Ovsiannikov is working on a friendly do-it-yourself robot kit — and as part of that work has released a library to make it easier to use a range of lidar sensors in your Arduino sketches.

"I have combined support for various spinning lidar/LDS sensors into an Arduino LDS library with a single platform API [Application Programming Interface]," Ovsiannikov explains. "You can install this library from the Arduino Library Manager GUI. Why support many lidar/LDS sensors? The reason is to make the hardware — supported by [the] Kaia.ai platform — affordable to as many prospective users as possible. Some of the sensors [suported] are sold as used robot vacuum cleaner spare parts and cost as low as $16 or so (including shipping)."

A new open source Arduino library makes it easier to interact with a variety of low-cost lidar sensors. (📹: Maker's Pet)

The library delivers support for a broad range of lidar sensors from a unified API, Ovsiannikov explains, meaning it's not only possible to get started quickly but to switch sensors mid-project — should existing sensors become unavailable, or pricing shift to favor a different model. It also adds a few neat features of its own, including pulse-width modulation (PWM) control of lidar motors that lack their own control system, using optional adapter boards.

While the library is usable standalone, and even to perform real-time angle and distance computation directly on an Arduino microcontroller, Ovsiannikov has also published a companion package to tie it in to the Robot Operating System 2 (ROS2). "[The] Kaia.ai robot firmware forwards LDS raw data — obtained from the Arduino LDS library — to a PC running ROS2 and micro-ROS," he explains. "The ROS2 PC kaiaai_telemetry package receives the raw LDS data, decodes that data and publishes it to the ROS2 /scan topic."

More information on the library is available in Ovsiannikov's blog post, while the library itself is available on GitHub under the permissive Apache 2.0 license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles