Skip to content

Commit 27dd4d1

Browse files
committed
Workaround bug on compas 0.10.0
1 parent 5fd9124 commit 27dd4d1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/compas_fab/robots/constraints.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,14 @@ def __init__(self, link_name, quaternion, tolerances=None, weight=1.):
226226
def transform(self, transformation):
227227
R = Rotation.from_quaternion(self.quaternion)
228228
R = transformation * R
229-
self.quaternion = R.rotation.quaternion
229+
230+
# Due to a bug on COMPAS 0.10.0
231+
# (Fixed on https://github.com/compas-dev/compas/pull/378 but not released atm)
232+
# we work around the retrival of the rotation component of R and instead decompose and get it
233+
_, _, r, _, _ = R.decomposed()
234+
self.quaternion = r.quaternion
235+
# After that bug fix is released, the previous two lines should be changed to:
236+
# self.quaternion = R.rotation.quaternion
230237

231238
def __repr__(self):
232239
return "OrientationConstraint('{0}', {1}, {2}, {3})".format(self.link_name, self.quaternion, self.tolerances, self.weight)

0 commit comments

Comments
 (0)