Menu
(LIDAR-lite datasheet mentions acquisition time lidar ( can spin between 300 and 900 PPM (5-15 RPS) with at least 521 points per revolution per laser (. When space and weight requirements are tight, the LIDAR-Lite v3 soars. It’s the ideal compact, high-performance optical distant measurement sensor solution for drone, robot or unmanned vehicle applications.
LIDAR Lite Mapping with DYNAMIXEL Servos
This demo will show off the capabilities of the LIDAR Lite by rotating the LIDAR lite and using the data to create a visual map of the room. This demo will require Google Chrome to be installed on your computer.
Required Hardware
- 1 x LIDAR Lite Module and mounting Hardware
Robot Turrets
This project is compatible with all of the InterbotiX Robot Turrets listed below. Each Turret comes with an ArboitX-M Robocontroller, a serial programming cable, power, hardware and servos - everything you need to perform this demo. The added tilt servo is not needed for this demo, but will give you an added degree of freedom for scanning the LIDAR Lite.
Pan/Tilt Kits
If you already have an ArbotiX Robocontroller, you can purchase a Pan/Tilt kit to use for this demo.
Build Your Own
This demo only requires a single DYNAMIXEL servo to rotate the LIDAR Lite. See this article about servos compatible with the ArbotiX-M and this demo, as well as programming and power hardware you will need. Please note that scanning at higher speeds with the MX-12W and AX-12W is currently untested with our demo software. Results may vary. You may wish to get a back-frame for your respective servo
- F8 Frame (AX-12A, AX12-W, AX-18A, MX-12W)
- FR07-B101K (MX-28T)
- FR05-B101K (MX-64T)
- FR08-B101K (MX-106T)
If you are intersted in getting the hardware only (no servos) from our Pan-Tilt kits to create a Pan-only kit, please Contact us
Hardware Setup
If you have not already done so, please go through the ArbotiX-M Getting Started Guide and any getting started guides for your kits. If you are using a single AX-12A, you do not need any special setup. If you are using MX servos or a tilt servo, you will need to use the DynaManager to set the baudrate and ID for your servos. The Pan servo should be set to ID 1 at 1000000 bps, and the Tilt servo should be set to ID 2 at 1000000 bps. The Dynamanager will automatically set the baud rate correctly for you.
Finally, go through the LIDAR Lite getting started guide to hook up and test your LIDAR Lite.
The diagram below shows you everything you need to connect to get your LIDAR Lite scanner working. Only one servo as ID 1 needs to be connected, if you are using a Pan/Tilt mechanism, connect your second servo as ID 2.
LIDAR Lite Pin | ArbotiX Pin |
---|---|
5v | D16 Power Pin |
GND | D16 Ground Pin |
SDA | D16 Data Pin |
SCL | D17 Data Pin |
Hardware Programming
Download the firmware and software zip file. Extract this file's contents to your computer.
Now open
in your Arduino IDE and load it onto your ArbotiX-M. Your pan servo will move towards its lowest position. Your tilt servo (if connected) will move to a centered/level position.
Servo Type
You will need to make a modification to the firmware depending on the servo you are using. At line 15 you should see
You will need to uncomment one of these lines based on which servos you are using. For AX servos (AX-12A, AX-18A, AX-12W) your code should look like
For MX servos (MX-28T, MX-64T, MX-106T, MX-12W) your code should look like
Note on Scan Limits
By default, the firmware will make the servos scan for their entire limits (300° for AX servos, 360° for MX servos). By adjusting the
PAN_MIN
and PAN_MAX
value, you can limit the servo to scan a smaller region. This may be useful for faster scanning when mounted on a robot. You will also need to adjust the MAPPRED_PAN_MIN
and MAPPED_PAN_MAX
lines. For MX servos, this will be the same as PAN_MIN
and PAN_MAX
. For AX servos, you will need to convert your angle limits into the 0-4095 scale. You can use the formula So for example, the default limits of the AX servo are from 30° to 330° When 0° is 0 and 360° is 4095, 30°l maps to ~341 and 330° maps to 3754 Default Speed
By default the servo speed is fairly slow. We recommend that you adjust the speed in the app itself, but if you want the default speed to be higher, you can increase the value of the following line
See the manual for your specific servo for more information on speed settings. This demo performs much better at low speeds.
Software Setup
Open up a chrome browser and enter
chrome://extensions/
into the address bar, or open the chrome settings and click on 'Extensions' in the left navigation bar. Click the check-box next to 'Developer Mode'. This will give you the ability to load unpacked chrome extensions. Now click 'Load unpacked extension...' and navigate to the
lidarChrome
folder. You should now see 'Lidar MX Turret' as an available extension. Click 'Launch' to launch the Application. You should now see the Lidar Lite + Servo Mapping Demo.
Connection
From the drop-down menu you should see a list of available serial ports. Choose the port associated with your USB-Serial device - this should be the same device / port you used to program your ArbotiX-M. Click 'Connect' to connect to the device.
Start/Stop Sweep
Connecting to the ArbotiX-M will reset the board. It may take 5-6 seconds for the sketch to start up after a reset (the green user LED will turn on once the ArbotiX is ready).Once the board is ready you can click 'Start Sweep' to start the servo. The servo will sweep back and forth. Click 'Stop Sweep' to stop the motion. The servo will finish its current sweep before it stops.
X Center / Y Center
The red box represents the LIDAR Lite's Position. You can adjust the
X Center
and Y Center
sliders to move this position in relation to the rest of the screen. This is useful if your setup is not in the center of the room. Servo Speed
This slider allows you to set the servo scanning speed. This Application works with a variety of servos, so the speed will vary from servo to servo, and the slider will not be completely linear in terms of speed.
Max Distance
By adjusting this value, you can enlarge or decrease the size of the scan. Enter in the farthest distance from the LIDAR in your room to make the scan fit the screen as best as possible.
Clear On Sweep
Checking this box will cause the display to clear whenever a sweep is completed, similar to a radar type display.
Draw Lines
Checking this box will cause lines to be drawn between each point.
Clear Canvas
This will clear the current canvas display.
Video Demo
Performance
This is a very basic demo of what the LIDAR Lite is capable of. At low speeds this demo works very well, but at high speeds this demo does not give as good results. It may be possible to increase the throughput of this demo by modifying the firmware so that positional reads are taken at long intervals, and the present position is approximated/predicted in-between to minimize communication errors on the DYNAMIXEL bus. Keep in mind that the rated acquisition time for the LIDAR LITE is ~ 0.02 sec, or ~ 50 samples per second. For a turret running at 1 rotation per second, this would be about 50 samples and give you 7.2° between each sample. If you were to map a circular room of 1000cm radius , each point would be ~125cm away from the next in a best case scenario. As speed increases, this point to point distance will
- Product Page: LIDAR-Lite v3 - See product page for operating manual
- Product Page: LIDAR-Lite v3HP - See product page for operating manual
This library provides quick access to basic functions of LIDAR-Litevia the Arduino interface. Additionally, it can provide a user of anyplatform with a template for their own application code.
For detailed specifications, pinout, and connection diagrams, see the manuals linked at the above product pages.
A Note on Compatibility:Minor interface changes have occurred between LIDAR-Lite v3, v3HP, and previous versions. Backwards-compatibility of this library is largely preserved, though support is not directly provided for v1 and v2.
Installation instructions
To install, download this repository and place in your Arduino libraries folder or use the Arduino Library Manager. If you need help, follow the instructions here: http://arduino.cc/en/Guide/Libraries.
Example Sketches
v3/GetDistancePWM
This is the simplest demonstration of LIDAR-Lite. It shows how to read a distance using the PWM interface.
v3/GetDistanceI2c
This demonstration shows how to read distance using the I2C interface and choose preset configurations.
v3/ShortRangeHighSpeed
This example shows a method to run LIDAR-Lite at high speed for short range applications. It combines a variety of settings to trade off range and accuracy for very fast measurements.
v3HP/v3HP_I2C
This example shows various methods to run LIDAR-Lite v3HP.
v3HP/v3HP_MONITOR
Use the MODE pin to monitor STATUS of the LIDAR-Lite v3HP.
Version History
- 2.0.5 - Add v3 library function to set alternate I2C addr
- 2.0.4 - Update short-range, high-error configuration
- 2.0.3 - New example using MODE pin for STATUS output of v3HP
- 2.0.2 - Updates to v3HP library
- 2.0.0 - Support for LIDAR-Lite v3HP
- 1.0.3 - Fix version convention
- 1.0.2 - Library Manager Update
- 1.0.1 - Release to Library Manager
- 1.0.0 - Initial release
Raspberry Pi Library for LIDAR-Lite v3
- LIDAR-Lite v3 on Pi - Basic support available for Raspberry Pi 3B+
License
Copyright (c) 2018 Garmin Ltd. or its subsidiaries. Distributed under the Apache 2.0 License.See LICENSE for further details.