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

#67  
Yes, it recovers when I press start.  I'll have to capture the error from the log next time it happens.  In the skill window I see two errors, CRC error, and something about invalid direction, with a negative value for the degrees, usually way over -360 (like -900).  Not sure which of those is triggering the stop, and it seems to take 4 or 5 before it does.  When I was using the other computer that had a top USB com port speed of something like 124K vs this one where I can leave it on the default (208K?) it happened every minute or so.  Now it can run for up to 10 minutes at a time before it happens.
PRO
Synthiam
#68  
You’re changing the baud rate? The sensor has a standard baudrate and changing it from the default value will create a lot of problems. Specially if you make it lower.
#69  
Not on the new computer.  I had to on the other computer because the com port wouldn't communicate at all at the default speed (it claimed it was a USB 3 port, but I have doubts.  I explained above that it was a cheap Chinese tablet and the eBay seller had issues getting English language Windows 10 drivers, so could be a USB 3 port with a bad driver too) .  This one I am using does support the higher speed, so I left it at the default. 

Alan
PRO
Synthiam
#70  
The default baudrate of the usb<->uart adapter wouldn't need to be USB 3, or even USB 2. It would even be fine with usb1 because the baudrate is actually less than 37k/sec. The question would not be the USB port, it would be the USB<->uart adapter supporting a baudrate over 115200, which some do not.

The usb3 is far too overkill at 5Gbps. And even USB 2 is 480Mbps. And USB1 is 12Mbps

The sensor needs 37k/sec which is 0.036133Mbps
#71  
Here is the error.  It took much longer this time, and I only saw CRC errors, not bad direction errors.

Code:




System.Exception: Lidar service parse error: System.Exception: Lidar data is piling up and not being processed. We stopped the collection at 64,330 Bytes. Post on the forum so we can better understand what is happening and fix it.
at Hitachi_LG_LDS_Lidar.LidarServiceUART.imageThreadWorker(EZTaskScheduler sender, Int32 taskId, Object o) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\LidarServiceUART.cs:line 152
at Hitachi_LG_LDS_Lidar.LidarServiceUART.imageThreadWorker(EZTaskScheduler sender, Int32 taskId, Object o) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\LidarServiceUART.cs:line 182
at EZ_B.EZTaskScheduler.fFm9XQmrkBhHxhXYghH(Object , Object , Int32 taskId, Object )
at EZ_B.EZTaskScheduler.U6kYDTXstG()
PRO
Synthiam
#72  
one packet is 2,520 bytes. The error states that there are 20 packets behind in processing. It seems the computer isn't able to process the data quick enough - which is pretty strange because it's not very complicated to process. I'll take a look at the parser and see if there's something i can do from my end. I'm not sure what I'd be able to do to unless something stands out to optimize in my code
#73  
I'll run task manager next time and see if there is anything using up resources on the computer that I don't need running.  I think it took longer to see the error because of the optimization you did on the Realsense D265 since the last time I ran it.

The change to the Navigator to ignore distances outside of the selected degrees worked perfectly btw....  Drove right along the wall that used to stop it and through a doorway just fine.

Alan
#75  
Not yet.   It has plenty of disk space, so optimizing space isn't an issue, but I do need to get rid of services I don't need to have running.  

Alan
PRO
Synthiam
#76  
There’s performance tips in there as well. Specifically the hibernate is a big one. Also disabling defender virus scanner thing. And adding power management to prioritize power. Anyway it’s all in there so I’d really advice doing it. Otherwise I wouldn’t have put the effort into making it:D
#77  
Confirmed tonight, issues are definitely CPU related.  Was much worse when I connected a higher resolution Logitech web cam so I would have a wider angle view, and CPU was sitting around 93% with bumps up to 100% where the Lidar would shut down.   I'll do some optimization before my next set of tests since I would rather spend CPU on script processing than services I don't need running.   

Navigator is really cool though.  Been running the robot all around my basement just by picking points and telling it to go there. After a few trips, I get a pretty good map of the walls and obstacles so I can set path points without being able to actually see the robot.  

Alan
PRO
Synthiam
#78  
Try limiting the camera display frame rate. I find a lot of video cards can’t handle displaying high frame screen draws

itll still process full speed internally. But the display will be less
PRO
USA
#79  
@DJ can you p[lease provide the link(s) to the parts I need for my Hitachi-LG LDS Lidar,

Thank you,
Merne
PRO
Synthiam
#80  
Merne, please click the links at the top of this page for hardware manufacturer.
PRO
USA
#81  
Hi DJ, Thanks for your answer.   I have the Hitachi-LG LDS Lidar,  I just need the add on parts, There are so many.  If you could please provide a link to the USB>>Uart convertor or the Arduino to make this work.  I do not want to spend money on sometime I will not use.  Thank you@
PRO
USA
#82  
Thanks DJ,

I was hoping for the parts you used. I see many different parts and would like to use the same as you, please.
I jurat don't want to get the wrong ones,
Thanks in advance.

Cheers
PRO
Synthiam
#83   — Edited
Any USB <-> UART adapter will work. I don't have any preferred USB <-> UART adapter to recommend. I have dozens of different onces. I get them from Amazon.
PRO
USA
#85  
thetechguru,
  Can you give any details on your new faster computer, like RAM, etc.
Noticed them on Amazon with different options.
Sounds like you are getting good results with navigation.
Thanks,
Steve S
#86  
This is the computer I am currently using:  https://www.amazon.com/gp/product/B089FFGYC7/

Note, the whole bottom half is a dock that can have a laptop sized SATA hard drive or SSD installed, so if you don't need the extra storage space the computer is only half as tall without the dock.   (the latest pictures in my Long Life Roli thread show it sitting on top of a large power bank.  The computer runs on 12v. 

https://synthiam.com/Community/Robots/Long-lasting-Roli-20253

Alan