NMS Driver for the Hitachi-LG LDS 360 degree lidar.
How to add the Hitachi-LG LDS Lidar robot skill
- Load the most recent release of ARC (Get ARC).
- Press the Project tab from the top menu bar in ARC.
- Press Add Robot Skill from the button ribbon bar in ARC.
- Choose the Navigation category tab.
- 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
Configuration
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.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.
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.
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.zipVideos
Real-time SLAM mappingRoom Mapping
Near Object Detection
With the faster computer, this is now mostly working. It still gets an error every once in a while, and then stops running after several errors. For now I am just going to script around it (when the variable that shows the lidar is running changes from 1 to 0 I'll issue a ControlCommand to start it again).
Next time I am working with it I'll capture the error from the log for you.
Alan
Do you just press start and it recovers? What is the error
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.
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.
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
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
Here is the error. It took much longer this time, and I only saw CRC errors, not bad direction errors.
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