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

Your publisher and subscriber types do not match. You're publishing a rosserial_msgs/Adc message, but you're subscribing to a std_msgs/String. ROS cannot convert messages between different types, so instead it prints an error and drops the messages. You should have seen an error message about MD5 sum mismatch from the publisher or the subscriber.

You should change your subscriber to import the rosserial_msgs/Adc message with from rosserial_msgs.msg import Adc and then you should subscribe to the Adc message type instead of String.

As @ruben-alves says, you should also be able to confirm that your arduino is publishing by using rostopic list and rostopic echo /adc

Your publisher and subscriber types do not match. You're publishing a rosserial_msgs/Adcrosserial_arduino/Adc message, but you're subscribing to a std_msgs/String. ROS cannot convert messages between different types, so instead it prints an error and drops the messages. You should have seen an error message about MD5 sum mismatch from the publisher or the subscriber.

You should change your subscriber to import the rosserial_msgs/Adcrosserial_arduino/Adc message with from rosserial_msgs.msg rosserial_arduino.msg import Adc and then you should subscribe to the Adc message type instead of String.

As @ruben-alves says, you should also be able to confirm that your arduino is publishing by using rostopic list and rostopic echo /adc