Skip to content

Commit

Permalink
Fix default optimizer not to be initialized unintentionally
Browse files Browse the repository at this point in the history
  • Loading branch information
lanius committed Apr 25, 2021
1 parent 2cea096 commit be8713d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tinyik/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Actuator(object):
"""Represents an actuator as a set of links and revolute joints."""

def __init__(self, tokens, optimizer=ScipyOptimizer()):
def __init__(self, tokens, optimizer=None):
"""Create an actuator from specified link lengths and joint axes."""
components = []
for t in tokens:
Expand All @@ -29,7 +29,8 @@ def __init__(self, tokens, optimizer=ScipyOptimizer()):
)

self.fk = FKSolver(components)
self.ik = IKSolver(self.fk, optimizer)
self.ik = IKSolver(
self.fk, ScipyOptimizer() if optimizer is None else optimizer)

self.angles = [0.] * len(
[c for c in components if isinstance(c, Joint)]
Expand Down

0 comments on commit be8713d

Please sign in to comment.