46 self.
last = rospy.Time.now()
80 import xml.dom.minidom
82 from math
import pi, radians
87 description = rospy.get_param(
"robot_description")
88 robot = xml.dom.minidom.parseString(description).getElementsByTagName(
'robot')[0]
91 for child
in robot.childNodes:
92 if child.nodeType
is child.TEXT_NODE:
94 if child.localName ==
'joint':
95 jtype = child.getAttribute(
'type')
98 name = child.getAttribute(
'name')
99 if jtype ==
'continuous':
103 limit = child.getElementsByTagName(
'limit')[0]
104 minval = float(limit.getAttribute(
'lower'))
105 maxval = float(limit.getAttribute(
'upper'))
107 if minval > 0
or maxval < 0:
108 zeroval = (maxval + minval)/2
112 joint = {
'min':minval,
'max':maxval,
'zero':zeroval,
'value':zeroval }
116 rospy.loginfo(
'No URDF defined, proceeding with defaults')
122 min_angle = radians(default_min)
123 max_angle = radians(default_max)
126 min_angle = joint_defaults[name][
'min']
130 min_angle = radians(rospy.get_param(
"/arbotix/dynamixels/"+name+
"/min_angle"))
134 min_angle = radians(rospy.get_param(
"/arbotix/joints/"+name+
"/min_angle"))
138 min_angle = rospy.get_param(
"/arbotix/joints/"+name+
"/min_position")
143 max_angle = joint_defaults[name][
'max']
147 max_angle = radians(rospy.get_param(
"/arbotix/dynamixels/"+name+
"/max_angle"))
151 max_angle = radians(rospy.get_param(
"/arbotix/joints/"+name+
"/max_angle"))
155 max_angle = rospy.get_param(
"/arbotix/joints/"+name+
"/max_position")
159 return (min_angle, max_angle)