Robotics StackExchange | Archived questions

roslibjs subscriber not getting called

I want to implement a GUI for my robot in JavaScript with some command/display functionality so I'm looking into how to use roslibjs. But I am having problems running the basic example.

Publishing works fine but when I run rostopic pub /listener std_msgs/String "Hello, World" the callback is not getting called. The message is properly printed if I echo the /listener topic, but it doesn't seem to reach the roslibjs node.

The rosbridge launch terminal also prints [INFO] [WallTime: 1504549773.401212] [Client 0] Subscribed to /listener so the subscription should be set up properly.

Any ideas?

Asked by linusnie on 2017-09-04 10:14:00 UTC

Comments

Instead of running rostopic pub /listener std_msgs/String "Hello, World", try rostopic pub /listener std_msgs/String "Hello, World" -r 10

And try to reload the page (on the WebBrowser) only after run the 5 commands described on Running the Example section of the tutorial.

Asked by Ruben Alves on 2017-10-02 07:00:41 UTC

I'm currently encountering the same issue. Were you able to solve it?

Asked by Hendrik Wiese on 2019-08-20 01:52:02 UTC

Answers