3 from sensor_msgs.msg
import JointState
9 rospy.init_node(
'target_joint_state_merger', anonymous=
True)
10 self.
subs_1 = rospy.Subscriber(
"/srh/target/joint_states", JointState, self.
callback1)
11 self.
subs_2 = rospy.Subscriber(
"/sr_arm/target/joint_states", JointState, self.
callback2)
13 self.
pub = rospy.Publisher(
"/targets/joint_states", JointState)
20 self.
mutex = thread.allocate_lock()
32 self.joint_state_msg.header.stamp = rospy.Time.now()
35 self.joint_state_msg.name = tmp
38 self.joint_state_msg.position = tmp
41 self.joint_state_msg.velocity = tmp
44 self.joint_state_msg.effort = tmp
53 self.joint_state_msg.header.stamp = rospy.Time.now()
55 tmp = self.joint_state_msg.name
57 self.joint_state_msg.name = tmp
59 tmp = self.joint_state_msg.position
61 self.joint_state_msg.position = tmp
63 tmp = self.joint_state_msg.velocity
65 self.joint_state_msg.velocity = tmp
67 tmp = self.joint_state_msg.effort
69 self.joint_state_msg.effort = tmp
80 if __name__ ==
'__main__':
def callback1(self, data)
def callback2(self, data)