3 from launch
import LaunchDescription
4 from launch_ros.actions
import Node
5 from ament_index_python.packages
import get_package_share_directory
6 from launch_ros.actions
import ComposableNodeContainer
7 from launch_ros.descriptions
import ComposableNode
8 from launch.actions
import ExecuteProcess
10 from moveit_configs_utils
import MoveItConfigsBuilder
15 absolute_file_path = os.path.join(package_path, file_path)
18 with open(absolute_file_path,
"r")
as file:
20 except EnvironmentError:
26 absolute_file_path = os.path.join(package_path, file_path)
29 with open(absolute_file_path,
"r")
as file:
30 return yaml.safe_load(file)
31 except EnvironmentError:
38 .robot_description(file_path=
"config/panda.urdf.xacro")
43 servo_yaml =
load_yaml(
"moveit_servo",
"config/panda_simulated_config.yaml")
44 servo_params = {
"moveit_servo": servo_yaml}
55 arguments=[
"-d", rviz_config_file],
57 moveit_config.robot_description,
58 moveit_config.robot_description_semantic,
63 ros2_controllers_path = os.path.join(
66 "ros2_controllers.yaml",
68 ros2_control_node = Node(
69 package=
"controller_manager",
70 executable=
"ros2_control_node",
71 parameters=[moveit_config.robot_description, ros2_controllers_path],
75 joint_state_broadcaster_spawner = Node(
76 package=
"controller_manager",
79 "joint_state_broadcaster",
80 "--controller-manager-timeout",
82 "--controller-manager",
83 "/controller_manager",
87 panda_arm_controller_spawner = Node(
88 package=
"controller_manager",
90 arguments=[
"panda_arm_controller",
"-c",
"/controller_manager"],
94 container = ComposableNodeContainer(
95 name=
"moveit_servo_demo_container",
97 package=
"rclcpp_components",
98 executable=
"component_container_mt",
99 composable_node_descriptions=[
113 package=
"robot_state_publisher",
114 plugin=
"robot_state_publisher::RobotStatePublisher",
115 name=
"robot_state_publisher",
116 parameters=[moveit_config.robot_description],
120 plugin=
"tf2_ros::StaticTransformBroadcasterNode",
121 name=
"static_tf2_broadcaster",
122 parameters=[{
"child_frame_id":
"/panda_link0",
"frame_id":
"/world"}],
125 package=
"moveit_servo",
126 plugin=
"moveit_servo::JoyToServoPub",
127 name=
"controller_to_servo_node",
140 package=
"moveit_servo",
141 executable=
"servo_node_main",
144 moveit_config.robot_description,
145 moveit_config.robot_description_semantic,
146 moveit_config.robot_description_kinematics,
151 return LaunchDescription(
155 joint_state_broadcaster_spawner,
156 panda_arm_controller_spawner,
def get_package_share_directory(pkg_name)
def generate_launch_description()
def load_file(package_name, file_path)
def load_yaml(package_name, file_path)