Thursday, May 2, 2024

NVIDIA Jetson with LIDAR

NVIDIA Jetson with LIDAR

 

Hardware

  • NVIDIA Jetson  ( we use NVIDIA Jetson Nano 4GB develop kit )
  • RPLIDAR A1M8R6 ( 360 Degree Laser Scanner Development Kit )


What is RPlidar?

RPlidar is a brand of inexpensive and lightweight laser range finders that use a rotating laser scanner to measure distances and create a 2D point cloud of the environment. It is commonly used in robotics, drones, and other autonomous systems for obstacle detection, mapping, and navigation. RPlidar provides accurate and reliable distance measurements with a wide field of view and a long range, making it a popular choice for many robotics enthusiasts and professionals.

The RPLidar A1M8R6 - 360 Degree Laser Scanner Development Kit is a low cost 2D UDAR solution developed by RoboPeak Team. It can scan 360° environment within 12 meter radius. The output of RPUDAR is very suitable to build map, do SLAM, or build 3D model. RPLIDAR A1’s scanning frequency reached 5.5 Hz when sampling 360 points each round. And it can be configured up to 10 Hz maximum. RPLIDAR A1 is basically a laser triangulation measurement system. It can work excellent in all kinds of indoor environment and outdoor environment without sunlight.

System Diagram


Connect Micro USB cable from NVIDIA Jetson to RPLidar.
The RPLidar will begin spinning and transmit data.


Install RPLidar SDK

The RPLidars work with all of the NVIDIA Jetson.  
A Linux kernel driver called CP210x must be installed on the Jetson. 
The CP210x driver talks serial to the RPLidar over USB.

Check Serial to USB Port


$ lsusb             

$ usb-devices  

Product=CP2102 USB to UART Bridge Controller
If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=cp210x

RPLidar SDK

$ git clone https://github.com/Slamtec/rplidar_sdk
$ cd rplidar_sdk
$ make


This will download the SDK and build the libraries and examples. For the Jetson, 
the output will be in rp_lidar/output/Linux/Release. 

Check Baud rate Communication 

$ cd output/Linux/Release    
$ ./custom_baudrate /dev/ttyUSB0 115200  



To run the ultra_simple demo.

$ ./ultra_simple  --channel --serial /dev/ttyUSB0 115200  


To run the simple grabber demo.

$ ./simple_grabber  --channel --serial /dev/ttyUSB0 115200  



Install rplidar_ros for ROS


sudo sh -c 'echo "deb  http://packages.ros.org/ros/ubuntu  $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update

Install ros-melodic

sudo apt install ros-melodic-desktop
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

Check the version

rosversion -d

Create the catkin root and source folders

clearros
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src

Clone the github repository of RPLIDAR ROS package

git clone  https://github.com/robopeak/rplidar_ros.git
cd ..

Run catkin_make to compile your catkin workspace

catkin_make

Run to source the environment with your current terminal.

source devel/setup.bash

Launch the RPlidar Node

roslaunch rplidar_ros view_rplidar.launch


Reference

Getting Started with the Low-Cost RPLIDAR Using NVIDIA Jetson Nano

https://collabnix.com/getting-started-with-the-low-cost-rplidar-using-jetson/






Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan