]> defiant.homedns.org Git - wt_open_manipulator.git/commitdiff
include realsense in launch file
authorErik Andresen <erik@vontaene.de>
Sat, 31 Oct 2026 07:40:01 +0000 (08:40 +0100)
committerErik Andresen <erik@vontaene.de>
Sat, 31 Oct 2026 07:40:01 +0000 (08:40 +0100)
launch/open_manipulator.launch.py

index c9f936c3ef2896471cb8eef7294a0aef08d919f1..c30c9325ca2e041b4e910978197a27c6601e8a36 100644 (file)
@@ -1,7 +1,12 @@
 # Launch the open manipulator hardware interface, controller manager and controllers.
 
+import os
+from ament_index_python.packages import get_package_share_directory
 from launch import LaunchDescription
-from launch.substitutions import Command, PathSubstitution
+from launch.launch_description_sources import PythonLaunchDescriptionSource
+from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
+from launch.conditions import IfCondition
+from launch.substitutions import Command, PathSubstitution, LaunchConfiguration
 
 from launch_ros.actions import Node
 from launch_ros.parameter_descriptions import ParameterValue
@@ -10,6 +15,7 @@ from launch_ros.substitutions import FindPackageShare
 
 def generate_launch_description():
     pkg_share = FindPackageShare("a4wd3_open_manipulator")
+    with_realsense = LaunchConfiguration('with_realsense', default=os.path.exists("/dev/v4l/by-id/usb-Intel_R__RealSense_TM__Depth_Camera_435_Intel_R__RealSense_TM__Depth_Camera_435-video-index0"))
 
     robot_description = Command(
         [
@@ -25,6 +31,7 @@ def generate_launch_description():
 
     return LaunchDescription(
         [
+            DeclareLaunchArgument('with_realsense', default_value=with_realsense, description='RealSense Depth Camera 435'),
             Node(
                 package="robot_state_publisher",
                 executable="robot_state_publisher",
@@ -60,5 +67,9 @@ def generate_launch_description():
                     controllers_config,
                 ],
             ),
+            IncludeLaunchDescription(
+                PythonLaunchDescriptionSource([os.path.join(get_package_share_directory('a4wd3_open_manipulator'), 'launch'),'/realsense.launch.py']),
+                condition=IfCondition(with_realsense)
+            ),
         ]
     )