Skip to content

Commit fe2bc12

Browse files
committed
joint_state to config
1 parent ed2a377 commit fe2bc12

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/compas_fab/robots/robot.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,20 +1599,26 @@ def transformed_axes(self, configuration, group=None):
15991599
# drawing
16001600
# ==========================================================================
16011601

1602-
def update(self, joint_state, visual=True, collision=True):
1602+
def update(self, configuration, group, visual=True, collision=True):
16031603
"""Update the robot's geometry.
16041604
16051605
Parameters
16061606
----------
1607-
joint_state : :obj:`dict`
1608-
A dictionary with joint names as keys and joint positions as values.
1607+
configuration : :class:`Configuration`
1608+
Instance of the configuration (joint state) to move to.
1609+
group : :obj:`str`, optional
1610+
The name of the group to plan for. Defaults to the robot's main
1611+
planning group.
16091612
visual : :obj:`bool`, optional
16101613
``True`` if the visual geometry should be also updated, otherwise ``False``.
16111614
Defaults to ``True``.
16121615
collision : :obj:`bool`, optional
16131616
``True`` if the collision geometry should be also updated, otherwise ``False``.
16141617
Defaults to ``True``.
16151618
"""
1619+
if not len(configuration.joint_names):
1620+
configuration.joint_names = self.get_configurable_joint_names(group)
1621+
joint_state = dict(zip(configuration.joint_names, configuration.values))
16161622
self.artist.update(joint_state, visual, collision)
16171623

16181624
def draw_visual(self):

0 commit comments

Comments
 (0)