From 4ae43c957e259a54ae8518d20319cb3aadb61ab8 Mon Sep 17 00:00:00 2001 From: Alexander Tiderko Date: Tue, 19 Dec 2023 11:37:56 +0100 Subject: [PATCH] fixed get_msg_struct --- .../fkie_node_manager_daemon/launch_servicer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fkie_node_manager_daemon/fkie_node_manager_daemon/launch_servicer.py b/fkie_node_manager_daemon/fkie_node_manager_daemon/launch_servicer.py index 7721be89..1dbddb28 100644 --- a/fkie_node_manager_daemon/fkie_node_manager_daemon/launch_servicer.py +++ b/fkie_node_manager_daemon/fkie_node_manager_daemon/launch_servicer.py @@ -24,6 +24,7 @@ import shlex import sys import traceback +from importlib import import_module from launch.launch_context import LaunchContext import asyncio @@ -722,9 +723,9 @@ def get_msg_struct(self, msg_type: str) -> LaunchMessageStruct: f"{self.__class__.__name__}: Request to [ros.launch.get_msg_struct]: msg [{msg_type}]") result = LaunchMessageStruct(msg_type) try: - splitted_type = msg_type.replace('/', '.').split('.') + splitted_type = msg_type.replace('/', '.').rsplit('.', 1) splitted_type.reverse() - module = __import__(splitted_type.pop()) + module = import_module(splitted_type.pop()) sub_class = getattr(module, splitted_type.pop()) while splitted_type: sub_class = getattr(sub_class, splitted_type.pop())