I got the LIDAR SDK software installed today, which allows me to hear the LIDAR spinning and confirm the unit is functioning correctly.
While I have ROS2 “desktop” installed on my desktop system and ROS2 “base” installed on my GoPiGo3, I have not learned how to use either, so this test was with the SDK’s ydlidar_test program.
The software install method is at the bottom of this post, and now for the 1 minute “ta da!” experience: ( TL,DW;) LIDAR +3dBA barely audible )
Setup YDLIDAR X4 on ROSbot
=== Prereqs
- Linux OS: Using Ubuntu 20.04 Server LTS 64-bit
- External 5v power connected to microUSB of Interface Card
- USB A to USB C cable from RPi to Interface Card
==== Download and Install Latest SDK
$ cd ~ (/home/pi)
$ git clone https://github.com/YDLIDAR/YDLidar-SDK
$ cd YDLidar-SDK/build
$ cmake ..
$ make
$ sudo make install
...
-- Installing: /usr/local/bin/ydlidar_test <-- only applicable test for YDLIDAR X4
...
=== RUN YDLIDAR TEST===
/usr/bin/ydlidar_test
- Baudrate? 1 (128000)
- one-way? no
- scan freq? 5
\ \ / / _ \| | |_ _| _ \ / \ | _ \
\ V /| | | | | | || | | |/ _ \ | |_) |
| | | |_| | |___ | || |_| / ___ \| _ <
|_| |____/|_____|___|____/_/ \_\_| \_\
Baudrate:
0. 115200
1. 128000
2. 153600
3. 230400
4. 512000
Please select the lidar baudrate:1
Whether the Lidar is one-way communication[yes/no]:no
Please enter the lidar scan frequency[5-12]:5
YDLidar SDK initializing
YDLidar SDK has been initialized
[YDLIDAR]:SDK Version: 1.0.3
LiDAR successfully connected
[YDLIDAR]:Lidar running correctly ! The health status: good
[YDLIDAR] Connection established in [/dev/ttyUSB0][128000]:
Firmware version: 1.10
Hardware version: 1
Model: X4
Serial: 2020062200002315
LiDAR init success!
[YDLIDAR3]:Fixed Size: 1020
[YDLIDAR3]:Sample Rate: 5K
[YDLIDAR INFO] Current Sampling Rate : 5K
[YDLIDAR INFO] Now YDLIDAR is scanning ......
Scan received[1624198712776831000]: 567 ranges is [8.833922]Hz
Scan received[1624198712898864000]: 572 ranges is [8.756567]Hz
Scan received[1624198713013605000]: 571 ranges is [8.771930]Hz
^C
signal_handler(2)
281473638449600 thread has been canceled
[YDLIDAR INFO] Now YDLIDAR Scanning has stopped ......
=== Power Measurements
LIDAR draws
- 132mA at battery 12v motor off, RPi shutdown (150mA at 11v)
- 12mA at battery 11v motor off, RPi and GoPiGo3 up (after ran ydlidar_test)
- 55mA at 11v scanning at 5 Hz