relax_joints.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import roslib; roslib.load_manifest('pi_tracker')
00004 import rospy
00005 import sys
00006 
00007 from ax12_controller_core.srv import SetTorqueLimit
00008 
00009 class RelaxJoints():
00010     def __init__(self, enable):
00011         rospy.init_node('relax_joints')
00012         self.controller_namespace = rospy.get_param('controller_namespace', '/ax12_controller')
00013 
00014         self.set_torque_limit = dict()
00015         dynamixels = rospy.get_param(self.controller_namespace+'/dynamixels', dict())
00016         for name in sorted(dynamixels):
00017             rospy.wait_for_service(self.controller_namespace+'/'+name+'_controller/set_torque_limit')  
00018             self.set_torque_limit[name] = rospy.ServiceProxy(self.controller_namespace+'/'+name+'_controller/set_torque_limit', SetTorqueLimit)
00019             rospy.loginfo(name)
00020             self.set_torque_limit[name](0.0)
00021         
00022 if __name__ == '__main__':
00023     try:
00024         RelaxJoints(float(sys.argv[1]))
00025     except rospy.ROSInterruptException:
00026         pass


pi_tracker
Author(s): Patrick Goebel
autogenerated on Tue Jan 7 2014 11:27:49