# 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
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(
[
return LaunchDescription(
[
+ DeclareLaunchArgument('with_realsense', default_value=with_realsense, description='RealSense Depth Camera 435'),
Node(
package="robot_state_publisher",
executable="robot_state_publisher",
controllers_config,
],
),
+ IncludeLaunchDescription(
+ PythonLaunchDescriptionSource([os.path.join(get_package_share_directory('a4wd3_open_manipulator'), 'launch'),'/realsense.launch.py']),
+ condition=IfCondition(with_realsense)
+ ),
]
)