There is an awesome demonstration on how to use the Neato X11 lidar with ev3dev by @bmegli. However, the X11 lidar has some disadvantages:

  • Electric and mechanical integration is relatively difficult
  • The X11 is a deprecated vacuum robot and the availability of the part may go down soon

The YDLidar X4 is very similar in size, shape, performance and price, but it is intended for teaching and research projects. The X4 comes with an adapter board to interface and supply it using a single USB port. ev3dev directly supports this adapter as a virtual serial port. The device is well documented and an YDLidar SDK is also available. However, I had some performance issues with the original SDK running under ev3dev, as the brick was not able to process the data buffer as fast as it is filled. Therefor, I created a modified version of the SDK and integrated it into an example project: YDLidarCar.

It is a EV3 based car with front steering and rear wheel drive.


The project basically contains two C++ classes: One to control the car and one to obtain data from an YDLidar X4. A third class CruiseControl is provided as a proof of concept. CruiseControl is not navigating anywhere, it just tries not to hit anything.

Demonstration of YDLidarCar with CruiseControl

The project is rather young and I didn’t try to integrate ev3dev-mapping yet.

You are welcome to send me your feedback and suggestions via e-mail.

Project Info

  • Written with C++
  • Source code