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

std_msgs/String does not have a method 'len'.

std_msgs/String has a field named 'data' and this field is a python string, where you can use 'len'.

Fire up a python interpreter:

>>> from std_msgs.msg import String
>>> s = String()
>>> len(s.data)
0
>>> len(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object of type 'String' has no len()

So look for the place where the exception is thrown, and correct the issue. It has probably nothing to do with kinetic vs melodic, you are maybe just hitting a different execution path in the code.