AttributeError: module 'collections' has no attribute 'Iterable'
[ros2run]: Process exited with failure 1

遇到上述报错,ctrl+鼠标左键进入报错地方会发现:

def is_sequence(obj):
    """Test if "obj" is a sequence."""
    return isinstance(obj, collections.Iterable)


def is_three_sequence(obj):
    """Test if "obj" is of a sequence type and three long."""
    return isinstance(obj, collections.Iterable) and len(obj) == 3

改成:

def is_sequence(obj):
    """Test if "obj" is a sequence."""
    return isinstance(obj, collections.abc.Iterable)


def is_three_sequence(obj):
    """Test if "obj" is of a sequence type and three long."""
    return isinstance(obj, collections.abc.Iterable) and len(obj) == 3

问题解决

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐