Thumbnail

Hitachi-LG LDS Lidar

NMS Driver for the Hitachi-LG LDS 360 degree lidar.

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Navigation category tab.
  7. Press the Hitachi-LG LDS Lidar icon to add the control to your project.

Manual

NMS Driver for the Hitachi-LG LDS 360 degree lidar. This robot skill connects to the Lidar and pushes the data into ARC's NMS (navigation messaging system) to be used with level 1 navigation viewers. Read the NMS manual page to understand how this skill can be used.

*Note: This skill requires ARC 2020.12.12.00 or greater

Screenshot
User-inserted image



NMS (Navigation Messaging System)


This skill operates in Level #3 Group #1. It publishes obstacle detection to the NMS. While some SLAM systems will attempt to determine the cartesian position of the robot without telemetry, it is best to combine this skill with a Group #2 sensor. 
User-inserted image



How to Use EZ-LIDAR SLAM



Program the LIDAR in Blockly
Like all Synthiam controls, the Blockly programming language can be used. In this example below, the robot will speak when an object has come close to it. It will also speak the degrees of where the object was. To see this program in action, click HERE
User-inserted image


Cheat Sheet Shortcuts
There are ControlCommand() shortcuts are supported by this skill. For a complete list, view the Cheat Sheet of this control. The commands will start, stop, change the speed and swap image display. User-inserted image


Variables
In the configuration menu of this control, you can view the variables that this skill creates. The variables hold the most recent values of minimum/maximum distance, degrees and running status of the lidar.User-inserted image



Arduino Sketch


There are two ways to connect to this lidar. You can either use a standard USB<->UART convertor, such as those found on amazon or eBay. Or you can use a 32u4 based Arduino board (i.e. Micro) to make your own USB<->UART converter. The 32u4 based boards are necessary Arduino versions to use because they support emulating USB HID devices, such as a Serial device. 

Here is a simple sketch that can be used on a 32u4 based board...

Code:


void setup() {

Serial1.begin(230400); // Init Hardware Serial port on pins 0 and 1
Serial.begin(230400); // Init Serial Port
}

void loop() {

if (Serial.available())
Serial1.write(Serial.read());

if (Serial1.available())
Serial.write(Serial1.read());
}

Wiring


GREY - Ground
RED - +5
GREEN - RX (connects to TX on Arduino or USB Converter)
BROWN - TX (connects to RX on Arduino or USB converter)

Robotis USB <-> UART Converter


The Robotis version of this sensor may include their USB UART converter, which uses a CP210x chipset. The driver for windows can be found by clicking here: CP210x_Windows_Drivers.zip

Videos


Real-time SLAM mapping


Room Mapping


Near Object Detection


Resources


The source files for the hardware can be found here: github.com/synthiam/E-41_LIDAR

PRO
Synthiam
#26   — Edited
ptp, do you know if the USB<->UART converter that you're using has a specific baud rate?

Also - is it just a usb<->uart converter or is it controlling commands and parsing data as well?

My LDS is connected through a Arduino Leonardo/Micro (emulates USB device) using this high-tech code

Code:


void setup() {

Serial1.begin(230400); // Init Hardware Serial port on pins 0 and 1
Serial.begin(230400); // Init Serial Port
}

void loop() {

if (Serial.available())
Serial1.write(Serial.read());

if (Serial1.available())
Serial.write(Serial1.read());
}



If your USB<>UART converter is indeed just that, it will work and at that baudrate. Otherwise, i'll need to know more about it.
PRO
Portugal
#28   — Edited
Hi DJ, could you post the wiring shematic and .ino file you used to get it running?
There are some of these lidars on ebay at a nice price.
PRO
Synthiam
#29  
Wiring schematic is in the GitHub repo

arduino code is the lost above yours
#30  
I found the Hitachi on US Ebay for ~$40, although taking a slow boat from China so won't be here until March.  I think it is the same vendor that @proteusy found.  

Is this the right github link?  https://github.com/synthiam/E-41_LIDAR

I don't see the wiring diagram.

Do you think this USB to TTL will work?  I already have a set. https://amazon.com/gp/product/B07D9R5JFK/

Trying to have everything ready when it gets here.  I got my Realsense camera this morning.

Alan
PRO
Synthiam
#31   — Edited
Click here...

User-inserted image



I also added the sketch and wiring to this manual page
User-inserted image
#32  
Thanks.  I was on the wrong Github link.

Alan
PRO
Portugal
#33   — Edited
Hi Alan, i was thinking of using a FTDI Uart to Usb dongle. @DJ, how did you wire the Lidar motor? Did you use PWM or wired the 5V directly?
PRO
Synthiam
#34  
The wiring is in the manual above. Just connect the +5 and ignore the pwm wire

User-inserted image
#35  
@proteusy

I do have a spare one of those as well.  I was saving it to convert an EZ-B to USB, but the Spark fun ones are cheap, so that may be an option as well. Although the one I have is a 3.3v, so I may need a different one (supposedly it can be changed to 5v by soldering across a couple of pads on the board, but I don't want to screw it up with my *bunny hug* soldering skills).
PRO
Synthiam
#36  
If you find any usb<->uart's online (or amazon), make sure they say windows 10. Because a lot of those ftdi chips don't have win10 drivers... or, you have to search the internet to find them LOL
#37  
Sparkfun has a link to the ftdi drivers.   The issue now is that it appears all of the eBay sellers of the Lidar are actually the same guy and none are in stock, and none expected until after the Chinese New Year month long holiday.

Alan
#39  
@proteusy

That is the guy who just told me he was out of stock and it turned out to be the same one I had already tried to order from.   Can't find any who actually have them.
PRO
Portugal
#40  
@thetechguru
Yep, right...
#41   — Edited
I found a commercial retailer who seems to have them in stock, but it is the 1.0 version for $179 US, not the 1.5.   https://dabit.industries/products/360-laser-distance-sensor-lds-01-lidar

I am willing to go around $100 for something guaranteed to work for object avoidence in NMS, but $179 for what might not be the right one seems a little rich.  Hitachi now has a 2.0, but I can't find them for sale anywhere.  Probably just selling to vacuum manufacturers. 

I guess I am stuck with ultrasonic object avoidence for now.  It is OK, but misses soft surfaces like curtains.  May need to rig up a bump sensor, or get some more Sharp IR to augment. (I use a Sharp for cliff detection because there is a step down into my family room, but I don't think I'll need it using way point nav with the Real sense, So I might repurpose it).
PRO
Synthiam
#42  
If you guys can find another lidar (say from robotshop or somewhere accessible in stock) then we can can add support to that.

Alan, you could use a simple ultrasonic distance sensor for obstacle avoidance with the NMS. The Navigator will pause navigation and launch a script when obstacle has been detected. That's configurable in the config menu.
#43   — Edited
Robot shop has 2 sub $100 devices in stock.

https://www.robotshop.com/en/rplidar-a1m8-360-degree-laser-scanner-development-kit.html

Although a review I read in the reviews that  the SDK was written by a drunken lobster, and https://www.robotshop.com/en/ydlidar-x2-360-laser-scanner.html which I believe is a brand you complained about the SDK in another thread, although I could be mis remembering. 

For my initial experiments, I am fine using Ultrasonic because it should work well enough in my basement, but if I don't get something much more precise, I won't ever be able to run it on the main floor, because if I dent the maple dining set, my wife will first destroy the robots, and then kick me out of the house:)
PRO
Synthiam
#44  
Ha that’s funny. I usually say drunken sailer but a drunken lobster is pretty good!
PRO
Synthiam
#45  
Added options in the config menu for Baud Rate and Offset Degrees.

@PTP, this will work with the robotis USB <-> UART converter. You'll need to install the CP210x Windows Driver though. Because they're using a chipset that doesn't have a default windows driver. Get it from the manual link above