Skip to content

Commit 097dd72

Browse files
committed
adding get_group_names_from_link_name
1 parent 143d6d2 commit 097dd72

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/compas_fab/robots/robot.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,25 @@ def merge_group_with_full_configuration(self, group_configuration, full_configur
528528
configuration.values[i] = group_configuration.values[gi]
529529
return configuration
530530

531+
def get_group_names_from_link_name(self, link_name):
532+
"""Returns the group_names to which the link_name belongs to.
533+
534+
Parameters
535+
----------
536+
link_name : str
537+
The name of a link
538+
539+
Returns
540+
-------
541+
list of str
542+
A list of group names.
543+
"""
544+
group_names = []
545+
for group in self.group_names:
546+
if link_name in self.get_link_names(group):
547+
group_names.append(group)
548+
return group_names
549+
531550
def get_position_by_joint_name(self, configuration, joint_name, group=None):
532551
"""Returns the value of the joint_name in the passed configuration.
533552
"""

0 commit comments

Comments
 (0)