Skip to content

Commit

Permalink
Allows choosing the kinematic solver used in the precomputed_tasks sc…
Browse files Browse the repository at this point in the history
…ript.
  • Loading branch information
Francois Keith committed Dec 10, 2013
1 parent 912f98d commit 058220f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class Solver:

def __init__(self, robot):
def __init__(self, robot, solverType=SOT):
self.robot = robot

# Make sure control does not exceed joint limits.
Expand All @@ -32,7 +32,7 @@ def __init__(self, robot):
plug(self.robot.dynamic.lowerJl, self.jointLimitator.lowerJl)

# Create the solver.
self.sot = SOT('solver')
self.sot = solverType('solver')
self.sot.signal('damping').value = 1e-6
self.sot.setSize(self.robot.dimension)

Expand Down Expand Up @@ -118,7 +118,7 @@ def createBalanceTask (robot, taskName, gain = 1.):
return task


def initialize (robot):
def initialize (robot, solverType=SOT):
"""
Tasks are stored into 'tasks' dictionary.
Expand Down Expand Up @@ -162,7 +162,7 @@ def initialize (robot):
initializeSignals (robot)

# --- create solver --- #
solver = Solver (robot)
solver = Solver (robot, solverType)

# --- push balance task --- #
solver.push (robot.tasks ['com'])
Expand Down

0 comments on commit 058220f

Please sign in to comment.