File Exchange

image thumbnail

Hokuyo URG-04LX LIDAR Driver for MATLAB

version 1.1 (3.84 KB) by

This a simple driver for the Hokuyo URG-04LX USB LIDAR for MATLAB.

4.33333
4 Ratings

20 Downloads

Updated

View License

The files establish a serial comm link with Lidar with the required settings. The function LidarScan.m is called with serial communication object as argument to return a range vector consisting of decoded Lidar Scan data.

It returns the data after a full scan (-120 to +120 degrees) with 682 points.

Edit SetupLidar.m with the correct COM Port to use this file.

The file is a quick and easy way to stream range data from a Hokuyo Lidar in the MATLAB environment.

It works well for the URG-04LX as the decoder function supports only two and three bit encoding.

Comments and Ratings (6)

Rakesh Kumar

Thanks for your file. I have been using your file for 3 months and it helped me a lot in my research.

The program 'decodeSCIP(rangeenc)' uses 'bin2dec.m' and 'dec2bin.m' which uses string operations. This makes your program slower to run and not suitable for real-time SLAMs.

I would like to suggest you to replace the binary to decimal conversions ('bin2dec.m' and 'dec2bin.m') by someother array based convertion (ref: http://in.mathworks.com/matlabcentral/fileexchange/26447-efficient-convertors-between-binary-and-decimal-numbers?focused=5146061&tab=function)

milan yadav

@THARINDU i have the same problem, it would be very helpful if you would tell that how you solved this problem

AlxGeek

I am trying to use this matlab 2012a but it gives some warnings. I set the COM port properly and run the setupLidar program.

this is the output:

SetupLidar

Serial Port Object : Serial-COM4

Communication Settings
Port: COM4
BaudRate: 9600
Terminator: 'LF'

Communication State
Status: closed
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 0

Warning: Unsuccessful read: A timeout occurred before the Terminator was
reached.

ans =

SCIP2.0
0Ee

Warning: Unsuccessful read: A timeout occurred before the Terminator was
reached.

ans =

VV
00P
VEND:Hokuyo Automatic Co.,Ltd.;[
PROD:SOKUIKI Sensor URG-04LX;[
FIRM:3.3.00(16/Apr./2008);k
PROT:SCIP 2.0;N
SERI:H0611590;K

Warning: Unsuccessful read: A timeout occurred before the Terminator was
reached.

ans =

BM
02R

Can anyone give me the solution for this problem and instruction to print all scanned data points.

Thanking you.

Jong-Hwan Kim

Jong-Hwan Kim (view profile)

Awesome~! Could you make it for Hokuyo UTM-30LX as well?

Updates

1.1

Corrected a typo in the Lidar name. The Lidar is from Hokuyo and not Hokuyu.

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Hokuyu URG-04LX driver for MATLAB/Hokuyu Lidar driver/