ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The publisher is sending messages with the message type keyboard/Key, but your subscriber is subscribing to message with the type std_msgs/Empty. Since these message types don't match, the subscriber will discard any messages it receives.

You're also reading data from the serial line with the Serial class in Arduino, and trying to use rosserial at the same time. Since both are trying to use the serial line, there will be a conflict, and rosserial probably will not work. The keypress data you want should be in the keyboard/Key message, so you don't need to do Serial.read().