moveit_task_constructor/demo/launch/run.launch.py
2025-10-04 18:17:56 +02:00

32 lines
1.0 KiB
Python

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from moveit_configs_utils import MoveItConfigsBuilder
def generate_launch_description():
moveit_config = (
MoveItConfigsBuilder("moveit_resources_panda")
.planning_pipelines(pipelines=["ompl"])
.robot_description(file_path="config/panda.urdf.xacro")
.to_moveit_configs()
)
package = "moveit_task_constructor_demo"
package_shared_path = get_package_share_directory(package)
node = Node(
package=package,
executable=LaunchConfiguration("exe"),
output="screen",
parameters=[
moveit_config.to_dict(),
os.path.join(package_shared_path, "config", "panda_config.yaml"),
],
)
arg = DeclareLaunchArgument(name="exe")
return LaunchDescription([arg, node])