LIDAR interfacing in ROS!
Posted by Beyond
Hey guys! Its been time since the last post. I have been busy in some studies and other projects. But yeah I have got another cool project this time and it is related to Robotics!
Yeah, Robotics, this is the first time I am starting with robotics. Trying to make out a Turtle bot thing.
Collecting the material and resources for such autonomous body(I am inserting a few of my things), I got a LIDAR, the lidar is hokoyu URG04lx. The lidar is working on a lot of data and the processing is also very fast. The inbuilt controller in the lidar actually takes care of the laser thing and finally gives us the distance via serial communication. The Serial port is hidden as the Lidar is made USB compatible with a driver in there lidar itself. So it becomes a direct USB plug n play thing.
In linux, the device may appear as /dev/ACM0 or something.
The documents says : The light source of the sensor is infrared laser of wavelength 785nm with laser class 1 safety. Scan area is 240 degrees semicircle with maximum radius 4000mm. Pitch angle is 0.36 degree and sensor outputs the distance measured at every point (683 steps). Laser beam diameter is less than 20mm at 2000mm with maximum divergence 40mm at 4000mm.
Principle of distance measurement is based on calculation of the phase difference, due to which
it is possible to obtain stable measurement with minimum influence from object’s color and
And also, as per the specifications the document on the “www.robotshop.com” says,
this lidar will take 500mA of current or less and on start 800mA.
But I really find this data wrong, as my multimeter showed current values upto 700-800mA for continous. So I tried powering it with standard 7805 but it started to trip and as usual heatup.
So, I am using any other supply having or giving 5V as output where the driver is capable of giving a little more than 1A of current regular. A 2576 based supply is used here.
Pinout of the lidar was
The device will respond as Communication Device Class if tried interfacing with some microcontroller with USB HOST drivers. The rest of the communication protocol is pretty self explanatory. If your device is with older firmware version or with the later the interfacing protocol is more or less the same.
Here is the sample data packet in between the ROS and hokuyo_lidar
ranges: [0.0, 0.0, 0.13199999928474426, 0.13199999928474426, 0.13199999928474426, 0.13199999928474426,……………………………………………………………………………………..(this conatins a lot of data)
The full file is here along with the other documents:
This is video that I made for the sole purpose of displaying the steps for bringing up the lidar. Once you initiallises the lidar via the hokuyo_node, it starts throwing data on scan and laser topics.