Skip to content

Commit

Permalink
Merge pull request #310 from Nobu19800/bugs/loadcomponent
Browse files Browse the repository at this point in the history
createComponent関数で同一名のモジュールを区別できない問題の修正
  • Loading branch information
n-ando authored Apr 16, 2024
2 parents 8efc91c + 70b0487 commit 8378cc3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions OpenRTM_aist/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,15 +938,15 @@ def createComponent(self, comp_args):
comp_id.getProperty("implementation_id"))
return None

if not found_obj.findNode("module_file_name"):
self._rtcout.RTC_ERROR("Hmm...module_file_name key not found.")
if not found_obj.findNode("module_file_path"):
self._rtcout.RTC_ERROR("Hmm...module_file_path key not found.")
return None

# module loading
self._rtcout.RTC_INFO(
"Loading module: %s",
found_obj.getProperty("module_file_name"))
self.load(found_obj.getProperty("module_file_name"), "")
found_obj.getProperty("module_file_path"))
self.load(found_obj.getProperty("module_file_path"), "")
factory = self._factory.find(comp_id)
if not factory:
self._rtcout.RTC_ERROR("Factory not found for loaded module: %s",
Expand Down Expand Up @@ -3577,16 +3577,19 @@ def __init__(self, name=None, prop=None, factory=None):
self._category = ""
self._impleid = name
self._version = ""
self._language = ""
elif prop:
self._vendor = prop.getProperty("vendor")
self._category = prop.getProperty("category")
self._impleid = prop.getProperty("implementation_id")
self._version = prop.getProperty("version")
self._language = prop.getProperty("language")
elif factory:
self._vendor = factory.profile().getProperty("vendor")
self._category = factory.profile().getProperty("category")
self._impleid = factory.profile().getProperty("implementation_id")
self._version = factory.profile().getProperty("version")
self._language = factory.profile().getProperty("language")

def __call__(self, factory):
if self._impleid == "":
Expand All @@ -3608,6 +3611,10 @@ def __call__(self, factory):
if self._version != "" and self._version != _prop.getProperty(
"version"):
return False

if self._language != "" and self._language != _prop.getProperty(
"language"):
return False

return True

Expand Down

0 comments on commit 8378cc3

Please sign in to comment.