Skip to content

Commit 9beb8a5

Browse files
committed
Fix robot.py
1 parent f4362b1 commit 9beb8a5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • Industrial/ros2_SimRealRobotControl_gz/ros2srrc_execution/python/robot

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ def __init__(self):
116116

117117
print("[CLIENT - robot.py]: Initialising ROS2 /move_action Action Client!")
118118
print("[CLIENT - robot.py]: Waiting for /move_action ROS2 ActionServer to be available...")
119-
while not self._action_client.wait_for_server(timeout_sec=1.0):
120-
rclpy.spin_once(self)
119+
if not self._action_client.wait_for_server(timeout_sec=10.0):
120+
print("[ERROR] move_action server not available!")
121+
else:
122+
print("[OK] move_action server detected!")
121123
print("[CLIENT - robot.py]: /move_action ACTION SERVER detected, ready!")
122124
print("")
123125

0 commit comments

Comments
 (0)