Skip to content

Commit

Permalink
fixed get_msg_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Tiderko committed Dec 19, 2023
1 parent bef5468 commit 4ae43c9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import shlex
import sys
import traceback
from importlib import import_module

from launch.launch_context import LaunchContext
import asyncio
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 4ae43c9

Please sign in to comment.