Add Small Joint Flag
This commit is contained in:
parent
36e7861b3a
commit
c7625616c1
|
@ -27,6 +27,7 @@ class JointStatePublisher():
|
||||||
self.joint_list = [] # for maintaining the original order of the joints
|
self.joint_list = [] # for maintaining the original order of the joints
|
||||||
self.dependent_joints = get_param("dependent_joints", {})
|
self.dependent_joints = get_param("dependent_joints", {})
|
||||||
use_mimic = get_param('use_mimic_tags', True)
|
use_mimic = get_param('use_mimic_tags', True)
|
||||||
|
use_small = get_param('use_smallest_joint_limits', True)
|
||||||
|
|
||||||
pub_def_positions = get_param("publish_default_positions", True)
|
pub_def_positions = get_param("publish_default_positions", True)
|
||||||
pub_def_vels = get_param("publish_default_velocities", False)
|
pub_def_vels = get_param("publish_default_velocities", False)
|
||||||
|
@ -50,6 +51,14 @@ class JointStatePublisher():
|
||||||
minval = float(limit.getAttribute('lower'))
|
minval = float(limit.getAttribute('lower'))
|
||||||
maxval = float(limit.getAttribute('upper'))
|
maxval = float(limit.getAttribute('upper'))
|
||||||
|
|
||||||
|
safety_tags = child.getElementsByTagName('safety_controller')
|
||||||
|
if use_small and len(safety_tags)==1:
|
||||||
|
tag = safety_tags[0]
|
||||||
|
if tag.hasAttribute('soft_lower_limit'):
|
||||||
|
minval = max(minval, float(tag.getAttribute('soft_lower_limit')))
|
||||||
|
if tag.hasAttribute('soft_upper_limit'):
|
||||||
|
maxval = min(maxval, float(tag.getAttribute('soft_upper_limit')))
|
||||||
|
|
||||||
mimic_tags = child.getElementsByTagName('mimic')
|
mimic_tags = child.getElementsByTagName('mimic')
|
||||||
if use_mimic and len(mimic_tags)==1:
|
if use_mimic and len(mimic_tags)==1:
|
||||||
tag = mimic_tags[0]
|
tag = mimic_tags[0]
|
||||||
|
|
Loading…
Reference in New Issue