def __init__(self):
self.joint_names = ['base_joint', 'shoulder_joint', 'elbow_joint', 'wrist_flex_joint', 'wrist_rot_joint',
'finger_joint1', 'finger_joint2']
# subscriber for setting joints position
self.states_sub = rospy.Subscriber("/as_arm/set_joints_states", JointState, self.callback,
queue_size=2)
# a list of publisher
self.joint_pub = dict()
self.joint_pose = dict()
for idx, name in enumerate(self.joint_names):
pub = rospy.Publisher("/as_arm/joint%d_position_controller/command" % (idx + 1), Float64, queue_size=3)
self.joint_pub[name] = pub
self.joint_pose[name] = Float64()
评论列表
文章目录