]> defiant.homedns.org Git - wt_open_manipulator.git/commitdiff
ported realsense launch file to ros2
authorErik Andresen <erik@vontaene.de>
Sat, 24 Oct 2026 05:20:36 +0000 (07:20 +0200)
committerErik Andresen <erik@vontaene.de>
Sat, 24 Oct 2026 05:20:36 +0000 (07:20 +0200)
config/realsense.yaml [new file with mode: 0644]
launch/realsense.launch [deleted file]
launch/realsense.launch.py [new file with mode: 0644]

diff --git a/config/realsense.yaml b/config/realsense.yaml
new file mode 100644 (file)
index 0000000..6264787
--- /dev/null
@@ -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 (file)
index 08cdbbe..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-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)
--->
-
-<launch>
-       <arg name="align_depth" default="true"/>
-
-       <include file="$(find realsense2_camera)/launch/rs_camera.launch">
-               <arg name="depth_fps"           default="15"/>
-               <arg name="infra_fps"           default="15"/>
-               <arg name="color_fps"           default="15"/>
-               <arg name="enable_fisheye"      default="false"/>
-               <arg name="enable_infra2"       default="false"/>
-               <arg name="enable_gyro"         default="false"/>
-               <arg name="enable_accel"        default="false"/>
-               <arg name="publish_tf"          default="true"/>
-               <arg name="publish_odom_tf"     default="false"/>
-               <arg name="enable_pointcloud"   default="false"/>
-               <arg name="align_depth"         value="$(arg align_depth)"/>
-               <!--
-               <arg name="filters"             default="pointcloud"/>
-               -->
-       </include>
-
-       <node pkg="web_video_server" type="web_video_server" name="web_video_server" output="screen"/>
-</launch>
diff --git a/launch/realsense.launch.py b/launch/realsense.launch.py
new file mode 100644 (file)
index 0000000..de573b7
--- /dev/null
@@ -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(),
+               ),
+       ])