Attention

You are viewing an older version of the documentation. The latest version is v3.3.

Robot Vision Libraries

Smart manufacturing and Industrial 4.0 encourage users to introduce vision-guided robots for flexible and productive production lines. 3-D data processing is one of the key technologies of robotic vision. Point Cloud Library (PCL) and Fast Library for Approximate Nearest Neighbors (FLANN) provide a series of 3-D processing algorithms commonly used in industrial robots (for picking, welding, painting, gluing, and so on), mobile robots (for visual SLAM and navigation), and 3C manufacturing (for inspection, measurement, and so on)

../_images/pcl_modules.png

According to customer feedback, algorithms from segmentation, sample consensus, surface, registration, k-dimensional tree (kdtree), octree are selected for acceleration on Intel® platforms. The acceleration is enabled with Intel® oneAPI Toolkits, a set of tools for deploying the computing across heterogeneous devices (for example, integrated GPU).

The following figure illustrates the high-level block diagram of oneAPI acceleration of RVL.

../_images/high_level_diagram.png

This section explains the following:

  • Procedure to build and install Robot Vision Libraries (RVL) on Intel® Edge Controls for Industrial (Intel® ECI or ECI) platform

  • Acceleration results with oneAPI Toolkits

  • Procedure to replicate the tests and demo, and details on where to find the example code

RVL Developer Reference

RVL Deb packages are built on packages-bullseye with Robotics Controller meta-packages selected, as shown in the following figure.

../_images/eci_r.png

RVL Prerequisites

RVL Dependencies

As shown in the high-level diagram, the RVL packages depend on oneAPI Toolkits and Robot Operating System Software (ROS2).

  • oneAPI and GPU drivers

  • ROS2 Foxy

Install RVL

RVL components, oneAPI, and ROS2 are all built from the Robotics Controller meta-package. You can install the RVL from the ECI APT repository for Debian (Bullseye) ONLY. Setup the ECI APT repository, then perform the following command to install the RVL:

Install from individual Deb packages
$ sudo apt install eci-robotics ros-foxy-moveit

Besides, you need to install GPU drivers which are not part of ECI in this release (follow instructions in GPU Installation Guides).

FLANN-DPCPP

FLANN is a 3-D processing library that PCL uses to search for nearest neighbors in three-dimensional or even higher dimensional space. FLANN builds indices to the input points and provides interfaces to search for the nearest K (number of) or nearest R (radius) neighbors.

The oneAPI DPC++ Compatibility Tool (DPCT) is used to migrate the CUDA implementation into Data Parallel C++ (DPC++) for building and searching the k-dimensional tree. Additionally, some CUDA thrust functions need manual migration. The dimension and size of index space, nd_range of SYCL are adapted according to the hardware device capability of the maximum work-group size. Unified Shared Memory (USM) is used to avoid additional memory copy.

../_images/flann_performance.png

FLANN Tests

The following section is applicable to:

../_images/target_generic.png

Follow the FLANN-DPCPP section in /opt/intel/robotics/Readme.txt for FLANN tests.

Expected outputs (processing time varies according to the platform):

../_images/flanntest_outputs.png

Note: It takes time for SYCL to load codes/data to GPU for the first time to create the kdtree.

PCL-oneAPI

PCL contains common algorithms for 3-D point cloud processing. For the PCL module with CUDA code, DPCT is used to migrate the CUDA code to DPC++ implementation. For the PCL module without CUDA code, Intel® VTune Profiler is used to identify the performance bottlenecks and OMP is used to enable multi-processing via compiler directives.

../_images/pcl_performance.png

PCL Tests

The following section is applicable to:

../_images/target_generic.png

Follow the PCL-oneAPI section in /opt/intel/robotics/Readme.txt for PCL tests.

Expected outputs (processing time varies according to the platform):

../_images/pcltest_outputs.png

3-D Object Pose Detection Demonstration

Bolt pose detection application demonstrates traditional 3-D Object Pose Detection (OPD) using PCL-oneAPI. The application takes point cloud input from a PCD file, detects the 6-DOF pose of the bolt by invoking accelerated PCL registration algorithms, transforms the object pose into robot’s base frame, plans grasp pose for the bolt with necessary adjustment.

The following section is applicable to:

../_images/target_generic.png

Follow the OPD section in /opt/intel/robotics/Readme.txt for OPD tests.

Expected outputs (processing time varies according to the platform):

../_images/opd.png
../_images/opd_outputs.png

Example Code

The following section is applicable to:

../_images/target_generic.png

Example code is prebuilt into binaries as test cases and demo applications. Example code is also provided with the full source tree. You can modify and build the codes for customization.

FLANN

The FLANN-DPCPP example code is located at /opt/intel/robotics/flann_dpcpp.

$ cd /opt/intel/robotics/flann_dpcpp
// Example codes for k-search and radius search:
src/flanntest.cpp
// Exmaple cmake file:
CMakeLists.txt
// Follow build and run steps in 'README.md', skipping the dependencies installation steps since they're already installed by ECI.

PCL

The PCL-oneAPI example code is located at /opt/intel/robotics/pcl_oneapi.

$ cd /opt/intel/robotics/pcl_oneapi
// Example codes for using optimized PCL algorithms:
test/oneapi
// Example cmake files are available under each subfolder.
// Follow build and run steps in 'oneapi/README.md', skipping the dependencies installation steps since they're already installed by ECI.
// More tutorials are available in 'doc/tutorials/content/oneapi_*.rst'.

OPD

The OPD demo code is located at /opt/intel/robotics/ros2-opd/src.

$ cd /opt/intel/robotics/ros2-opd/src
// Example codes for using pcl-oneapi for 3D object pose detection:
grasp_ros2/src/grasp_detector_opd.cpp
// Example cmake file:
grasp_ros2/CMakeLists.txt
// Build with colcon is not yet supported in bullseye.