https://www.waveshare.com/wiki/DTOF_LIDAR_LD19
https://www.aliexpress.us/item/3256804109024401.html
Setup device alias to /dev/ldlidar
sudo apt install libudev-dev
cat << EOF | sudo tee /etc/udev/rules.d/99-ldlidar.rules
# set the udev rule to alias the device at /dev/ldlidar
# CP210x USB Device
KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0777", SYMLINK+="ldlidar"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger
Check it:
screen -L /dev/ldlidar 230400
cd src
git clone https://github.com/mattwilliamson/ld19_lidar.git
colcon build --symlink-install --packages-select=ld19_lidar
source install/setup.sh
ros2 launch ld19_lidar node.launch.py
source install/setup.sh
ros2 launch ld19_lidar slam.launch.py
Thank you to these repos for doing all the hard work: