Edit:
I've been using import_message_from_namespaced_type wrong due to misleading erroneous mypy specifications
def import_message_from_namespaced_type(message_type: NamespacedType)
Leaving this issue open until the specification get fixed.
Original:
Bug report
Required Info:
- Operating System:
- Installation type:
- Version or commit hash:
- DDS implementation:
- Client library (if applicable):
Steps to reproduce issue
from rosidl_parser.definition import NamespacedType
from rosidl_runtime_py.import_message import import_message_from_namespaced_type
message = import_message_from_namespaced_type(
NamespacedType(['std_msgs', 'msg'], 'Bool'))
Expected behavior
Imports a std_msgs/msg/Bool
Actual behavior
Crash
AttributeError: 'NamespacedType' object has no attribute 'value_type'
Additional information
Crash comes from import_message_from_namespaced_type which expects a NamespacedType for input arg. NamespacedType expects as input args Iterable[str], str.
NamespacedType has base AbstractNestableType whereas the '__slots__' value_type comes from AbstractNestedType. Am I missing something or is it a bug ?