37 PKG =
'gazebo_plugins' 42 roslib.load_manifest(PKG)
45 import os, os.path, threading, time
48 from geometry_msgs.msg
import Wrench, Vector3
49 import tf.transformations
as tft
50 from numpy
import float64
59 rospy.init_node(NAME, anonymous=
True)
63 for i
in range(0,len(sys.argv)):
64 if sys.argv[i] ==
'-update_rate':
65 if len(sys.argv) > i+1:
67 if sys.argv[i] ==
'-timeout':
68 if len(sys.argv) > i+1:
69 self.
timeout = float(sys.argv[i+1])
70 if sys.argv[i] ==
'-x':
71 if len(sys.argv) > i+1:
72 self.
target_l[0] = float(sys.argv[i+1])
73 if sys.argv[i] ==
'-y':
74 if len(sys.argv) > i+1:
75 self.
target_l[1] = float(sys.argv[i+1])
76 if sys.argv[i] ==
'-z':
77 if len(sys.argv) > i+1:
78 self.
target_l[2] = float(sys.argv[i+1])
79 if sys.argv[i] ==
'-R':
80 if len(sys.argv) > i+1:
81 self.
target_e[0] = float(sys.argv[i+1])
82 if sys.argv[i] ==
'-P':
83 if len(sys.argv) > i+1:
84 self.
target_e[1] = float(sys.argv[i+1])
85 if sys.argv[i] ==
'-Y':
86 if len(sys.argv) > i+1:
87 self.
target_e[2] = float(sys.argv[i+1])
88 if sys.argv[i] ==
'-t':
89 if len(sys.argv) > i+1:
99 timeout_t = time.time() + self.
timeout 100 while not rospy.is_shutdown()
and time.time() < timeout_t:
102 self.pub_set_wrench_topic.publish(w)
111 -update_rate <Hz> - update rate, default to 10 Hz 112 -timeout <seconds> - test timeout in seconds. default to 1 seconds 117 -P <pitch in radians> 119 -t set wrench topic name 122 if __name__ ==
'__main__':
124 if len(sys.argv) == 1:
def print_usage(exit_code=0)