It is getting exciting as I rebuild Dave on the Raspberry Pi5 with ROS 2 in Docker.
Before my ROS 2 ydlidar node can produce /scan topics, it must be able to access the YDLidar X4 sensor. That means building the YDLidar-SDK inside the Docker container and installing for C++ and Python programs.
I managed to figure out how to do that as part of the Docker container build, and initial tests from the command line inside the running container look good:
pi@GoPi5Go:DOCKER:~/GoPi5Go/systests/myYDLidar-SDK $ ydlidar_test_interactive
__ ______ _ ___ ____ _ ____
\ \ / / _ \| | |_ _| _ \ / \ | _ \
\ 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.2.5
[YDLIDAR] Lidar successfully connected [/dev/ttyUSB0:128000]
[YDLIDAR] Lidar running correctly! The health status: good
[YDLIDAR] Baseplate device info
Firmware version: 1.10
Hardware version: 1
Model: X4
Serial: 2020062200002315
[YDLIDAR] Lidar init success, Elapsed time 687 ms
[YDLIDAR] Start to getting intensity flag
[YDLIDAR] End to getting intensity flag
[YDLIDAR] Create thread 0x28727100
[YDLIDAR] Successed to start scan mode, Elapsed time 4563 ms
[YDLIDAR] Fixed Size: 1020
[YDLIDAR] Sample Rate: 5.00K
[YDLIDAR] Successed to check the lidar, Elapsed time 0 ms
[2024-05-20 01:19:41][info] [YDLIDAR] Now lidar is scanning...
Scan received[1716182380991912000]: 578 ranges is [inf]Hz
Scan received[1716182381114450000]: 575 ranges is [8.160734]Hz
Scan received[1716182381229298000]: 574 ranges is [8.707161]Hz
Scan received[1716182381336961000]: 570 ranges is [9.288242]Hz
Scan received[1716182381458714000]: 575 ranges is [8.213350]Hz
Scan received[1716182381574163000]: 575 ranges is [8.661834]Hz
Scan received[1716182381688706000]: 575 ranges is [8.730346]Hz
Scan received[1716182381804711000]: 574 ranges is [8.620318]Hz
Scan received[1716182381919389000]: 574 ranges is [8.720068]Hz
Scan received[1716182382034250000]: 574 ranges is [8.706176]Hz
Scan received[1716182382148415000]: 569 ranges is [8.759252]Hz
Scan received[1716182382256073000]: 574 ranges is [9.288673]Hz