Skip to content

Commit 1d3d1dc

Browse files
committed
Assume a robot without a parent joint on its base is on the worldXY origin
1 parent a5ac8ba commit 1d3d1dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/compas_fab/robots/robot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def _get_current_base_frame(self, full_configuration, group):
270270
--------
271271
"""
272272

273-
base_link = self.get_base_link_name(group)
273+
base_link = self.get_base_link(group)
274274
# the group's original base_frame
275275
base_frame = self.get_base_frame(group)
276276

@@ -282,7 +282,11 @@ def _get_current_base_frame(self, full_configuration, group):
282282
# That's why we have to do the workaround with the Transformation.
283283

284284
joint_state = dict(zip(joint_names, joint_positions))
285-
base_frame_WCF = self.model.forward_kinematics(joint_state, link_name=base_link)
285+
286+
if not base_link.parent_joint:
287+
base_frame_WCF = Frame.worldXY()
288+
else:
289+
base_frame_WCF = self.model.forward_kinematics(joint_state, link_name=base_link.name)
286290
base_frame_RCF = self.represent_frame_in_RCF(base_frame_WCF, group)
287291

288292
base_frame_RCF.point *= self.scale_factor

0 commit comments

Comments
 (0)