From 6fb586a30b7154c2054a8797cfd0d19d4ca97d96 Mon Sep 17 00:00:00 2001 From: Victor LEUNG Date: Fri, 21 Jun 2024 12:58:27 +0800 Subject: [PATCH] improve group and full configuration docs --- src/compas_fab/robots/robot.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/compas_fab/robots/robot.py b/src/compas_fab/robots/robot.py index 7ccc444ea..97a91c1b2 100644 --- a/src/compas_fab/robots/robot.py +++ b/src/compas_fab/robots/robot.py @@ -631,11 +631,16 @@ def get_attached_tool_collision_meshes(self): def zero_configuration(self, group=None): # type: (Optional[str]) -> Configuration - """Get the zero joint configuration. + """Get the zero joint configuration of the specified planning group. If zero is out of joint limits ``(upper, lower)`` then ``(upper + lower) / 2`` is used as joint value. + Parameters + ---------- + group : :obj:`str`, optional + The name of the planning group. Defaults to the main planning group. + Examples -------- >>> robot = RobotLibrary.ur5() @@ -657,7 +662,7 @@ def zero_configuration(self, group=None): def random_configuration(self, group=None): # type: (Optional[str]) -> Configuration - """Get a random configuration. + """Get a random configuration for the specified planning group. Parameters ---------- @@ -685,19 +690,20 @@ def random_configuration(self, group=None): def get_group_configuration(self, group, full_configuration): # type: (str, Configuration) -> Configuration - """Get the group's configuration. + """Filter a full configuration and return only the joints of the specified group. Parameters ---------- group : :obj:`str` The name of the planning group. full_configuration : :class:`compas_robots.Configuration` - The configuration for all configurable joints of the robot. + A full configuration (with all configurable joints of the robot). + Note that this object is not modified. Returns ------- :class:`compas_robots.Configuration` - The configuration of the group. + The configuration with only the joints of the specified group. """ full_configuration = self._check_full_configuration_and_scale(full_configuration)[ 0