Skip to content

Commit 9a66155

Browse files
committed
Fix dismatch robots in launchers
1 parent 3d6fb26 commit 9a66155

2 files changed

Lines changed: 13 additions & 43 deletions

File tree

Launchers/pick_place_harmonic/pick_place_harmonic.launch.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"""
66

77
import os
8-
import xacro
98
import yaml
109

1110
from launch import LaunchDescription
@@ -45,23 +44,6 @@ def generate_launch_description():
4544
)
4645
)
4746

48-
49-
xacro_file = os.path.join(
50-
get_package_share_directory("ros2srrc_ur5_gazebo"),
51-
"urdf",
52-
"ur5_robotiq_2f85.urdf.xacro"
53-
)
54-
55-
doc = xacro.parse(open(xacro_file))
56-
xacro.process_doc(doc, mappings={
57-
"EE": "true",
58-
"EE_name": "robotiq_2f85"
59-
})
60-
61-
robot_description = {
62-
"robot_description": doc.toxml()
63-
}
64-
6547
robot_description_semantic = {
6648
"robot_description_semantic": load_file(
6749
"ros2srrc_ur5_moveit2",
@@ -105,13 +87,11 @@ def generate_launch_description():
10587
"publish_transforms_updates": True,
10688
}
10789

108-
10990
move_group_node = Node(
11091
package="moveit_ros_move_group",
11192
executable="move_group",
11293
output="screen",
11394
parameters=[
114-
robot_description,
11595
robot_description_semantic,
11696
kinematics_yaml,
11797
joint_limits,
@@ -122,13 +102,11 @@ def generate_launch_description():
122102
],
123103
)
124104

125-
126105
robmove_node = Node(
127106
package="ros2srrc_execution",
128107
executable="robmove",
129108
output="screen",
130109
parameters=[
131-
robot_description,
132110
robot_description_semantic,
133111
kinematics_yaml,
134112
{"use_sim_time": True},
@@ -141,7 +119,6 @@ def generate_launch_description():
141119
executable="robpose",
142120
output="screen",
143121
parameters=[
144-
robot_description,
145122
robot_description_semantic,
146123
kinematics_yaml,
147124
{"use_sim_time": True},
@@ -154,7 +131,6 @@ def generate_launch_description():
154131
executable="move",
155132
output="screen",
156133
parameters=[
157-
robot_description,
158134
robot_description_semantic,
159135
kinematics_yaml,
160136
{"use_sim_time": True},
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
#!/usr/bin/env python3
2+
13
"""
24
Pick Place Harmonic - Robot Launcher
35
Wraps spawn_robot_warehouse.launch.py
46
"""
57

68
import os
9+
710
from launch import LaunchDescription
811
from launch.actions import IncludeLaunchDescription
912
from launch.launch_description_sources import PythonLaunchDescriptionSource
@@ -12,24 +15,15 @@
1215

1316
def generate_launch_description():
1417

15-
try:
16-
ur5_gripper_pkg = get_package_share_directory("ur5_gripper_description")
17-
except Exception as e:
18-
print(f"ERROR: Cannot find ur5_gripper_description package: {e}")
19-
print("Make sure packages are built in /home/ws")
20-
raise
21-
22-
warehouse_launch_file = os.path.join(
23-
ur5_gripper_pkg, "launch", "spawn_robot_warehouse.launch.py"
24-
)
25-
26-
print(f"Including launch file: {warehouse_launch_file}")
18+
pkg = get_package_share_directory("ros2srrc_ur5_gazebo")
2719

28-
warehouse_launch = IncludeLaunchDescription(
29-
PythonLaunchDescriptionSource(warehouse_launch_file),
30-
launch_arguments={
31-
"launch_rviz": "false",
32-
}.items(),
33-
)
20+
launch_file = os.path.join(pkg, "launch", "ur5.launch.py")
3421

35-
return LaunchDescription([warehouse_launch])
22+
return LaunchDescription([
23+
IncludeLaunchDescription(
24+
PythonLaunchDescriptionSource(launch_file),
25+
launch_arguments={
26+
"rviz": "false"
27+
}.items(),
28+
)
29+
])

0 commit comments

Comments
 (0)