Thumbnail

Hitachi-LG LDS Lidar

by Hitachi

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

How to add the Hitachi-LG LDS Lidar robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Navigation category tab.
  5. Press the Hitachi-LG LDS Lidar icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Hitachi-LG LDS Lidar robot skill.


How to use the Hitachi-LG LDS Lidar robot skill

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. To understand how this skill can be used, reference the NMS manual page.

Screenshot

User-inserted image

Configuration

User-inserted image

1) BaudRate value The baud rate for communication to the USB serial adapter or Arduino. By default, the baud rate for the lidar should be 230400. However, some USB serial converters use different baud rates between the PC's USB port. The baud rate between the lidar and USB adapter must be 230400.

2) Offset Degrees value Correct the angle that the lidar is mounted

3) Advanced communication parsing checkbox Include debug information in the log window. This is only recommended if asked by Synthiam to help debug a communication issue. Otherwise, this will use a lot of resources.

4) Set variables with location data checkbox If you're not using the NMS, check this option. The global variables will be created for the scan data if this checkbox is checked.

5) Fake NMS Pose hint event checkbox The Better Navigator can use the Hector SLAM pose hint, which will not require a pose sensor. You can enable this option if you have The Better Navigator configured to use Hector as the pose hint. This will send a "fake" pose hint of 0,0 to the NMS so that the pose event will run after every lidar scan.

6) RTS Enabled checkbox RTS (Ready To Send) is an optional signal line for UART communication. Some USB adapters, specifically some Arduinos, may require this to be enabled. If your USB Serial adapter is not responding, you may need to enable or disable this option.

7) DTR Enabled checkbox DTR (Data Terminal Ready) is an optional signal line for UART communication. Some USB adapters, specifically some Arduinos, may require this to be enabled. If your USB Serial adapter is not responding, you may need to enable or disable this option.

NMS (Navigation Messaging System)

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

User-inserted image

A recommended navigation robot skill is The Better Navigator, which uses the NMS data.

Program the LIDAR in Blockly Like all Synthiam controls, the Blockly programming language can be used. In the 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

Variables You can view the variables this skill creates in the configuration menu of this control. The variables hold the most recent values of the lidar's minimum/maximum distance, degrees, and running status. Here is a list showing the variables using the Variable Watcher robot skill.

User-inserted image

Arduino Sketch

There are two ways to connect to this lidar. You can use a standard USB<->UART converter, such as those 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 because they support emulating USB HID devices, such as serial devices.

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


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


ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

#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@

#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.

#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  
#87  

Not sure if there is a different area to post, also, no Related Hardware Product for my Hitachi-LG LDS Lidar.  I keep getting Parser: Packet failed CRC check errors.  Does anyone no way? see below...

System.Exception: Lidar service parse error: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Hitachi_LG_LDS_Lidar.LidarSensorParser.ParseRawSensorPacket(Byte[] data) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\LidarSensorParser.cs:line 44 at Hitachi_LG_LDS_Lidar.MainForm._lidarService_OnLidarDataReady1(Object sender, Byte[] lidarData) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\MainForm.cs:line 201 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 176 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.jn1guWLfLhdrbRwRngL(Object , Object , Int32 taskId, Object ) at EZ_B.EZTaskScheduler.tLuXrWNGK5() System.Exception: Lidar service parse error: System.NullReferenceException: Object reference not set to an instance of an object. at Hitachi_LG_LDS_Lidar.MainForm._lidarService_OnLidarDataReady1(Object sender, Byte[] lidarData) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\MainForm.cs:line 221 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 176 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.jn1guWLfLhdrbRwRngL(Object , Object , Int32 taskId, Object ) at EZ_B.EZTaskScheduler.tLuXrWNGK5() System.Exception: Lidar service parse error: System.NullReferenceException: Object reference not set to an instance of an object. at Hitachi_LG_LDS_Lidar.MainForm._lidarService_OnLidarDataReady1(Object sender, Byte[] lidarData) in C:\My Documents\SVN\Developer - Controls\In Production\Hitachi-LG LDS Lidar\MY_PROJECT_NAME\MainForm.cs:line 221 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 176 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.jn1guWLfLhdrbRwRngL(Object , Object , Int32 taskId, Object ) at EZ_B.EZTaskScheduler.tLuXrWNGK5()

Thanks in advance.

PRO
Synthiam
#88  

Moved to comment to the robot skill that you're asking about:)

The error occurs when the data is corrupt. This can be due to the USB port being too busy and can't process the data quick enough. Or the sensor isn't getting enough power. Or the sensor is faulty and while spinning, it isn't making a good connection to send the correct amount of data.

Things to check are

  • The wire isn't surrounded or wrapped in power lines or other signal lines
  • The wire isn't connected securely to the usb uart adapter or sensor
  • The sensor isn't getting enough power
  • The sensor contacts is dusty and needs to be cleaned
  • The usb port is busy with other devices. Try another usb port or disconnect some items on the usb line

Does the robot skill stop when it receives that error?