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?

ROS2でRealsenseのcolor/depthの解像度の変更

Last updated at Posted at 2025-12-03

はじめに

Realsenseカメラのデフォルトではカラー画像の解像度とdepthデータの解像度が異なり,調べても指定の仕方を書いているサイトがなかったため(調べなくてもわかるということだと思うが),一応メモとして残しておく.

事象

以下のコマンドを実行したときに,カラー画像は640x480, depthは848x480であった.

ros2 launch realsense2_camera rs_launch.py
[realsense2_camera_node-1] [INFO] [1764752999.010081838] [camera.camera]: Starting Sensor: Depth Module
[realsense2_camera_node-1] [INFO] [1764752999.011284331] [camera.camera]: Open profile: stream_type: Depth(0), Format: Z16, Width: 848, Height: 480, FPS: 30
[realsense2_camera_node-1] [INFO] [1764752999.025410400] [camera.camera]: Starting Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1764752999.030325514] [camera.camera]: Open profile: stream_type: Color(0), Format: RGB8, Width: 640, Height: 480, FPS: 30

rs_launch.pyの該当パラメータ

ぱっと見わかりにくかったのだが,カラー画像とdepthに対してそれぞれrs_launch.pyの中のconfigurable_parametersのうち,以下の設定項目が原因だった.
color

{'name': 'rgb_camera.color_profile',     'default': '0,0,0', 'description': 'color stream profile'},

depth

{'name': 'depth_module.depth_profile',   'default': '0,0,0', 'description': 'depth stream profile'},

謎にデフォルト値がはすべて0だったので見つかりにくいということであった.
よって,ここを'default': '640,480,30'のように設定することで,colorやdepthの解像度を指定することができる.なお,順番は'width, height, fps'となる.

コマンドでの指定

上記からコマンドでの指定は以下のようになるとわかる.

ros2 launch realsense2_camera rs_launch.py depth_module.depth_profile:='640,480,30' rgb_camera.color_profile:='640,480,30'
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?