Skip to content

Commit cf115f6

Browse files
Add setter for rotation component of SE3. (#130)
1 parent 85c7373 commit cf115f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spatialmath/pose3d.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,13 @@ def shape(self) -> Tuple[int, int]:
10411041
"""
10421042
return (4, 4)
10431043

1044+
@SO3.R.setter
1045+
def R(self, r: SO3Array) -> None:
1046+
if len(self) > 1:
1047+
raise ValueError("can only assign rotation to length 1 object")
1048+
so3 = SO3(r)
1049+
self.A[:3, :3] = so3.R
1050+
10441051
@property
10451052
def t(self) -> R3:
10461053
"""

0 commit comments

Comments
 (0)