36 usage: tuck_arms.py [-l ACTION] [-r ACTION] 39 -l or --left Action for left arm 40 -r or --right Action for right arm 46 NB: If action unspecified for an arm, defaults to tuck 60 action_name =
'tuck_arms' 63 myargs = rospy.myargv()[1:]
67 goal.tuck_right =
True 68 opts, args = getopt.getopt(myargs,
'hql:r:', [
'quit',
'left',
'right'])
69 for arm, action
in opts:
70 if arm
in (
'-l',
'--left'):
71 if action
in (
'tuck',
't'):
73 elif action
in (
'untuck',
'u'): 74 goal.tuck_left = False 76 rospy.logerr(
'Invalid action for right arm: %s'%action)
77 rospy.signal_shutdown(
"ERROR")
79 if arm
in (
'-r',
'--right'):
80 if action
in (
'tuck',
't'):
81 goal.tuck_right =
True 82 elif action
in (
'untuck',
'u'): 83 goal.tuck_right = False 85 rospy.logerr(
'Invalid action for left arm: %s'%action)
86 rospy.signal_shutdown(
"ERROR")
88 if arm
in (
'--help',
'-h'):
89 print __doc__ % vars()
92 rospy.logdebug(
'Waiting for action server to start')
93 tuck_arm_client.wait_for_server(rospy.Duration(10.0))
94 rospy.logdebug(
'Sending goal to action server')
95 tuck_arm_client.send_goal_and_wait(goal, rospy.Duration(30.0), rospy.Duration(5.0))
97 if __name__ ==
"__main__":
98 rospy.init_node(
'tuck_amrs_test')