Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest('sr_robot_lib')
00004 import rospy
00005
00006 from sensor_msgs.msg import JointState
00007 from std_msgs.msg import Float64
00008
00009 class Merger(object):
00010 def __init__(self):
00011 self.subscriber = rospy.Subscriber("/joint_states", JointState, self.callback)
00012 self.publisher = rospy.Publisher("/lfj0_target", Float64)
00013
00014 def callback(self,data):
00015 msg_to_send = Float64()
00016
00017 msg_to_send.data = data.position[17] + data.position[18]
00018
00019 self.publisher.publish(msg_to_send)
00020
00021 if __name__ == '__main__':
00022 rospy.init_node("merger", anonymous=True)
00023 merger = Merger()
00024 rospy.spin()
00025
00026
00027
00028