Jetson AGX Xavier에서 PointCloud2 데이터를 생성하여 Rviz2에 표시

Jetson AGX Xavier에서 PointCloud2 데이터를 생성하고 RVIz2에 표시하는 메모



Cmake 업데이트



Open3D Build에는 CMake 3.18 이상이 필요하므로 CMake 3.19.5를 설치했습니다.
sudo apt -y remove cmake
wget https://github.com/Kitware/CMake/releases/download/v3.19.5/cmake-3.19.5.tar.gz
tar xvf cmake-3.19.5.tar.gz
cd  cmake-3.19.5
./bootstrap && make -j6 && sudo make install

Open3D 빌드에 필요한 패키지 설치


sudo apt install python3-colcon-common-extensions
sudo apt-get install -y libsdl2-dev libc++-7-dev libc++abi-7-dev libxi-dev
sudo apt-get install -y clang-7

Open3D 빌드


git clone --recursive https://github.com/intel-isl/Open3D
cd Open3D
git submodule update --init --recursive
mkdir build
cd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_CUDA_MODULE=ON \
    -DBUILD_GUI=ON \
    -DBUILD_TENSORFLOW_OPS=OFF \
    -DBUILD_PYTORCH_OPS=OFF \
    -DBUILD_UNIT_TESTS=ON \
    -DCMAKE_INSTALL_PREFIX=~/open3d_install \
    -DPYTHON_EXECUTABLE=/usr/bin/python3 \
    ..

이대로 Build하면 에러가 나오므로 Open3D/cpp/open3d/core/linalg/BlasWrapper.h 를 수정. #include "/usr/include/aarch64-linux-gnu/cblas-netlib.h"
추가.

Open3D/cpp/open3d/core/linalg/BlasWrapper.h
#pragma once

#include "/usr/include/aarch64-linux-gnu/cblas-netlib.h"
#include "open3d/core/linalg/LinalgHeadersCPU.h"
#include "open3d/core/linalg/LinalgHeadersCUDA.h"
#include "open3d/utility/Console.h"
make -j6 & sudo make install-pip-package
ls /home/jetson/Open3D/build/lib/python_package/pip_package/
total 25268
  759703     4 ./
  758262     4 ../
19136964 25260 open3d-0.12.0+3ca4d62c0-cp36-cp36m-linux_aarch64.whl
sudo pip3 install /home/jetson/Open3D/build/lib/python_package/pip_package/open3d-0.12.0+3ca4d62c0-cp36-cp36m-linux_aarch64.whl 

ROS2-Point-Cloud-Demo 빌드



ROS2-Point-Cloud-Demo로 ply 형식의 파일에서 PointCloud2D 데이터 생성
cd ~/ros_ws/src/
git clone https://github.com/SebastianGrans/ROS2-Point-Cloud-Demo
cd ~/ros_ws/
colcon build --symlink-install --packages-select pcd_demo
source install/setup.bash

실행



RVIz2 시작
ros2 run rviz2 rviz2

ply 형식의 데이터에서 PointCloud2D 형식의 데이터를 생성.
ros2 run pcd_demo pcd_publisher_node ~/ros_ws/src/ROS2-Point-Cloud-Demo/resource/teapot.ply    

Rviz2에서 PointCloud2 형식의 데이터 보기









좋은 웹페이지 즐겨찾기