3 PKG =
"pr2_mechanism_controllers" 5 import roslib; roslib.load_manifest(PKG)
12 from std_msgs
import *
18 control.py <controller> sine <period> <amplitude> <offset> 19 - Defines a sine sweep for the laser controller 23 if __name__ ==
'__main__':
26 if sys.argv[2] ==
'sine' :
28 controller = sys.argv[1]
29 period = float (sys.argv[3])
30 amplitude = float (sys.argv[4])
31 offset = float (sys.argv[5])
33 print 'Sending Command: ' 34 print ' Profile Type: Sine' 35 print ' Period: %f Seconds' % period
36 print ' Amplitude: %f Radians' % amplitude
37 print ' Offset: %f Radians' % offset
39 rospy.wait_for_service(controller +
'/set_profile')
40 s = rospy.ServiceProxy(controller +
'/set_profile', SetProfile)
41 resp = s.call(SetProfileRequest(0.0, 0.0, 0.0, 0.0, profile_type, period, amplitude, offset))
44 print ' Response: %s' % str(resp.time)
46 print 'Unknown profile type [%s]' % sys.argv[2]
def print_usage(exit_code=0)