ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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
2 | No.2 Revision |
Your publisher and subscriber types do not match. You're publishing a
message, but you're subscribing to a rosserial_msgs/Adcrosserial_arduino/Adcstd_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
message with rosserial_msgs/Adcrosserial_arduino/Adcfrom
and then you should subscribe to the Adc message type instead of String.rosserial_msgs.msg rosserial_arduino.msg import Adc
As @ruben-alves says, you should also be able to confirm that your arduino is publishing by using rostopic list
and rostopic echo /adc