Skip to content

Commit 696cbb3

Browse files
authored
Wait for controller action server in test_move. (UniversalRobots#535)
1 parent dab6cf7 commit 696cbb3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ur_robot_driver/scripts/test_move

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ class TrajectoryClient:
107107
FollowJointTrajectoryAction,
108108
)
109109

110+
# Wait for action server to be ready
111+
timeout = rospy.Duration(5)
112+
if not trajectory_client.wait_for_server(timeout):
113+
rospy.logerr("Could not reach controller action server.")
114+
sys.exit(-1)
115+
110116
# Create and fill trajectory goal
111117
goal = FollowJointTrajectoryGoal()
112118
goal.trajectory.joint_names = JOINT_NAMES
@@ -143,6 +149,12 @@ class TrajectoryClient:
143149
FollowCartesianTrajectoryAction,
144150
)
145151

152+
# Wait for action server to be ready
153+
timeout = rospy.Duration(5)
154+
if not trajectory_client.wait_for_server(timeout):
155+
rospy.logerr("Could not reach controller action server.")
156+
sys.exit(-1)
157+
146158
# The following list are arbitrary positions
147159
# Change to your own needs if desired
148160
pose_list = [

0 commit comments

Comments
 (0)