3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Jetson AGX Xavier上でPointCloud2のデータを生成してRviz2に表示

Last updated at Posted at 2021-05-02

Jetson AGX Xavier上でPointCloud2のデータを生成してRVIz2に表示するためのメモ

picture.png

CmakeのUpdate

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のBuildに必要なパッケージをインストール

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をBuild

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をBuild

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形式のデータを表示

pd00.png

pd2.png

pd02.png

picture.png

3
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?