34 node =
"simple_action_server_deadlock_companion" 36 max_action_duration = 3
42 from actionlib.msg
import TestAction, TestGoal
43 from actionlib_msgs.msg
import GoalStatus
51 random.seed(rospy.get_name() + str(rospy.Time.now().to_sec()))
59 while not rospy.is_shutdown():
61 self.action_client.send_goal(TestGoal())
64 action_duration = random.uniform(0, Constants.max_action_duration)
65 self.action_client.wait_for_result(rospy.Duration(action_duration))
67 state = self.action_client.get_state()
68 if state == GoalStatus.ACTIVE
or state == GoalStatus.PENDING:
69 self.action_client.cancel_goal()
72 if __name__ ==
'__main__':
73 rospy.init_node(Constants.node)
77 except (KeyboardInterrupt, SystemExit):
A Simple client implementation of the ActionInterface which supports only one goal at a time...