Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
void loop(){
}

To handle incoming messages (ie: process event queues), rosserial needs you to call nh.spinOnce() periodically.

You're not doing that.

Refer to the Hello World tutorial on the rosserial_arduino/Tutorials page.

void loop(){
}

why cannot i run this code..?

To The code probably runs just fine, but to handle incoming messages (ie: process event queues), rosserial needs you to call nh.spinOnce() periodically.

You're not doing that.

You'll want to:

  1. call nh.spinOnce() in loop(), and
  2. add a delay(..) in there to control how often loop() is called

Refer to the Hello World tutorial on the rosserial_arduino/Tutorials page.