relax_servo.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 """ Example code of how to relax a servo. """
00004 
00005 # We always import roslib, and load the manifest to handle dependencies
00006 import roslib; roslib.load_manifest('mini_max_tutorials')
00007 import rospy
00008 
00009 # The "relax" service is defined in arbotix_msgs
00010 from arbotix_msgs.srv import Relax
00011 
00012 if __name__=="__main__":
00013 
00014     # first thing, init a node!
00015     rospy.init_node('relax_servo')
00016 
00017     # wait for service to exist
00018     # this prevents an exception being thrown if this node starts before the ArbotiX is running.
00019     rospy.wait_for_service('/head_tilt_joint/relax')
00020 
00021     # create a proxy to relax the head tilt servo
00022     relax_proxy = rospy.ServiceProxy('/head_tilt_joint/relax', Relax)
00023 
00024     # use the proxy to make a service call
00025     # Relax has no parameters
00026     relax_proxy()
00027 
00028 


mini_max_tutorials
Author(s): Michael Ferguson
autogenerated on Mon Oct 6 2014 02:23:05