Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions skiros2_skill/src/skiros2_skill/core/skill_instanciator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ def assign_instance(self, skill, ignore_list=list()):
"""
to_set = None
for p in self._available_instances[skill.type]:
if (p.label == skill.label or skill.label == "") and p.label not in ignore_list:
if (p.label == skill._label or skill._label == "") and p.label not in ignore_list:
to_set = p
if not p.hasState(State.Running): # The skill is available, just go forward
break
if to_set is not None:
if to_set.hasState(State.Running): # The skill instance is busy, create a new one
to_set = self.duplicate_instance(to_set)
skill.setInstance(to_set)
elif skill.label != "" and not ignore_list: # No instance exist, try to load it
skill.setInstance(self.add_instance(skill.label))
elif skill._label != "" and not ignore_list: # No instance exist, try to load it
skill.setInstance(self.add_instance(skill._label))
else:
log.error("assign_instance", "No instance of type {} found.".format(skill.type))
return False
Expand Down
2 changes: 1 addition & 1 deletion skiros2_skill/src/skiros2_skill/core/skill_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def tryOther(self, skill):
"""
@brief If the skill label is not specified, try other instances
"""
if skill.label != "":
if skill._label != "":
return False
ignore_list = [skill._instance.label]
while self._instanciator.assign_instance(skill, ignore_list):
Expand Down