0
0

How to use T265(realsenset265の環境構築)

Last updated at Posted at 2024-05-03

動作環境

  • ubuntu20.04
  • ROS2 foxy
  • kernal 5.11
  • realsense-ros 4.51.1
  • realsense SDK 2.51.1

realsense SDK の Build

昔のSDKを使うためpipでinstallせずに自力でソースコードからbuildします。以下のGitHubからソースコードをとってきてください。librealsense v2.51.1

  • ubuntuを更新する
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  • librealsenseルート ディレクトリに移動して、次のスクリプトを上から順に実行します。
    接続されているインテル RealSense カメラはすべて取り外します。
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
./scripts/setup_udev_rules.sh
./scripts/patch-realsense-ubuntu-lts.sh
  • librealsenseルート ディレクトリに移動して実行します。
mkdir build && cd build
  • buildを実行する。(上から順に実行)
cmake ../
sudo make uninstall && make clean && make && sudo make install

realsense-ros の導入

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src/
git clone https://https://github.com/IntelRealSense/realsense-ros/blob/4.51.1
cd ~/ros2_ws
  • 依存関係の解決
sudo apt-get install python3-rosdep -y
sudo rosdep init # "sudo rosdep init --include-eol-distros" for Dashing
rosdep update
rosdep install -i --from-path src --rosdistro $ROS_DISTRO --skip-keys=librealsense2 -y

おそらくこのままだとerrerが出るそのため足りない依存は手動で入れる。例えば以下のように入れる。

sudo apt install ros-foxy-xacro ros-foxy-diagnostic-updater
  • buildする
colcon build

実行

端末を開く
以下を実行

source /opt/ros/foxy/setup.bash
cd ~/ros2_ws
. install/local_setup.bash

t265をつける

ros2 launch realsense2_camera rs_launch.py

rqtで可視化する
IMG_7608.jpg
この時Reliability PolicyをBest Effortに変更する。するとトピック/camera/pose/sampleを読むことができる。

0
0
0

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
0
0