From 19d231012888b1333801501d147ad95ec8e58e39 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Wed, 16 Oct 2024 21:02:10 -0700 Subject: [PATCH] Modifiying realsense2 namespace instead. --- .../launch/realsense_d435i_color.launch.py | 13 ++++++------- .../launch/realsense_d435i_infra.launch.py | 11 ++++++----- .../launch/realsense_d435i_stereo.launch.py | 13 +++++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/rtabmap_examples/launch/realsense_d435i_color.launch.py b/rtabmap_examples/launch/realsense_d435i_color.launch.py index 3638a35c1..8aa86aaa7 100644 --- a/rtabmap_examples/launch/realsense_d435i_color.launch.py +++ b/rtabmap_examples/launch/realsense_d435i_color.launch.py @@ -2,8 +2,6 @@ # A realsense D435i # Install realsense2 ros2 package (ros-$ROS_DISTRO-realsense2-camera) # Example: -# $ ros2 launch realsense2_camera rs_launch.py enable_gyro:=true enable_accel:=true unite_imu_method:=1 enable_sync:=true align_depth.enable:=true -# # $ ros2 launch rtabmap_examples realsense_d435i_color.launch.py import os @@ -25,9 +23,9 @@ def generate_launch_description(): remappings=[ ('imu', '/imu/data'), - ('rgb/image', '/camera/camera/color/image_raw'), - ('rgb/camera_info', '/camera/camera/color/camera_info'), - ('depth/image', '/camera/camera/aligned_depth_to_color/image_raw')] + ('rgb/image', '/camera/color/image_raw'), + ('rgb/camera_info', '/camera/color/camera_info'), + ('depth/image', '/camera/aligned_depth_to_color/image_raw')] return LaunchDescription([ @@ -39,7 +37,8 @@ def generate_launch_description(): PythonLaunchDescriptionSource([os.path.join( get_package_share_directory('realsense2_camera'), 'launch'), '/rs_launch.py']), - launch_arguments={'enable_gyro': 'true', + launch_arguments={'camera_namespace': "", + 'enable_gyro': 'true', 'enable_accel': 'true', 'unite_imu_method': '2', 'align_depth.enable': 'true', @@ -69,7 +68,7 @@ def generate_launch_description(): parameters=[{'use_mag': False, 'world_frame':'enu', 'publish_tf':False}], - remappings=[('imu/data_raw', '/camera/camera/imu')]), + remappings=[('imu/data_raw', '/camera/imu')]), # The IMU frame is missing in TF tree, add it: Node( diff --git a/rtabmap_examples/launch/realsense_d435i_infra.launch.py b/rtabmap_examples/launch/realsense_d435i_infra.launch.py index bd22b2fcc..e440c13d9 100644 --- a/rtabmap_examples/launch/realsense_d435i_infra.launch.py +++ b/rtabmap_examples/launch/realsense_d435i_infra.launch.py @@ -23,9 +23,9 @@ def generate_launch_description(): remappings=[ ('imu', '/imu/data'), - ('rgb/image', '/camera/camera/infra1/image_rect_raw'), - ('rgb/camera_info', '/camera/camera/infra1/camera_info'), - ('depth/image', '/camera/camera/depth/image_rect_raw')] + ('rgb/image', '/camera/infra1/image_rect_raw'), + ('rgb/camera_info', '/camera/infra1/camera_info'), + ('depth/image', '/camera/depth/image_rect_raw')] return LaunchDescription([ @@ -37,7 +37,8 @@ def generate_launch_description(): PythonLaunchDescriptionSource([os.path.join( get_package_share_directory('realsense2_camera'), 'launch'), '/rs_launch.py']), - launch_arguments={'enable_gyro': 'true', + launch_arguments={'camera_namespace': "", + 'enable_gyro': 'true', 'enable_accel': 'true', 'unite_imu_method': '2', 'enable_infra1': 'true', @@ -67,7 +68,7 @@ def generate_launch_description(): parameters=[{'use_mag': False, 'world_frame':'enu', 'publish_tf':False}], - remappings=[('imu/data_raw', '/camera/camera/imu')]), + remappings=[('imu/data_raw', '/camera/imu')]), # The IMU frame is missing in TF tree, add it: Node( diff --git a/rtabmap_examples/launch/realsense_d435i_stereo.launch.py b/rtabmap_examples/launch/realsense_d435i_stereo.launch.py index d10e10b9d..775e26a6f 100644 --- a/rtabmap_examples/launch/realsense_d435i_stereo.launch.py +++ b/rtabmap_examples/launch/realsense_d435i_stereo.launch.py @@ -22,10 +22,10 @@ def generate_launch_description(): remappings=[ ('imu', '/imu/data'), - ('left/image_rect', '/camera/camera/infra1/image_rect_raw'), - ('left/camera_info', '/camera/camera/infra1/camera_info'), - ('right/image_rect', '/camera/camera/infra2/image_rect_raw'), - ('right/camera_info', '/camera/camera/infra2/camera_info')] + ('left/image_rect', '/camera/infra1/image_rect_raw'), + ('left/camera_info', '/camera/infra1/camera_info'), + ('right/image_rect', '/camera/infra2/image_rect_raw'), + ('right/camera_info', '/camera/infra2/camera_info')] return LaunchDescription([ @@ -37,7 +37,8 @@ def generate_launch_description(): PythonLaunchDescriptionSource([os.path.join( get_package_share_directory('realsense2_camera'), 'launch'), '/rs_launch.py']), - launch_arguments={'enable_gyro': 'true', + launch_arguments={'camera_namespace': "", + 'enable_gyro': 'true', 'enable_accel': 'true', 'unite_imu_method': '2', 'enable_infra1': 'true', @@ -67,7 +68,7 @@ def generate_launch_description(): parameters=[{'use_mag': False, 'world_frame':'enu', 'publish_tf':False}], - remappings=[('imu/data_raw', '/camera/camera/imu')]), + remappings=[('imu/data_raw', '/camera/imu')]), # The IMU frame is missing in TF tree, add it: Node(