RPLidar A2 – NVIDIA Jetson Development Kits

The Slamtec RPLidar A2 is one of the most popular 2D lidar currently available. Interfacing with a Jetson Dev Kit is straightforward. Looky here:

Background

The RPLidar A2 is a popular low cost 2D LIDAR. Slamtec sells a couple of different versions of the A2, and also sells a more capable A3 version. The prices range from ~$320 USD for the A2 to $600 for the A3. Both the A2 and the A3 have the same footprint, and use the same mounting pattern for attachment.

The RPLidars work by rotating a laser emitter and receiver. The laser emits light, the receiver receives the light. Because the receiver knows when the light was emitted, it can measure accurately how long it takes for the light to reflect back from any objects in the lights path. Then it does some maths, and calculates the distance to the object.

This is a ‘2D’ lidar in that it can measure multiple points on a given plane. The plane is determined by the orientation of the sensor. The RPLidar A2 has a scan rate of up to 15Hz, providing 4000 samples/second. The angular resolution is 0.9 degrees. The range is ~ 4-5 meters outdoors and ~14 meters indoors (much more than the claimed range of 6m). 

All in all, that’s way swell for the price point.  These specifications are also just about right for most slower moving robots, let’s say less than 10-15 miles per hour. To go faster than that (and not outdrive the lidar), you probably will need greater than ~25Hz scan rates. The RPLidar A3 can come pretty close at 20Hz.

In the video, we mount the RPLidar A2 on a RACECAR/J FlatNose. Note that the RPLidar A2 does not provide the performance of a Hokuyo UST-10LX lidar like on the MIT configuration of RACECAR/J, but it is around $1300 less than the Hokuyo! If you are looking at exploring lidar in a an application like a rover or other vehicle on a budget, this is a good way to go. You’ll just have to remember not to outdrive the lidar.

Installation

The RPLidars work with all of the Jetson Development Kits. There is a trick to installing the RPLidar on the Jetson. A Linux kernel driver called CP210x must be installed on the Jetson. The CP210x driver talks serial to the RPLidar over USB. Fortunately this module is installed by default in the recent L4T installations. 

Attach the RPLidar to the Jetson using the supplied cables. You can then check to see if the RPLidar is recognized and the correct driver is loaded:

$ usb-devices

You should be able to find an entry similar to:

Product=CP2102 USB to UART Bridge Controller

Later in the entry you should see a line similar to:

If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=cp210x

The “Driver=cp210x” indicates that the proper module is loaded. If the driver does not load, you may be missing the driver. For a Jetson TX1 or Jetson TX2 there is a cp210x driver available on the JetsonHacks Github account.

Install RPLidar SDK

The Slamtec RPLidar Public SDK is available on Github. See the README in the repository for more informational goodness. To install the SDK:

$ git clone https://github.com/Slamtec/rplidar_sdk
$ cd rplidar_sdk/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. To run the ultra_simple demo, navigate to the Release folder, and then:

$ ./ultra_simple

The RPLidar should start spinning, and data should start spewing about on the console.

Install rplidar_ros for ROS

One nicety is that there is a ROS interface for the RPLidar. For simplicity, we’ll assume that ROS is already installed on the Jetson. There are articles located on this JetsonHacks site for installing ROS.

Navigate to your Catkin Workspace src directory. Then:

$ git clone https://github.com/Slamtec/rplidar_ros
$ cd ..
$ catkin_make

The rplidar_ros node should be installed at this point. If you have rviz installed, you can view the RPLidar output:

$ roslaunch rplidar_ros view_rplidar.launch

You will see output similar to that shown in the video.

Conclusion

If you are interested in understanding lidar on a budget, the RPLidar is a good starting point. This combined with the fact that there is ROS support makes this a very good first step when adding lidar to your robotics project.

Notes

You can purchase the RPLidar at a variety of shops online. For example, you can shop at Sparkfun.

DIYRobocars had a nice article on the RPLidar A2 a few months ago. There’s more detail about the actual performance of the device than presented here.

The power plug on the RPLidar interface board appears to be 4.0mm OD x 1.7mm ID. 5V please.

Be the first to comment

Leave a Reply

Your email address will not be published.


*