From d01bcf790d1ccc6cf65be08942ab935241b1fd24 Mon Sep 17 00:00:00 2001 From: Erik Andresen Date: Sat, 24 Oct 2026 07:20:36 +0200 Subject: [PATCH] ported realsense launch file to ros2 --- config/realsense.yaml | 5 ++++ launch/realsense.launch | 44 -------------------------------- launch/realsense.launch.py | 51 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 config/realsense.yaml delete mode 100644 launch/realsense.launch create mode 100644 launch/realsense.launch.py diff --git a/config/realsense.yaml b/config/realsense.yaml new file mode 100644 index 0000000..6264787 --- /dev/null +++ b/config/realsense.yaml @@ -0,0 +1,5 @@ +depth_module.depth_profile: '640x480x6' +depth_module.infra_profile: '640x480x6' +rgb_camera.color_profile: '640x480x6' +depth_qos: SENSOR_DATA +color_qos: SENSOR_DATA diff --git a/launch/realsense.launch b/launch/realsense.launch deleted file mode 100644 index 08cdbbe..0000000 --- a/launch/realsense.launch +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/launch/realsense.launch.py b/launch/realsense.launch.py new file mode 100644 index 0000000..de573b7 --- /dev/null +++ b/launch/realsense.launch.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-15 -*- + +import os +from ament_index_python.packages import get_package_share_directory +from launch import LaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription +from launch.substitutions import LaunchConfiguration + +#v4l2-ctl -d /dev/video3 \-\-list-formats-ext +#ioctl: VIDIOC_ENUM_FMT +# Index : 0 +# Type : Video Capture +# Pixel Format: 'YUYV' +# Name : YUYV 4:2:2 +# Size: Discrete 424x240 +# Interval: Discrete 0.017s (60.000 fps) +# Interval: Discrete 0.033s (30.000 fps) +# Interval: Discrete 0.067s (15.000 fps) +# Interval: Discrete 0.167s (6.000 fps) +# Size: Discrete 640x480 +# Interval: Discrete 0.033s (30.000 fps) +# Interval: Discrete 0.067s (15.000 fps) +# Interval: Discrete 0.167s (6.000 fps) +# Size: Discrete 1280x720 +# Interval: Discrete 0.167s (6.000 fps) + +# RGB profiles: +# 1280x720x6 +# 424x240x15 +# 424x240x30 +# 424x240x6 +# 424x240x60 +# 640x480x15 +# 640x480x30 +# 640x480x6 + +def generate_launch_description(): + align_depth = LaunchConfiguration('align_depth', default=True) + + return LaunchDescription([ + DeclareLaunchArgument('align_depth.enable', default_value=align_depth), + IncludeLaunchDescription( + PythonLaunchDescriptionSource([os.path.join(get_package_share_directory('realsense2_camera'), 'launch'),'/rs_launch.py']), + launch_arguments={ + 'config_file': os.path.join(get_package_share_directory('a4wd3_open_manipulator'), 'config', 'realsense.yaml'), + 'align_depth.enable': align_depth, + }.items(), + ), + ]) -- 2.39.5