File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 = [
You can’t perform that action at this time.
0 commit comments