Skip to content

Commit

Permalink
Make fk and ik public so that can switch solvers after instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
lanius committed Mar 14, 2020
1 parent b8350e9 commit 33e12bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tinyik/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(self, tokens, optimizer=ScipyOptimizer()):
'link length or joint axis: {}'.format(t)
)

self._fk = FKSolver(components)
self._ik = IKSolver(self._fk, optimizer)
self.fk = FKSolver(components)
self.ik = IKSolver(self.fk, optimizer)

self.angles = [0.] * len(
[c for c in components if isinstance(c, Joint)]
Expand All @@ -48,8 +48,8 @@ def angles(self, angles):
@property
def ee(self):
"""The end-effector position."""
return self._fk.solve(self.angles)
return self.fk.solve(self.angles)

@ee.setter
def ee(self, position):
self.angles = self._ik.solve(self.angles, position)
self.angles = self.ik.solve(self.angles, position)

0 comments on commit 33e12bb

Please sign in to comment.