68
69 ur_type = "ur5e"
70
71
72 runtime_config_package = LaunchConfiguration("runtime_config_package")
73 controllers_file = LaunchConfiguration("controllers_file")
74 description_package = LaunchConfiguration("description_package")
75 description_file = LaunchConfiguration("description_file")
76 moveit_config_package = LaunchConfiguration("moveit_config_package")
77 moveit_config_file = LaunchConfiguration("moveit_config_file")
78 prefix = LaunchConfiguration("prefix")
79
80 robot_description_content = Command(
81 [
82 PathJoinSubstitution([FindExecutable(name="xacro")]),
83 " ",
84 PathJoinSubstitution(
85 [FindPackageShare(description_package), "urdf", description_file]
86 ),
87 " ",
88 "name:=",
89 "ur",
90 " ",
91 "ur_type:=",
92 ur_type,
93 " ",
94 "prefix:=",
95 prefix,
96 " ",
97 ]
98 )
99 robot_description = {"robot_description": robot_description_content}
100
101
102 robot_description_semantic_content = Command(
103 [
104 PathJoinSubstitution([FindExecutable(name="xacro")]),
105 " ",
106 PathJoinSubstitution(
107 [FindPackageShare(moveit_config_package), "srdf", moveit_config_file]
108 ),
109 " ",
110 "name:=",
111 "ur",
112 " ",
113 "ur_type:=",
114 ur_type,
115 " ",
116 "prefix:=",
117 prefix,
118 " ",
119 ]
120 )
121 robot_description_semantic = {"robot_description_semantic": robot_description_semantic_content}
122
123 kinematics_yaml =
load_yaml(
"ur_moveit_config",
"config/kinematics.yaml")
124 robot_description_kinematics = {"robot_description_kinematics": kinematics_yaml}
125
126 smacc2_sm_config = PathJoinSubstitution(
127 [
128 FindPackageShare("sm_test_moveit_ur5_sim"),
129 "config",
130 "sm_test_moveit_ur5_sim_config.yaml",
131 ]
132 )
133
134 sm_test_moveit_ur5_sim_node = Node(
135 package="sm_test_moveit_ur5_sim",
136 executable="sm_test_moveit_ur5_sim_node",
137 prefix="xterm -xrm 'XTerm*scrollBar: true' -xrm 'xterm*rightScrollBar: true' -hold -sl 10000 -geometry 1000x600 -e",
138 parameters=[
139 robot_description,
140 robot_description_semantic,
141 robot_description_kinematics,
142 smacc2_sm_config,
143 ],
144 arguments=["--log-level", "smacc2:=DEBUG"],
145 )
146
147 ur_control_launch = IncludeLaunchDescription(
148 PythonLaunchDescriptionSource(
149 [FindPackageShare("ur_simulation_ignition"), "/launch", "/ur_sim_control.launch.py"]
150 ),
151 launch_arguments={
152 "ur_type": ur_type,
153 "runtime_config_package": runtime_config_package,
154 "controllers_file": controllers_file,
155 "description_package": description_package,
156 "description_file": description_file,
157 "prefix": prefix,
158 "launch_rviz": "false",
159 }.items(),
160 )
161
162 ur_moveit_launch = IncludeLaunchDescription(
163 PythonLaunchDescriptionSource(
164 [FindPackageShare("ur_moveit_config"), "/launch", "/ur_moveit.launch.py"]
165 ),
166 launch_arguments={
167 "ur_type": ur_type,
168 "description_package": description_package,
169 "description_file": description_file,
170 "moveit_config_package": moveit_config_package,
171 "moveit_config_file": moveit_config_file,
172 "use_sim_time": "false",
173 "prefix": prefix,
174 "launch_rviz": "true",
175 }.items(),
176 )
177
178 nodes_to_launch = [
179 ur_control_launch,
180 ur_moveit_launch,
181 sm_test_moveit_ur5_sim_node,
182 ]
183
184 return nodes_to_launch
185
186
def load_yaml(package_name, file_path)
def launch_setup(context, *args, **kwargs)