From: Erik Andresen Date: Sat, 31 Oct 2026 07:40:01 +0000 (+0100) Subject: include realsense in launch file X-Git-Url: https://defiant.homedns.org/gitweb/?a=commitdiff_plain;h=a64c066c5b7b3ca0c0f51a86c440bcb5c66939a1;p=wt_open_manipulator.git include realsense in launch file --- diff --git a/launch/open_manipulator.launch.py b/launch/open_manipulator.launch.py index c9f936c..c30c932 100644 --- a/launch/open_manipulator.launch.py +++ b/launch/open_manipulator.launch.py @@ -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) + ), ] )