Skip to content

Commit 5fd9124

Browse files
authored
Merge pull request #81 from compas-dev/robot-without-base
Assume a robot without a parent joint on its base is on the worldXY origin
2 parents a5ac8ba + aabe8f7 commit 5fd9124

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Unreleased
2020

2121
**Fixed**
2222

23+
* Use WorldXY's origin as default for robots that are have no parent join on their base
24+
2325
**Deprecated**
2426

2527
0.7.0

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)