Add default zeros from other repo

This commit is contained in:
David Lu!! 2013-03-25 18:46:55 -07:00
parent 9bde6b4dc2
commit 74dcd6a6f2
1 changed files with 7 additions and 3 deletions

View File

@ -29,6 +29,8 @@ class JointStatePublisher():
use_mimic = get_param('use_mimic_tags', True)
use_small = get_param('use_smallest_joint_limits', True)
self.zeros = get_param("zeros")
pub_def_positions = get_param("publish_default_positions", True)
pub_def_vels = get_param("publish_default_velocities", False)
pub_def_efforts = get_param("publish_default_efforts", False)
@ -73,7 +75,10 @@ class JointStatePublisher():
if name in self.dependent_joints:
continue
if minval > 0 or maxval < 0:
if self.zeros and name in self.zeros:
zeroval = self.zeros[name]
elif minval > 0 or maxval < 0:
zeroval = (maxval + minval)/2
else:
zeroval = 0
@ -318,4 +323,3 @@ if __name__ == '__main__':
jsp.app.MainLoop()
except rospy.ROSInterruptException: pass