Skip to content

Commit 6a790a1

Browse files
committed
Fix robot.py move.cpp and launcher
1 parent 4659ffb commit 6a790a1

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

Industrial/ros2_SimRealRobotControl_gz/ros2srrc_execution/python/robot/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class MoveCLIENT(Node):
112112
def __init__(self):
113113

114114
super().__init__('ros2srrc_Move_Client')
115-
self._action_client = ActionClient(self, Move, 'move_action')
115+
self._action_client = ActionClient(self, Move, 'Move')
116116

117117
print("[CLIENT - robot.py]: Initialising ROS2 /Move Action Client!")
118118
print("[CLIENT - robot.py]: Waiting for /Move ROS2 ActionServer to be available...")

Industrial/ros2_SimRealRobotControl_gz/ros2srrc_execution/src/move.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ int main(int argc, char ** argv)
492492

493493
// ROBOT
494494
if (param_ROB != "none"){
495-
std::string group_name = "manipulator";
495+
std::string group_name = "ur5_arm";
496496

497497
move_group_interface_ROB = MoveGroupInterface(node2, group_name);
498498
move_group_interface_ROB.setPlanningPipelineId("move_group");

Launchers/pick_place_harmonic/pick_place_harmonic.launch.py

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,18 @@ def generate_launch_description():
199199
move_node = Node(
200200
package="ros2srrc_execution",
201201
executable="move",
202-
output="both",
203-
parameters=common_params,
202+
output="screen",
203+
arguments=['--ros-args', '--log-level', 'debug'],
204+
parameters=[
205+
robot_description,
206+
robot_description_semantic,
207+
kinematics_yaml,
208+
moveit_controllers,
209+
{"moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager"}, # 👈 ESTE ES EL FIX
210+
{"use_sim_time": True},
211+
{"ROB_PARAM": "ur5"},
212+
{"EE_PARAM": "robotiq_2f85"},
213+
],
204214
)
205215

206216
robmove_node = Node(
@@ -222,6 +232,17 @@ def generate_launch_description():
222232
actions=[spawn_robot],
223233
)
224234

235+
delayed_execution_nodes = TimerAction(
236+
period=10.0,
237+
actions=[
238+
ExecuteProcess(cmd=["echo", ">>> LAUNCH: intentando lanzar move_node"]),
239+
move_node,
240+
robmove_node,
241+
robpose_node
242+
],
243+
)
244+
245+
print(">>> LAUNCH: move_node configurado")
225246

226247
return LaunchDescription([
227248

@@ -230,8 +251,7 @@ def generate_launch_description():
230251
clock_bridge,
231252
delayed_spawn,
232253
delayed_joint_state_broadcaster,
233-
234-
254+
delayed_execution_nodes,
235255

236256
RegisterEventHandler(
237257
OnProcessExit(
@@ -247,7 +267,6 @@ def generate_launch_description():
247267
)
248268
),
249269

250-
# MoveIt after controllers
251270
RegisterEventHandler(
252271
OnProcessExit(
253272
target_action=gripper_controller,
@@ -259,17 +278,4 @@ def generate_launch_description():
259278
],
260279
)
261280
),
262-
263-
# Action servers AFTER MoveIt
264-
RegisterEventHandler(
265-
OnProcessExit(
266-
target_action=gripper_controller,
267-
on_exit=[
268-
TimerAction(
269-
period=4.0,
270-
actions=[move_node, robmove_node, robpose_node],
271-
)
272-
],
273-
)
274-
),
275281
])

0 commit comments

Comments
 (0)