ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
![]() | 1 | initial version |
If you publish messages of type UInt16, subscribing with a string will just not work. ROS is strict on message data types. According to your question, you tried to import the data type uint16
which does not exist in std_msgs
. The correct type is UInt16
. Try:
from std_msgs.msg import UInt16
and change the line that creates the subscriber to:
rospy.Subscriber('Adc', UInt16, callback)