DEV Community

Unpublished Post. This URL is public but secret, so share at your own discretion.

Getting Started with the Low-Cost RPLIDAR Using Jetson

Are you interested in building your own robot or autonomous vehicle? Are you looking for a cost-effective and efficient way to incorporate laser-based distance sensing into your project? If so, then you're in luck! In this blog post, we will explore how to get started with low-code RPlidar on the Jetson Nano, a powerful single-board computer from NVIDIA that is popular for AI and robotics applications.

What is RPlidar?

Image1

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.

Image2

Application

  • Home service /cleaning robot navigation and localization.
  • General robot navigation and localization.
  • Smart toy localization and obstacle avoidance.
  • Environment scanning and 3D re-modeling.
  • General simultaneous localization and mapping

Image4

What is Jetson Nano?

Jetson Nano is a single-board computer (SBC) developed by NVIDIA, specifically designed for AI and robotics applications. It features a powerful NVIDIA GPU with CUDA cores for accelerated computing, a quad-core ARM Cortex-A57 CPU, and ample memory and storage options. Jetson Nano runs on a Linux-based operating system and supports a wide range of programming languages, making it ideal for developing AI-powered robotics projects.

Getting Started

Step 1. Hardware Requirements

  • 1x RPLiDAR A1M8 360 Degree Laser Range Finder – 6m (Radius Range)

Image11

  • 1 x Interfacing Controller and Connecting Cable.

Image10

  • 1x Jetson Nano

Image13

  • 1x Wifi USB Adapter for Keyboard and Mouse

Image15

  • 1x Tenda W311MI Wireless N150 USB Adapter Nano

Image14

  • 1x HDMI cable

Assemble the Hardware Components

First, you will need to assemble the hardware components required for using RPlidar with Jetson Nano. You will need a USB cable to connect the RPlidar to the Jetson Nano. Make sure to use a high-quality USB cable to ensure reliable data transmission.

Connect the RPlidar to the Jetson Nano: Plug one end of the USB cable into the RPlidar and the other end into one of the USB ports on the Jetson Nano.

Power Up the Jetson Nano: Connect the power supply to the Jetson Nano and power it up. Wait for the Jetson Nano to boot up and complete the initialization process.

Image7

Once you have assembled all the hardware components, you're ready to move on to the next step.

Step 2: Install the RPlidar Driver

Next, you will need to install the RPlidar driver on your Jetson Nano. The RPlidar driver provides the necessary software interface for communication between the RPlidar unit and the Jetson Nano. Here's how you can do it:

Open a terminal window on the Jetson Nano and run the following commands to install the RPlidar driver:

sudo sh -c 'echo "deb  http://packages.ros.org/ros/ubuntu  $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Enter fullscreen mode Exit fullscreen mode
  • Add a new apt key:
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
Enter fullscreen mode Exit fullscreen mode
  • Install ros-melodic
sudo apt install ros-melodic-desktop
sudo rosdep init
Enter fullscreen mode Exit fullscreen mode
  • Update Rosdep
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode
  • Check the version
rosversion -d
Enter fullscreen mode Exit fullscreen mode
  • Install catkin
clearros
Enter fullscreen mode Exit fullscreen mode
  • Create the catkin root and source folders:
mkdir -p ~/catkin_ws/src
Enter fullscreen mode Exit fullscreen mode
  • In your terminal, run:
cd ~/catkin_ws/src
Enter fullscreen mode Exit fullscreen mode
  • Clone the github repository of RPLIDAR ROS package.
git clone  https://github.com/robopeak/rplidar_ros.git
cd ..
Enter fullscreen mode Exit fullscreen mode
  • Then, run catkin_make to compile your catkin workspace.
catkin_make
Enter fullscreen mode Exit fullscreen mode
  • Run to source the environment with your current terminal. Don't close the terminal.
source devel/setup.bash
Enter fullscreen mode Exit fullscreen mode
  • Open a new terminal, run the following command - DO NOT CLOSE THE FIRST TERMINAL
roscore
Enter fullscreen mode Exit fullscreen mode

Launch the RPlidar Node

After the installation is complete, you can launch the RPlidar node by running the following command in the terminal:

roslaunch rplidar_ros view_rplidar.launch
Enter fullscreen mode Exit fullscreen mode

This will start the RPlidar node and establish communication between the RPlidar unit and the Jetson Nano. An instance of Rviz will then open with a map of the RPLIDAR’s surroundings.

View RPlidar Data in ROS

Image122

Conclusion

Getting started with low-code RPlidar with Jetson Nano is an exciting journey that can open up a wide range of possibilities for building robotics projects. In this blog post, we covered the basic steps to get started with low-code RPlidar with Jetson Nano, including setting up ROS, installing the RPlidar driver and viewing RPlidar data in ROS using RViz. By following these steps and exploring the possibilities of RPlidar, you can create innovative and exciting robotics projects with the Jetson Nano platform. So, grab your Jetson Nano and RPlidar unit, start experimenting, and unleash the power of low-code robotics! Happy coding!

Top comments (0)