2 nodes publishing on same topic - merge?
Hello,
I have a robot description (urdf file) where the joint state publisher is publishing for all the non-fixed joints a message. I have 4 such joints which are published on topic /joint_states. But 2 of this joints I want to control with a script publishing on a different topic -> /motor/states.
The problem is when I remap from motor/states to joint_states, then the joint state messages switch between this two:
header:
seq: 7270
stamp:
secs: 1380880430
nsecs: 894582033
frame_id: ''
name: ['motor1', 'left_joint', 'right_joint', 'motor2']
position: [0.0, 0.0, 0.0, 0.0]
velocity: []
effort: []
---
header:
seq: 36366
stamp:
secs: 1380880430
nsecs: 900352954
frame_id: ''
name: ['motor1', 'motor2']
position: [0.0, 0.0015339807878856412]
velocity: [0.0, 0.0]
effort: []
what I actually want is left_joint and right_joint from the above message but replace the motor1 motor2 in the first by those in the second message.
Thanks for helping!