Robotics StackExchange | Archived questions

Publishing new rosjava messages

Hi,

I want to publish new messages to a rosnode, but from the pubsub tutorial it seems everything is done within the loop. I call it from javascript with something like Packages.org.ros.rosjavatutorialpubsub.Talker.incMessage("Hi, this is a message");

Then another message from a different javascript call with Packages.org.ros.rosjavatutorialpubsub.Talker.incMessage("This is another message");

However, every time I do this it seems the method incMessage does not have access to the std_msg in the loop. Could someone give me an example of how I would accomplish this? It seems like it should be simple, but I can't figure it out.

Ideally, the message would only be "printed" once, but the loop would continue running waiting for a new message. I

Thanks and best, James

Asked by jforkey on 2013-03-11 11:44:53 UTC

Comments

Answers