Skip to content

Commit ef51760

Browse files
committed
change kinematics.yaml and moveit_controllers.yaml and fix launcher
1 parent a6078c7 commit ef51760

3 files changed

Lines changed: 71 additions & 51 deletions

File tree

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
/**:
2-
ros__parameters:
3-
robot_description_kinematics:
4-
ur5_arm:
5-
kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
6-
kinematics_solver_search_resolution: 0.005
7-
kinematics_solver_timeout: 0.005
8-
kinematics_solver_attempts: 3
9-
10-
robotiq_2f85:
11-
kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
1+
ur5_manipulator:
2+
kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin
3+
kinematics_solver_search_resolution: 0.005
4+
kinematics_solver_timeout: 0.005
5+
kinematics_solver_attempts: 3
Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
controller_names:
2-
- joint_trajectory_controller
3-
- gripper_controller
1+
/**:
2+
ros__parameters:
3+
moveit_simple_controller_manager:
4+
controller_names:
5+
- joint_trajectory_controller
6+
- gripper_controller
47

5-
joint_trajectory_controller:
6-
action_ns: follow_joint_trajectory
7-
type: FollowJointTrajectory
8-
default: true
9-
joints:
10-
- shoulder_pan_joint
11-
- shoulder_lift_joint
12-
- elbow_joint
13-
- wrist_1_joint
14-
- wrist_2_joint
15-
- wrist_3_joint
8+
joint_trajectory_controller:
9+
type: FollowJointTrajectory
10+
action_ns: follow_joint_trajectory
11+
default: true
12+
joints:
13+
- shoulder_pan_joint
14+
- shoulder_lift_joint
15+
- elbow_joint
16+
- wrist_1_joint
17+
- wrist_2_joint
18+
- wrist_3_joint
1619

17-
gripper_controller:
18-
action_ns: follow_joint_trajectory
19-
type: FollowJointTrajectory
20-
default: true
21-
joints:
22-
- robotiq_85_left_knuckle_joint
20+
gripper_controller:
21+
type: FollowJointTrajectory
22+
action_ns: follow_joint_trajectory
23+
default: true
24+
joints:
25+
- robotiq_85_left_knuckle_joint

Launchers/pick_place_harmonic/pick_place_harmonic.launch.py

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from launch import LaunchDescription
88
from launch.actions import ExecuteProcess, RegisterEventHandler, TimerAction
9-
from launch.event_handlers import OnProcessExit
9+
from launch.event_handlers import OnProcessExit, OnProcessStart
1010
from launch_ros.actions import Node
1111
from ament_index_python.packages import get_package_share_directory
1212

@@ -80,19 +80,17 @@ def generate_launch_description():
8080
)
8181
}
8282

83-
raw_kinematics = load_yaml(
83+
kinematics_yaml = load_yaml(
8484
"ur5_gripper_moveit_config",
8585
"config/kinematics.yaml"
8686
)
8787

88-
kinematics_yaml = raw_kinematics["/**"]["ros__parameters"]
88+
moveit_controllers = load_yaml(
89+
"ur5_gripper_moveit_config",
90+
"config/moveit_controllers.yaml"
91+
)
8992

90-
moveit_controllers = {
91-
"moveit_simple_controller_manager": load_yaml(
92-
"ur5_gripper_moveit_config",
93-
"config/moveit_controllers.yaml"
94-
)
95-
}
93+
moveit_controllers = moveit_controllers["/**"]["ros__parameters"]
9694

9795
# =========================
9896
# CORE NODES
@@ -160,16 +158,16 @@ def generate_launch_description():
160158
],
161159
)
162160

163-
delayed_joint_state_broadcaster = TimerAction(
161+
"""delayed_joint_state_broadcaster = TimerAction(
164162
period=8.0,
165163
actions=[joint_state_broadcaster],
166-
)
164+
)"""
167165

168166
# =========================
169167
# MOVEIT
170168
# =========================
171169

172-
"""move_group = Node(
170+
move_group = Node(
173171
package="moveit_ros_move_group",
174172
executable="move_group",
175173
output="both",
@@ -180,8 +178,9 @@ def generate_launch_description():
180178
moveit_controllers,
181179
{"moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager"},
182180
{"use_sim_time": True},
181+
{"publish_robot_description_semantic": True},
183182
],
184-
)"""
183+
)
185184

186185
# =========================
187186
# EXECUTION NODES
@@ -255,15 +254,15 @@ def generate_launch_description():
255254
actions=[spawn_robot],
256255
)
257256

258-
delayed_execution_nodes = TimerAction(
257+
"""delayed_execution_nodes = TimerAction(
259258
period=10.0,
260259
actions=[
261260
ExecuteProcess(cmd=["echo", ">>> LAUNCH: intentando lanzar move_node"]),
262261
move_node,
263262
robmove_node,
264263
robpose_node
265264
],
266-
)
265+
)"""
267266

268267
print(">>> LAUNCH: move_node configurado")
269268

@@ -273,8 +272,15 @@ def generate_launch_description():
273272
robot_state_publisher,
274273
clock_bridge,
275274
delayed_spawn,
276-
delayed_joint_state_broadcaster,
277-
delayed_execution_nodes,
275+
#delayed_joint_state_broadcaster,
276+
#delayed_execution_nodes,
277+
278+
RegisterEventHandler(
279+
OnProcessExit(
280+
target_action=spawn_robot,
281+
on_exit=[joint_state_broadcaster],
282+
)
283+
),
278284

279285
RegisterEventHandler(
280286
OnProcessExit(
@@ -290,15 +296,32 @@ def generate_launch_description():
290296
)
291297
),
292298

293-
"""RegisterEventHandler(
299+
RegisterEventHandler(
294300
OnProcessExit(
295301
target_action=gripper_controller,
296302
on_exit=[
297303
TimerAction(
298-
period=2.0,
304+
period=5.0,
299305
actions=[move_group],
300306
)
301307
],
302308
)
303-
),"""
309+
),
310+
311+
RegisterEventHandler(
312+
OnProcessStart(
313+
target_action=move_group,
314+
on_start=[
315+
TimerAction(
316+
period=5.0,
317+
actions=[
318+
ExecuteProcess(cmd=["echo", ">>> move_group listo, lanzando ejecución"]),
319+
move_node,
320+
robmove_node,
321+
robpose_node
322+
],
323+
)
324+
],
325+
)
326+
),
304327
])

0 commit comments

Comments
 (0)