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

RealSenseD435をROS2 Humbleに最短導入

Posted at

はじめに

Ubuntu22.04、ROS2 Humbleの導入が完了している人向けのドキュメントです。

gitリポジトリからrealsense-rosを導入するのが定番ですが、
D435を起動したい場合には、今回ご紹介する方法でも問題ないように感じます。

最新版がよければ以下のrealsense-rosに従ってください。
また、一度aptでインストールしてしまった場合には、パッケージが重複してしまってbuildの際に失敗するかもしれません。そうなってしまったら、どちらかを消しましょう。

インストール

#sudo apt update, sudo apt upgrade の後
sudo apt install ros-humble-realsense2-camera

D435起動

# pointcloudなし
ros2 launch realsense2_camera rs_launch.py

# pointcloudあり
ros2 launch realsense2_camera rs_launch.py pointcloud.enable:=True
#realsenseのtopicがあるか確認
ros2 topic list

''' 出力例
/camera/camera/color/camera_info
/camera/camera/color/image_raw
/camera/camera/color/metadata
/camera/camera/depth/camera_info
/camera/camera/depth/image_rect_raw
/camera/camera/depth/metadata
/camera/camera/extrinsics/depth_to_color
/parameter_events
/rosout
/tf_static
'''

表示

rqtとRviz2の2通りご紹介します。

①RGBとDepth画像をrqtで表示

ros2 run rqt_image_view rqt_image_view

起動したあと、左上の一番長い項目を押すとtopic名を選択することができます。何も表示されなかった場合、右隣の矢印マークを押すとうまく行くかもしれません、、、
Screenshot from 2025-08-03 11-38-23.png

Screenshot from 2025-08-03 11-35-33.png

②PointCloudをRviz2で表示

rviz2

ひとまず起動したら、左下のAddをクリックしてtopicを選択しましょう。/cameraより下の階層に、ImageやPointCloud2があるはずです。今回はPointCloud2を選びました。

Screenshot from 2025-08-03 10-59-05.png

最後に、左上のFixed Frameをcamera_linkに指定しましょう。

Screenshot from 2025-08-03 11-00-12.png

カーテンのひだが綺麗に表示されましたね。

おわりに

ROS2 Humble上で、D435が無事に動作することをお祈りしています。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?