Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createComponent関数で同一名のモジュールを区別できない問題の修正 #310

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading