3 from sensor_msgs.msg
import JointState
9 rospy.init_node(
'position_joint_state_merger', anonymous=
True)
10 self.
subs_1 = rospy.Subscriber(
"/srh/position/joint_states", JointState, self.
callback1)
11 self.
subs_2 = rospy.Subscriber(
"/sr_arm/position/joint_states", JointState, self.
callback2)
13 self.
pub = rospy.Publisher(
"/positions/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
52 self.joint_state_msg.header.stamp = rospy.Time.now()
54 tmp = self.joint_state_msg.name
56 self.joint_state_msg.name = tmp
58 tmp = self.joint_state_msg.position
60 self.joint_state_msg.position = tmp
62 tmp = self.joint_state_msg.velocity
64 self.joint_state_msg.velocity = tmp
66 tmp = self.joint_state_msg.effort
68 self.joint_state_msg.effort = tmp
79 if __name__ ==
'__main__':
def callback2(self, data)
def callback1(self, data)