-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Description
function declearSubAndPubs(rosNode) {
const nh = rosnodejs.nh;
const customMessage = rosnodejs.require('my_package').msg.TransportRequestType;
let pub = nh.advertise('/queue', customMessage);
let sub = rosNode.subscribe('/chatter', customMessage,
(data) => { // define callback execution
rosnodejs.log.info('I heard: [' + data.type + ']');
// send to pub
pub.publish(new customMessage({type: 1}));
pub.publish(new customMessage({type: 2}));
pub.publish(new customMessage({type: 3}));
pub.publish(new customMessage({type: 4}));
}
);
Hi, have a question about the publisher. In my prototype code, where whenever a message is heard, I consequently publish some messages of the same type to a channel.
However, when I rostopic echo queue, only the last message type: 4 is printed. Kindly asking why. Should I wait a minimal number of milliseconds between each publish or do something else? thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels