Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks! So much. @gvdhoom

Due to your answer I have undertood better. But Right now I have this problem. I can recive a topic value using rosbridge, but when I want send it by another topic something is wrong. I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);

Thanks! So much. @gvdhoom

Due to your answer I have undertood understood better. But Right now I have this problem. I can recive receive a topic value using rosbridge, but when I want send it by another topic topic, something is wrong. wrong.

I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support

support <html> var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);jptopic.publish(str); </html>

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support <html> enter code herevar listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str); </html>

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support <html> enter code herevar `var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str); jptopic.publish(str);` </html>

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support <html> `var var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);` jptopic.publish(str); </html>

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support <html> support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); //listener.unsubscribe(); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str); </html>jptopic.publish(str);

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something is wrong.

I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); message.data); document.write(message.data); //listener.unsubscribe(); var str = new ROSLIB.Message({ data : message.data }); jptopic.publish(str); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

var str = new ROSLIB.Message({ data : 'message.data' });

jptopic.publish(str);

Thanks! So much. @gvdhoom

Due to your answer I have understood better. But Right now I have this problem. I can receive a topic value using rosbridge, but when I want send it by another topic, something This is wrong.the solution:

I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); document.write(message.data); //listener.unsubscribe(); var str = new ROSLIB.Message({ data : message.data }); jptopic.publish(str); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

Thanks! So much. @gvdhoom

Due to your answer I have understood better. This is the solution:

I'll appreciate your support

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); document.write(message.data); //listener.unsubscribe(); var str = new ROSLIB.Message({ data : message.data }); jptopic.publish(str); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

Thanks! So much. @gvdhoom

Due to your answer I have understood better. This is the solution:

var listener2 = new ROSLIB.Topic({ ros : rbServer, name : '/chatter', messageType : 'std_msgs/String' });

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); document.write(message.data); //listener.unsubscribe(); var str = new ROSLIB.Message({ data : message.data }); jptopic.publish(str); });

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

click to hide/show revision 13
No.13 Revision

Thanks! So much. @gvdhoom

Due to your answer I have understood better. This is the solution:

var listener2 = new ROSLIB.Topic({
    ros : rbServer,
    name : '/chatter',
    messageType : 'std_msgs/String'
});

});

listener2.subscribe(function(message) { console.log('Received message on ' + listener2.name + ': ' + message.data); document.write(message.data); //listener.unsubscribe(); var str = new ROSLIB.Message({ data : message.data }); jptopic.publish(str); });

});

var jptopic = new ROSLIB.Topic({ ros : rbServer, name : '/chatter2', messageType : 'std_msgs/String' });

});