BreezyLidar - Simple, efficient, Lidar access for Linux computers in Python and C++
This repository contains everything you need to start working with the popular Hokuyo URG-04LX Lidar unit on your Linux computer. It is designed for robotics applications on a single-board Linux computer like RaspberryPi or ODROID.
BreezyLidar was inspired by the Breezy approach to Graphical User Interfaces developed by my colleague Ken Lambert: an object-oriented Application Programming Interface that is simple enough for beginners to use, but that is efficient enough to scale-up to real world problems. As shown in the following code fragment, the API is extremely simple: a constructor that accepts the port (device) name on which the unit is connected, and method for accessing the scans (range values):
from breezylidar import URG04LX
laser = URG04LX('dev/tty/ACM0')
while True:
scan = laser.getScan()
# do something with scan, like SLAM
The BreezyLidar installation uses the popular distutils approach to installing Python packages, so all you should have to do is download the repositry, cd to the directory where you put it, and do
To see what other features are available, do
For a quick demo, you can then cd to breezylidar/examples and do
Again, you'll need to change the LIBDIR variable at the top of
the Makefile in this directory as well, if you don't use /usr/local/lib.
You should also have this lib directory in your LD_LIBRARY_PATH environment variable.
I do this by putting the following line in my ~/.bashrc file:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
To see what other features are available, go back to the cpp directory and do