1+ #!/usr/bin/env python3
2+
13"""
2- Pick Place Harmonic - Main Launcher
4+ Pick Place Harmonic - Main Launcher (FULL)
35"""
46
57import os
8+
69from launch import LaunchDescription
7- from launch .actions import IncludeLaunchDescription
10+ from launch .actions import IncludeLaunchDescription , TimerAction
811from launch .launch_description_sources import PythonLaunchDescriptionSource
12+ from launch_ros .actions import Node
13+ from ament_index_python .packages import get_package_share_directory
914
1015
1116def generate_launch_description ():
1217
1318 base_dir = os .path .dirname (__file__ )
1419
1520 world_launch = IncludeLaunchDescription (
16- PythonLaunchDescriptionSource (os .path .join (base_dir , "world.launch.py" ))
21+ PythonLaunchDescriptionSource (
22+ os .path .join (base_dir , "world.launch.py" )
23+ )
1724 )
1825
1926 robot_launch = IncludeLaunchDescription (
20- PythonLaunchDescriptionSource (os .path .join (base_dir , "robot.launch.py" ))
27+ PythonLaunchDescriptionSource (
28+ os .path .join (base_dir , "robot.launch.py" )
29+ )
30+ )
31+
32+ moveit_launch = IncludeLaunchDescription (
33+ PythonLaunchDescriptionSource (
34+ os .path .join (
35+ get_package_share_directory ("ur5_gripper_moveit_config" ),
36+ "launch" ,
37+ "move_group.launch.py"
38+ )
39+ )
40+ )
41+
42+ robmove_node = Node (
43+ package = "ros2srrc_execution" ,
44+ executable = "robmove" ,
45+ output = "screen" ,
46+ parameters = [
47+ {"use_sim_time" : True },
48+ {"ROB_PARAM" : "ur5" }
49+ ],
50+ )
51+
52+ robpose_node = Node (
53+ package = "ros2srrc_execution" ,
54+ executable = "robpose" ,
55+ output = "screen" ,
56+ parameters = [
57+ {"use_sim_time" : True },
58+ {"ROB_PARAM" : "ur5" }
59+ ],
60+ )
61+
62+ move_node = Node (
63+ package = "ros2srrc_execution" ,
64+ executable = "move" ,
65+ output = "screen" ,
66+ parameters = [
67+ {"use_sim_time" : True },
68+ {"ROB_PARAM" : "ur5" },
69+ {"EE_PARAM" : "robotiq" },
70+ {"ENV_PARAM" : "gazebo" },
71+ ],
72+ )
73+
74+
75+ delayed_moveit = TimerAction (
76+ period = 5.0 ,
77+ actions = [moveit_launch ]
78+ )
79+
80+ delayed_interfaces = TimerAction (
81+ period = 8.0 ,
82+ actions = [robmove_node , robpose_node , move_node ]
2183 )
2284
23- return LaunchDescription ([world_launch , robot_launch ])
85+ return LaunchDescription ([
86+ world_launch ,
87+ robot_launch ,
88+ delayed_moveit ,
89+ delayed_interfaces
90+ ])
0 commit comments