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?

RealSense D455でRTAB-MAPのrosbagを作る

Last updated at Posted at 2025-07-23

rosbagの記録

RealSenseの起動

imuを利用するため,追加の引数を指定

ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true enable_gyro:=true enable_accel:=true unite_imu_method:=1 enable_sync:=true

imu_filter_madwickの起動

RTAB-MAPはorientationも含めたimuの入力が必要
RealSenseではorientationが出力されないので,このパッケージで計算して出力する
これにより/tfが取得でき,RTAB-MAPが実行できるようになる

ros2 run imu_filter_madgwick imu_filter_madgwick_node --ros-args -p use_mag:=False -p world_frame:=enu -r imu/data_raw:=/camera/camera/imu

RTAB-MAPの起動

ros2 launch rtabmap_launch rtabmap.launch.py frame_id:=camera_link args:="-d" rgb_topic:=/camera/camera/color/image_raw depth_topic:=/camera/camera/aligned_depth_to_color/image_raw camera_info_topic:=/camera/camera/color/camera_info approx_sync:=true imu_topic:=/imu/data

rosbagのrecord

imu_filter_madwickで出力される/tfも含めて記録

ros2 bag record /camera/camera/color/image_raw /camera/camera/color/camera_info /camera/camera/aligned_depth_to_color/image_raw /camera/camera/imu /tf /tf_static /imu/data -s mcap 

rosbagからRTAB-MAPの実行

rosbagの再生

ros2 bag play <記録したファイルへのパス> --clock

RTAB-MAPの実行

imuのqosポリシーが合わないとimuデータを利用できないため引数でポリシーを変更

ros2 launch rtabmap_launch rtabmap.launch.py frame_id:=camera_link args:="-d" rgb_topic:=/camera/camera/color/image_raw depth_topic:=/camera/camera/aligned_depth_to_color/image_raw camera_info_topic:=/camera/camera/color/camera_info imu_topic:=/imu/data approx_sync:=true qos:=2 use_sim_time:=true rviz:=true

結果

rosbagから実行できました

Screenshot from 2025-07-23 18-15-09.png

rosgraph.png

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?