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