-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaster.launch.py
More file actions
111 lines (95 loc) · 3.66 KB
/
master.launch.py
File metadata and controls
111 lines (95 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import launch
from launch.substitutions import Command, LaunchConfiguration
import launch_ros
import os
from launch import LaunchDescription
from launch.actions import (
IncludeLaunchDescription,
)
from launch.actions import ExecuteProcess
from launch.launch_description_sources import AnyLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
# new imports
from launch.actions import (DeclareLaunchArgument, TimerAction)
def generate_launch_description():
declare_ur_type = DeclareLaunchArgument(
"ur_type",
default_value="ur3e",
description="Robot type")
declare_description_file = DeclareLaunchArgument(
"description_file",
default_value="my_rg2.urdf.xacro",
description="URDF/XACRO description file")
declare_gazebo_gui = DeclareLaunchArgument(
name='gazebo_gui',
default_value='false',
choices=['true', 'false'],
description='Set to true to enable Gazebo GUI')
declare_launch_rviz = DeclareLaunchArgument(
name='launch_rviz',
default_value='false',
choices=['true', 'false'],
description='Set to true to launch RViz')
########################### BELOW SIMILAR TO BEFORE ############################
# ros2 launch maze_world launch_maze_world.launch.py cloud:=false
node_world = IncludeLaunchDescription(
AnyLaunchDescriptionSource([
os.path.join(get_package_share_directory( 'maze_world' ), 'launch', 'launch_maze_world.launch.py')
]),
launch_arguments={
'cloud': 'false'
}.items()
)
# ros2 launch ur_simulation_gz my_sim_control.launch.py ur_type:=ur3e description_file:=my_rg2.urdf.xacro gazebo_gui:=false launch_rviz:=false
node_spawn_robot_and_control = IncludeLaunchDescription(
AnyLaunchDescriptionSource([
os.path.join(get_package_share_directory( 'ur_simulation_gz' ), 'launch', 'my_sim_control.launch.py')
]),
launch_arguments={
'ur_type': LaunchConfiguration('ur_type'),
'description_file': LaunchConfiguration('description_file'),
'gazebo_gui': LaunchConfiguration('gazebo_gui'),
'launch_rviz': LaunchConfiguration('launch_rviz')
}.items()
)
# ros2 launch my_moveit_config move_group.launch.py
node_moveit_setup = IncludeLaunchDescription(
AnyLaunchDescriptionSource([
os.path.join(get_package_share_directory( 'my_moveit_config' ), 'launch', 'move_group.launch.py')
])
)
# ros2 launch moveit2_scripts test_trajectory.launch.py
node_moveit_commander = IncludeLaunchDescription(
AnyLaunchDescriptionSource([
os.path.join(get_package_share_directory( 'moveit2_scripts' ), 'launch', 'test_trajectory.launch.py')
])
)
# for -> ros2 run PKG EXECUTABLE
# aan_navigation_clients = ExecuteProcess(
# cmd=['ros2', 'run', 'PKG', 'EXECUTABLE'],
# output='screen'
# )
########################### DELAYS TO LAUNCHS ############################
return launch.LaunchDescription([
node_world,
declare_ur_type,
declare_description_file,
declare_gazebo_gui,
declare_launch_rviz,
# node_spawn_bridge_control,
TimerAction(
period=5.0,
actions=[node_spawn_robot_and_control]
),
TimerAction(
period=15.0,
actions=[node_moveit_setup]
),
TimerAction(
period=18.0,
actions=[node_moveit_commander]
),
])
'''
ros2 launch master.launch.py
'''